comparison configure.ac @ 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 793c43cf523e bfed37d12d90
comparison
equal deleted inserted replaced
1427:f0e262a46d4e 1429:a097c9c9608a
56 OLDLDFLAGS="$LDFLAGS" 56 OLDLDFLAGS="$LDFLAGS"
57 TESTFLAGS="-Wl,-pie" 57 TESTFLAGS="-Wl,-pie"
58 LDFLAGS="$LDFLAGS $TESTFLAGS" 58 LDFLAGS="$LDFLAGS $TESTFLAGS"
59 AC_LINK_IFELSE([AC_LANG_PROGRAM([])], 59 AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
60 [AC_MSG_NOTICE([Setting $TESTFLAGS])], 60 [AC_MSG_NOTICE([Setting $TESTFLAGS])],
61 [AC_MSG_NOTICE([Not setting $TESTFLAGS]); LDFLAGS="$OLDLDFLAGS" ] 61 [
62 LDFLAGS="$OLDLDFLAGS"
63 TESTFLAGS="-pie"
64 LDFLAGS="$LDFLAGS $TESTFLAGS"
65 AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
66 [AC_MSG_NOTICE([Setting $TESTFLAGS])],
67 [AC_MSG_NOTICE([Not setting $TESTFLAGS]); LDFLAGS="$OLDLDFLAGS" ]
68 )
69 ]
62 ) 70 )
63 # readonly elf relocation sections (relro) 71 # readonly elf relocation sections (relro)
64 OLDLDFLAGS="$LDFLAGS" 72 OLDLDFLAGS="$LDFLAGS"
65 TESTFLAGS="-Wl,-z,now -Wl,-z,relro" 73 TESTFLAGS="-Wl,-z,now -Wl,-z,relro"
66 LDFLAGS="$LDFLAGS $TESTFLAGS" 74 LDFLAGS="$LDFLAGS $TESTFLAGS"