summaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2014-02-15 11:39:27 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2014-02-15 22:39:34 +0100
commit19f21a1d974d802f05c43e4cabd6ed6891a8ae50 (patch)
tree10c7e29675d627a74bb5342b53d0eb5a88357b46 /Rules.mak
parent79c0857a828abb3f7ec9582a01d706e0ce81f84c (diff)
buildsys: pass correct linker to compiler driver
Testing linker features has to be done against the correct linker. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'Rules.mak')
-rw-r--r--Rules.mak7
1 files changed, 4 insertions, 3 deletions
diff --git a/Rules.mak b/Rules.mak
index e63736205..9c191f3a5 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -200,9 +200,8 @@ check_gcc=$(shell \
check_as=$(shell \
if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \
then echo "-Wa,$(1)"; fi)
-# FIXME: filter -fuse-ld=% and pass that, too!!
check_ld=$(shell \
- if $(CC) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
+ if $(CC) $(LDFLAG-fuse-ld) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \
then echo "$(1)"; fi)
# Use variable indirection here so that we can have variable
@@ -255,6 +254,8 @@ ARFLAGS:=cr
# Note: The check for -nostdlib has to be before all calls to check_ld
$(eval $(call check-gcc-var,-nostdlib))
+LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS))
+# deliberately not named CFLAG-fuse-ld since unchecked and from user
# Flags in OPTIMIZATION are used only for non-debug builds
@@ -672,7 +673,7 @@ endif
$(eval $(call check-ld-var,--warn-once))
$(eval $(call check-ld-var,--sort-common))
$(eval $(call check-ld-var,--discard-all))
-LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared \
+LDFLAGS_NOSTRIP:=$(LDFLAG-fuse-ld) $(CPU_LDFLAGS-y) -shared \
-Wl,--warn-common $(CFLAG_-Wl--warn-once) -Wl,-z,combreloc
# binutils-2.16.1 warns about ignored sections, 2.16.91.0.3 and newer are ok
#$(eval $(call check-ld-var,--gc-sections))