Revision | 25751e796e83a75e0d443f96694e539ffbf4687a (tree) |
---|---|
Zeit | 2020-04-27 19:30:45 |
Autor | Marcel Patzlaff <m.patzlaff@pilz...> |
Commiter | Waldemar Brodkorb |
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>
@@ -189,11 +189,13 @@ endif | ||
189 | 189 | |
190 | 190 | # A nifty macro to make testing gcc features easier |
191 | 191 | check_gcc=$(shell \ |
192 | - if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ | |
193 | - then echo "$(1)"; else echo "$(2)"; fi) | |
192 | + tf="/tmp/cgccucl$$$$.o"; \ | |
193 | + if $(CC) $(1) -S -o $$tf -xc /dev/null > /dev/null 2>&1; \ | |
194 | + then echo "$(1)"; else echo "$(2)"; fi; rm -f $$tf ) | |
194 | 195 | check_as=$(shell \ |
195 | - if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \ | |
196 | - then echo "-Wa,$(1)"; fi) | |
196 | + tf="/tmp/casucl$$$$.o"; \ | |
197 | + if $(CC) -Wa,$(1) -Wa,-Z -c -o $$tf -xassembler /dev/null > /dev/null 2>&1; \ | |
198 | + then echo "-Wa,$(1)"; fi; rm -f $$tf ) | |
197 | 199 | check_ld=$(shell \ |
198 | 200 | tf="/tmp/clducl$$$$.c"; echo "int _start(){return 0;}int main(){return 0;}" >$$tf; \ |
199 | 201 | if $(CC) $(LDFLAG-fuse-ld) $(CFLAG_-Wl--no-warn-mismatch) -Wl,$(1) $(CFLAG_-nostdlib) -o /dev/null $$tf > /dev/null 2>&1; \ |