summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-08-02 06:19:34 +0000
committerAnatolij Gustschin <agust@denx.de>2012-08-10 23:26:10 +0200
commit7cb714a57837f1352d737ae07b56a5ce47c40431 (patch)
treeed749c5b5e0b7f264dcf7c15c1f734d8a85e5f98
parent578f35a338ea45b425f734a7772a49ffd796c6bb (diff)
downloadblackbird-obmc-uboot-7cb714a57837f1352d737ae07b56a5ce47c40431.tar.gz
blackbird-obmc-uboot-7cb714a57837f1352d737ae07b56a5ce47c40431.zip
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. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Khem Raj <raj.khem@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--config.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/config.mk b/config.mk
index 3dcea6a8f9..c3822a25c2 100644
--- a/config.mk
+++ b/config.mk
@@ -133,7 +133,11 @@ cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC))
# Include the make variables (CC, etc...)
#
AS = $(CROSS_COMPILE)as
-LD = $(CROSS_COMPILE)ld
+
+# Always use GNU ld
+LD = $(shell if $(CROSS_COMPILE)ld.bfd -v > /dev/null 2>&1; \
+ then echo "$(CROSS_COMPILE)ld.bfd"; else echo "$(CROSS_COMPILE)ld"; fi;)
+
CC = $(CROSS_COMPILE)gcc
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
OpenPOWER on IntegriCloud