aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-11-11 16:23:42 +0100
committerSverker Eriksson <[email protected]>2016-11-11 16:23:42 +0100
commitb4c76edc46f82a4d09d9f569e1d4e6013b265389 (patch)
tree0c6291f63db3532f872f6f1d96efb9881f7815ad /erts/configure.in
parent867f7d604dff7d9ab34ca349e0ca3f29eba5c424 (diff)
parentedfa3b87542687baa2530a41241eb83d9afda1fb (diff)
downloadotp-b4c76edc46f82a4d09d9f569e1d4e6013b265389.tar.gz
otp-b4c76edc46f82a4d09d9f569e1d4e6013b265389.tar.bz2
otp-b4c76edc46f82a4d09d9f569e1d4e6013b265389.zip
Merge branch 'sverker/hipe-no-pie-amd64/ERL-294/PR-1239/OTP-14031' into maint
* sverker/hipe-no-pie-amd64: erts: Disable -fPIE for HiPE on x86_64 erts: Fix correct link flags for hipe_mkliterals
Diffstat (limited to 'erts/configure.in')
-rw-r--r--erts/configure.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 4799178583..ad9a66126f 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -2794,6 +2794,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*)