summaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2017-06-24 01:01:11 +0800
committerMatt Johnston <matt@ucc.asn.au>2017-06-24 01:01:11 +0800
commit5896a4941d5d60598e3ad23a904a72c81501ba5f (patch)
treee6600abe989fceae093e966512139b2dafcb21c2 /configure.ac
parent521e63529c42513c06a8caa27ef22e93a63e9c38 (diff)
test for -pie linker flag as well, for Linux
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 5d792df..70ed1a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,7 +58,15 @@ if test "$hardenbuild" -eq 1; then
LDFLAGS="$LDFLAGS $TESTFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_NOTICE([Setting $TESTFLAGS])],
- [AC_MSG_NOTICE([Not setting $TESTFLAGS]); LDFLAGS="$OLDLDFLAGS" ]
+ [
+ LDFLAGS="$OLDLDFLAGS"
+ TESTFLAGS="-pie"
+ LDFLAGS="$LDFLAGS $TESTFLAGS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+ [AC_MSG_NOTICE([Setting $TESTFLAGS])],
+ [AC_MSG_NOTICE([Not setting $TESTFLAGS]); LDFLAGS="$OLDLDFLAGS" ]
+ )
+ ]
)
# readonly elf relocation sections (relro)
OLDLDFLAGS="$LDFLAGS"