changeset 1429:a097c9c9608a

test for -pie linker flag as well, for Linux
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 01:01:11 +0800
parents f0e262a46d4e
children 7aebe7da3a35
files configure.ac
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sat Jun 24 00:42:20 2017 +0800
+++ b/configure.ac	Sat Jun 24 01:01:11 2017 +0800
@@ -58,7 +58,15 @@
 	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"