summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-12-18 21:23:16 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-12-18 21:23:16 -0800
commit5d934b44b56fbf99c1c15bb72415d9fe81efc981 (patch)
tree03eab37ed306285f262e8a4614e61695cd3a3b43 /configure
parent0dd3cd6260ff9ddcd678f2e58ddf5ab506fd636c (diff)
downloadtxr-5d934b44b56fbf99c1c15bb72415d9fe81efc981.tar.gz
txr-5d934b44b56fbf99c1c15bb72415d9fe81efc981.tar.bz2
txr-5d934b44b56fbf99c1c15bb72415d9fe81efc981.zip
configure: disable building as PIE.
On some GNU/Linux distributions, the compiler is configured for PIE (position-independent executables). This is horrible garbage which causes our "make tests" to run more than 22% slower (e.g. 8.22 seconds versus 6.69) which is unacceptable. Worse, this was implicated in a crash in TXR's exception handling logic. The committed workaround for that problem stays in place for users who want to build TXR in the PIE style anyway. * configure: detect which, if any, of the known gcc and clang options are available for disabling PIE and add those to opt_flags (which turns into OPT_FLAGS in config.make).
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure25
1 files changed, 25 insertions, 0 deletions
diff --git a/configure b/configure
index 36e57b1e..c24b10ac 100755
--- a/configure
+++ b/configure
@@ -883,6 +883,31 @@ fi
rm -f conftest$exe
+printf "Checking how to disable PIE ..."
+
+nopie_flags=
+
+for flag in -nopie -no-pie ; do
+ if conftest EXTRA_FLAGS=$flag ; then
+ nopie_flags=" $flag"
+ break
+ fi
+done
+
+for flag in -fnopie -fno-pie ; do
+ if conftest EXTRA_FLAGS=$flag ; then
+ nopie_flags="$nopie_flags $flag"
+ break
+ fi
+done
+
+if [ -n "$nopie_flags" ]; then
+ printf "%s\n" "$nopie_flags"
+ opt_flags="$opt_flags$nopie_flags"
+else
+ printf " n/a\n"
+fi
+
#
# Check for annoying clashes from non-conforming BSD-derived systems that don't
# honor Unix/POSIX feature selection macros!