summaryrefslogtreecommitdiffstats
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
commit54935c8e27eb8144411b15f3a910eed1cfb115c8 (patch)
tree03eab37ed306285f262e8a4614e61695cd3a3b43
parent166026246c2ff336d6092bc2ca2ba31d6cc23408 (diff)
downloadtxr-54935c8e27eb8144411b15f3a910eed1cfb115c8.tar.gz
txr-54935c8e27eb8144411b15f3a910eed1cfb115c8.tar.bz2
txr-54935c8e27eb8144411b15f3a910eed1cfb115c8.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).
-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!