summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2018-01-30 12:45:52 +0000
committerGitHub <noreply@github.com>2018-01-30 12:45:52 +0000
commite282b9d97defe49c8ecc8638b5e5b29dae08eb67 (patch)
tree2ee0e5ccf2d41ffc7679f1b80dfb9a37c71e8e3d /Makefile
parente58f4d8eaf99f366b60718995146ed2121f3b34c (diff)
parentb25a577fda06482d68f6af7b54995c1c417f43e0 (diff)
Merge pull request #1220 from jwerner-chromium/JW_ld_bfd
Makefile: Use ld.bfd linker if available
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d5fa2ade..aa71ee31 100644
--- a/Makefile
+++ b/Makefile
@@ -127,6 +127,12 @@ NM := ${CROSS_COMPILE}nm
PP := ${CROSS_COMPILE}gcc -E
DTC ?= dtc
+# Use ${LD}.bfd instead if it exists (as absolute path or together with $PATH).
+ifneq ($(strip $(wildcard ${LD}.bfd) \
+ $(foreach dir,$(subst :, ,${PATH}),$(wildcard ${dir}/${LD}.bfd))),)
+LD := ${LD}.bfd
+endif
+
ifeq (${ARM_ARCH_MAJOR},7)
target32-directive = -target arm-none-eabi
# Will set march32-directive from platform configuration