From fec364847861e5a04dfd44a8d77cb25bf64820c7 Mon Sep 17 00:00:00 2001
From: Roberto Vargas <roberto.vargas@arm.com>
Date: Tue, 8 May 2018 10:27:10 +0100
Subject: [PATCH] Create a library file for libfdt

TF Makefile was linking all the objects files generated for the
fdt library instead of creating a static library that could be
used in the linking stage.

Change-Id: If3705bba188ec39e1fbf2322a7f2a9a941e1b90d
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
---
 lib/libfdt/libfdt.mk          | 2 ++
 plat/arm/common/arm_common.mk | 3 +--
 plat/qemu/platform.mk         | 3 +--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/libfdt/libfdt.mk b/lib/libfdt/libfdt.mk
index d03dde204..1cbbd7852 100644
--- a/lib/libfdt/libfdt.mk
+++ b/lib/libfdt/libfdt.mk
@@ -15,3 +15,5 @@ LIBFDT_SRCS	:=	$(addprefix lib/libfdt/,	\
 			fdt_wip.c)			\
 
 INCLUDES	+=	-Iinclude/lib/libfdt
+
+$(eval $(call MAKE_LIB,fdt))
diff --git a/plat/arm/common/arm_common.mk b/plat/arm/common/arm_common.mk
index 67b574de6..d8eda35b6 100644
--- a/plat/arm/common/arm_common.mk
+++ b/plat/arm/common/arm_common.mk
@@ -185,8 +185,7 @@ include lib/libfdt/libfdt.mk
 
 DYN_CFG_SOURCES		+=	plat/arm/common/arm_dyn_cfg.c		\
 				plat/arm/common/arm_dyn_cfg_helpers.c	\
-				common/fdt_wrappers.c			\
-				${LIBFDT_SRCS}
+				common/fdt_wrappers.c
 
 BL1_SOURCES		+=	${DYN_CFG_SOURCES}
 BL2_SOURCES		+=	${DYN_CFG_SOURCES}
diff --git a/plat/qemu/platform.mk b/plat/qemu/platform.mk
index 379ab3dca..1d46eeccd 100644
--- a/plat/qemu/platform.mk
+++ b/plat/qemu/platform.mk
@@ -132,8 +132,7 @@ BL2_SOURCES		+=	drivers/io/io_semihosting.c		\
 				plat/qemu/qemu_io_storage.c		\
 				plat/qemu/${ARCH}/plat_helpers.S	\
 				plat/qemu/qemu_bl2_setup.c		\
-				plat/qemu/dt.c				\
-				$(LIBFDT_SRCS)
+				plat/qemu/dt.c
 ifeq (${LOAD_IMAGE_V2},1)
 BL2_SOURCES		+=	plat/qemu/qemu_bl2_mem_params_desc.c	\
 				plat/qemu/qemu_image_load.c		\
-- 
GitLab