diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-10-29 23:21:25 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-10-29 23:21:25 +0000 |
commit | b98b560ad3092f32e8a1e76090799ad843ff38f0 (patch) | |
tree | 578fdd1110f50e5b7d00bfa6d48e8c4c16e97500 /configure | |
parent | 4d80d489d4c3f1c8ecbfe73ad73a63b74ad56ad9 (diff) | |
download | s6-rc-b98b560ad3092f32e8a1e76090799ad843ff38f0.tar.xz |
Support default pie
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -295,6 +295,16 @@ if [ "x$target" != "x$(cat $sysdeps/target)" ] ; then exit 1 fi +defaultpie=false +echo "Checking whether we're building PIE..." +if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST -dM -E - < /dev/null | grep -qF __PIE__ ; then + defaultpie=true + CFLAGS_AUTO="$CFLAGS_AUTO -fPIC" + echo " ... yes" +else + echo " ... no" +fi + spawn_lib=$(cat $sysdeps/spawn.lib) socket_lib=$(cat $sysdeps/socket.lib) sysclock_lib=$(cat $sysdeps/sysclock.lib) @@ -407,6 +417,11 @@ if $shared ; then else echo "DO_SHARED :=" fi +if $defaultpie ; then + echo "DEFAULT_PIE := 1" +else + echo "DEFAULT_PIE :=" +fi exec 1>&3 3>&- echo " ... done." |