summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2013-06-07 21:36:19 +0200
committerH. Nikolaus Schaller <hns@goldelico.com>2013-06-08 12:08:50 +0200
commit07a74abe4086b1e7abb47ed5e5b7a6659744ce6f (patch)
tree9965b0ac56176873351d8f613c59d760e7d2b957
parente60c833431143963e3742d24d846b9698ef7efa2 (diff)
downloadbootable_bootloader_goldelico_gta04-07a74abe4086b1e7abb47ed5e5b7a6659744ce6f.zip
bootable_bootloader_goldelico_gta04-07a74abe4086b1e7abb47ed5e5b7a6659744ce6f.tar.gz
bootable_bootloader_goldelico_gta04-07a74abe4086b1e7abb47ed5e5b7a6659744ce6f.tar.bz2
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 <raj.khem@gmail.com>
-rw-r--r--u-boot/config.mk4
1 files changed, 3 insertions, 1 deletions
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