summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Patzlaff <m.patzlaff@pilz.de>2020-04-24 14:09:23 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2020-04-27 12:30:45 +0200
commit25751e796e83a75e0d443f96694e539ffbf4687a (patch)
treebcbe9153a360d9786b1dc6bcb1f5cf7c69e77f3e
parentd987468fdcfe2091bd5d5481ea3a1ec24b12bca7 (diff)
Rules.mak: Fix check_as for recent binutils versions
As described in https://bugs.busybox.net/show_bug.cgi?id=12801 the check for '-Wa,--noexecstack' is not working since binutils 2.31.x. This fix adapts the approach already taken with check_ld and uses a temporary file. Further, check_gcc is also adapted to avoid future problems. Signed-off-by: Marcel Patzlaff <m.patzlaff@pilz.de>
-rw-r--r--Rules.mak10
1 files changed, 6 insertions, 4 deletions
diff --git a/Rules.mak b/Rules.mak
index 6a9f5cbca..a10518c03 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -189,11 +189,13 @@ endif
# A nifty macro to make testing gcc features easier
check_gcc=$(shell \
- if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
- then echo "$(1)"; else echo "$(2)"; fi)
+ tf="/tmp/cgccucl$$$$.o"; \
+ if $(CC) $(1) -S -o $$tf -xc /dev/null > /dev/null 2>&1; \
+ then echo "$(1)"; else echo "$(2)"; fi; rm -f $$tf )
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)
+ tf="/tmp/casucl$$$$.o"; \
+ if $(CC) -Wa,$(1) -Wa,-Z -c -o $$tf -xassembler /dev/null > /dev/null 2>&1; \
+ then echo "-Wa,$(1)"; fi; rm -f $$tf )
check_ld=$(shell \
tf="/tmp/clducl$$$$.c"; echo "int _start(){return 0;}int main(){return 0;}" >$$tf; \
if $(CC) $(LDFLAG-fuse-ld) $(CFLAG_-Wl--no-warn-mismatch) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null $$tf > /dev/null 2>&1; \