From 1b25be202870c1fd2db663f4f3764237ed92a765 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 19 Dec 2019 21:30:16 -0800 Subject: 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. --- configure | 4 ++-- 1 file 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 -- cgit v1.2.3