aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-11-08 16:52:32 +0100
committerSverker Eriksson <[email protected]>2016-11-11 15:59:16 +0100
commitedfa3b87542687baa2530a41241eb83d9afda1fb (patch)
tree9bea7dd331511cbab2efa6105d7a633817048929 /erts
parent5aa13e16ae81050509fceaf603650fc8594af7ec (diff)
downloadotp-edfa3b87542687baa2530a41241eb83d9afda1fb.tar.gz
otp-edfa3b87542687baa2530a41241eb83d9afda1fb.tar.bz2
otp-edfa3b87542687baa2530a41241eb83d9afda1fb.zip
erts: Disable -fPIE for HiPE on x86_64
Diffstat (limited to 'erts')
-rw-r--r--erts/configure.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 883ce2db68..531d5a1d2b 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -2771,6 +2771,23 @@ if test "$cross_compiling" != "yes" && test X${enable_hipe} != Xno; then
fi
fi
+dnl Check to disable -fPIE and friends for HiPE on amd64
+if test X${enable_hipe} = Xyes && test X$ARCH = Xamd64; then
+ AC_TRY_COMPILE(, [#if defined(__pie__) || defined(__PIE__)
+ #error -fPIE is enabled by default
+ #endif],
+ [AC_MSG_NOTICE([No -fPIE enabled by default])],
+ [AC_MSG_WARN([Security feature -fPIE will be disabled for HiPE])
+ STATIC_CFLAGS="-fno-PIE $STATIC_CFLAGS"
+ saved_LDFLAGS=$LDFLAGS
+ LDFLAGS="-no-pie $LDFLAGS"
+ AC_TRY_LINK(,, [],
+ [AC_MSG_WARN([Linked does not accept option -no-pie])
+ LDFLAGS=$saved_LDFLAGS])])
+
+fi
+
+
if test X${enable_fp_exceptions} = Xauto ; then
case $host_os in
*linux*)