From 365647e4f2b5cfd3d4b81d98bc87fef9c4b4219d Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 15 Dec 2014 15:52:12 +0200 Subject: [PATCH] Check relro directly --- pdns/configure-recursor | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pdns/configure-recursor b/pdns/configure-recursor index 4adf6a51a1..2882ba0c84 100755 --- a/pdns/configure-recursor +++ b/pdns/configure-recursor @@ -17,12 +17,9 @@ CF_STACK="" test_flags() { # test for relocation - relro=`$CXX -Wl,-help | grep -om1 -- '-z relro'` - now=`$CXX -Wl,-help | grep -om1 -- '-z now'` - - if [ "$relro" = "-z relro" ]; then + if $CXX -Wl,-help | grep -q 'z relro'; then export LD_RELRO="-Wl,-z -Wl,relro" - if [ "$now" = "-z now" ]; then + if $CXX -Wl,-help | grep -q 'z now'; then export LD_RELRO="$LD_RELRO -Wl,-z -Wl,now" fi fi @@ -38,8 +35,8 @@ EOF # test for PIE - if $CXX $src -c -o a.out -fPIE -fPIC -DPIE; then - if $CXX -pie -o a2.out a.out; then + if $CXX $src -c -o a.out -fPIE -fPIC -DPIE; then + if $CXX -pie -o a2.out a.out; then export CF_PIE="-fPIE -fPIC -DPIE" export LD_PIE="-pie" fi -- 2.47.2