# HG changeset patch # User Tassilo Philipp # Date 1495905503 -7200 # Node ID f8fe0f87b7c12f579b5b8878f736ce79d60d507d # Parent 91fd7be165f1943ca96368ea767cb91aeeb7a589 - removed configure-based checks for using --noexecstack / -Wa,--noexecstack in make A{S,C,}FLAGS variables, b/c inconsistent behaviour across platforms and often unusable, b/c: * braindead defaults (e.g. ASFLAGS on pretty much everything GNU, used in default suffix rules with *both* cc for .S and as for .s) * often took decisions on bogus private STACK headers in ELF files, set on platforms that lack any implementation, so pointless * tests have shown that only some GNU/* platforms and FreeBSD actually make use of this, if at all, that is... and for those, will switch back to .section .note.GNU-stack (next commit) diff -r 91fd7be165f1 -r f8fe0f87b7c1 configure --- a/configure Thu May 25 02:13:32 2017 +0200 +++ b/configure Sat May 27 19:18:23 2017 +0200 @@ -200,52 +200,54 @@ esac -# Assure objects not asking for an execstack (or binary that links dyncall might end -# up with one, for no reason). - -# .s.o/.S.o rules often use ${CC} which then invokes the tools needed. GCC and -# others might (annoyingly) assume that an executable stack may be required for -# those sources, if not told explicitly that it isn't. -# Neither specifying this per source (e.g. via .section .note.GNU-stack,"",...), nor -# per toolchain flags (e.g. as' --noexecstack) turned out to be portable across our -# supported platforms, toolchains, and different versions of the latter (some even -# producing the opposite result). -# Find needed build flags by running a few tests; use default if none result in "rw-". - -RWXTESTPREFIX="rwxtest" # @@@ put this maybe all in Makefile.generic? out of source builds? -for s in S s ; do ( - cd "$BLDTOP" - # asm test file, with main and _main for portability. - (echo '.text';(echo '.globl main';echo 'main:') | sed 'p;s/m/_m/') > $RWXTESTPREFIX.$s - - # Check var to be used, which depends on inference rules of this platform. E.g. ASFLAGS is only common on GNU, and - # on some other platforms only CFLAGS is the only one used, others use AFLAGS with cc and thus need -Wa,... Check - # makes use of the config written so far, so use '+=' to not overwrite vars. - for f in "" "ASFLAGS+=-Wa,--noexecstack" "ACFLAGS+=-Wa,--noexecstack" "AFLAGS+=--noexecstack" "AFLAGS+=-Wa,--noexecstack" "CFLAGS+=-Wa,--noexecstack"; do - # dummy makefile triggering inference rules, reflecting dyncall's build - make -f - <&1 | grep '^[ASC]\+FLAGS.*noexecstack$' | uniq >>$C +# removed, b/c platform support not consistent and ELF flags checked often not having any result +# +## Assure objects not asking for an execstack (or binary that links dyncall might end +## up with one, for no reason). +# +## .s.o/.S.o rules often use ${CC} which then invokes the tools needed. GCC and +## others might (annoyingly) assume that an executable stack may be required for +## those sources, if not told explicitly that it isn't. +## Neither specifying this per source (e.g. via .section .note.GNU-stack,"",...), nor +## per toolchain flags (e.g. as' --noexecstack) turned out to be portable across our +## supported platforms, toolchains, and different versions of the latter (some even +## producing the opposite result). +## Find needed build flags by running a few tests; use default if none result in "rw-". +# +#RWXTESTPREFIX="rwxtest" # @@@ put this maybe all in Makefile.generic? out of source builds? +#for s in S s ; do ( +# cd "$BLDTOP" +# # asm test file, with main and _main for portability. +# (echo '.text';(echo '.globl main';echo 'main:') | sed 'p;s/m/_m/') > $RWXTESTPREFIX.$s +# +# # Check var to be used, which depends on inference rules of this platform. E.g. ASFLAGS is only common on GNU, and +# # on some other platforms only CFLAGS is the only one used, others use AFLAGS with cc and thus need -Wa,... Check +# # makes use of the config written so far, so use '+=' to not overwrite vars. +# for f in "" "ASFLAGS+=-Wa,--noexecstack" "ACFLAGS+=-Wa,--noexecstack" "AFLAGS+=--noexecstack" "AFLAGS+=-Wa,--noexecstack" "CFLAGS+=-Wa,--noexecstack"; do +# # dummy makefile triggering inference rules, reflecting dyncall's build +# make -f - <&1 | grep '^[ASC]\+FLAGS.*noexecstack$' | uniq >>$C @@ -265,5 +267,5 @@ EOF done -echo "Configuration written do $C" +echo "Configuration written to $C"