diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2014-09-04 12:46:56 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2014-09-04 12:46:56 +0200 |
commit | 7a3acb243bc09f253a77faee7ee097a781f3eebe (patch) | |
tree | 128bedba687363d436a407ead72007d9996ed4ca | |
parent | 5c0c667fb21c74b4a9ac0554418a553bf1e11c1c (diff) |
buildsys: tweak check_ld flag probing
ld was (erroneously) complaining that it failed to merge private bfd
data. Silence this mismatch as seen on m68k with obfd binary.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | Rules.mak | 7 | ||||
-rw-r--r-- | extra/scripts/none.lds | 13 |
2 files changed, 18 insertions, 2 deletions
@@ -201,7 +201,7 @@ 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) check_ld=$(shell \ - if $(CC) $(LDFLAG-fuse-ld) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null -Wl,-b,binary /dev/null > /dev/null 2>&1; \ + if $(CC) $(LDFLAG-fuse-ld) $(CFLAG_-Wl--no-warn-mismatch) -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 @@ -254,8 +254,11 @@ 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 +LDFLAG-fuse-ld := $(filter -fuse-ld=%,$(EXTRA_UCLIBC_FLAGS)) +# failed to merge target specific data of file /dev/null +# Could use -Wl,--script,$(top_srcdir)extra/scripts/none.lds as well. +$(eval $(call check-ld-var,--no-warn-mismatch)) # Flags in OPTIMIZATION are used only for non-debug builds diff --git a/extra/scripts/none.lds b/extra/scripts/none.lds new file mode 100644 index 000000000..d6bd05afc --- /dev/null +++ b/extra/scripts/none.lds @@ -0,0 +1,13 @@ +/* GNU ld script + * Used by the build system to probe flags. + * Discards all output to avoid error + * "failed to merge target specific data of file %B". */ +TARGET(binary) +INPUT(/dev/null) +/* We could as well omit the whole SECTIONS block. + * This redundancy is just for clarity. */ +SECTIONS +{ + /DISCARD/ : { *(*) } +} + |