summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-12-19 21:30:16 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-12-19 21:30:16 -0800
commit1b25be202870c1fd2db663f4f3764237ed92a765 (patch)
tree71257474af88888c9c2f514cfc62358af8fb112b /configure
parentae4fbbab2a2a619fe08fc551abbb83bf5cd53323 (diff)
downloadtxr-1b25be202870c1fd2db663f4f3764237ed92a765.tar.gz
txr-1b25be202870c1fd2db663f4f3764237ed92a765.tar.bz2
txr-1b25be202870c1fd2db663f4f3764237ed92a765.zip
config: improve check for PIE-disabling flags.
* configure: the logic must be cumulative; the test for the code generation flag (e.g. -fno-pie) needs to incorporate the previously detected linker flag (e.g. -no-pie). On x86_64, -fno-pie by itself without -no-pie fails with errors.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure4
1 files changed, 2 insertions, 2 deletions
diff --git a/configure b/configure
index f79a71ff..57f7a929 100755
--- a/configure
+++ b/configure
@@ -888,14 +888,14 @@ printf "Checking how to disable PIE ..."
nopie_flags=
for flag in -nopie -no-pie ; do
- if conftest EXTRA_FLAGS=$flag ; then
+ if conftest EXTRA_FLAGS=$flag && ! grep -q option conftest.err ; then
nopie_flags=" $flag"
break
fi
done
for flag in -fnopie -fno-pie ; do
- if conftest EXTRA_FLAGS=$flag ; then
+ if conftest EXTRA_FLAGS="$flag$nopie_flags" && ! grep -q option conftest.err ; then
nopie_flags="$nopie_flags $flag"
break
fi