[Gta04-owner] [PATCH] config: Always use GNU ld

Lukas Märdian luk at slyon.de
Fri Jun 7 21:36:19 CEST 2013

From: Khem Raj <raj.khem at gmail.com>

This patch makes sure that we always use the GNU ld. u-boot uses certain
construct e.g. OVERLAY which are not implemented in gold therefore it
always needs GNU ld for linking. It works well if default linker in
toolchain is GNU ld but in some cases we can have gold to be the
default linker and also ship GNU ld but not as default in such cases
its called $(PREFIX)ld.bfd, with this patch we make sure that if
$(PREFIX)ld.bfd exists than we use that for our ld. This way it
does not matter what the default ld is.

Upstream-status: Pending

Signed-off-by: Khem Raj <raj.khem at gmail.com>
 u-boot/config.mk |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/u-boot/config.mk b/u-boot/config.mk
index bf1cdc4..264b91d 100644
--- a/u-boot/config.mk
+++ b/u-boot/config.mk
@@ -99,11 +99,13 @@ HOSTCFLAGS	+= -pedantic
 cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
 		> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
+exists_bfd_ld = $(shell if $(CROSS_COMPILE)ld.bfd -v > /dev/null 2>&1; \
+		then echo "$(1)"; else echo "$(2)"; fi; )
 # Include the make variables (CC, etc...)
+LD	= $(call exists_bfd_ld, "$(CROSS_COMPILE)ld.bfd", "$(CROSS_COMPILE)ld")
 CPP	= $(CC) -E

More information about the Gta04-owner mailing list