From 07a74abe4086b1e7abb47ed5e5b7a6659744ce6f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 7 Jun 2013 21:36:19 +0200 Subject: config: Always use GNU ld 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 --- u-boot/config.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'u-boot') 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...) # AS = $(CROSS_COMPILE)as -LD = $(CROSS_COMPILE)ld +LD = $(call exists_bfd_ld, "$(CROSS_COMPILE)ld.bfd", "$(CROSS_COMPILE)ld") CC = $(CROSS_COMPILE)gcc CPP = $(CC) -E AR = $(CROSS_COMPILE)ar -- cgit v1.1