aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-10-30 15:23:47 +0100
committerLukas Larsson <[email protected]>2017-10-30 15:23:47 +0100
commit8bdd9727cbf73b576e6b4303d5e86e3ebbc9e4fa (patch)
tree88c85b4e8f5824d7765a6baa3a989944dec16413 /erts/configure.in
parent5c05e738eadcd0b6239b287adb536847da65bba1 (diff)
parent8c8467e3ad26932aaacfb01efb2118d986e5200f (diff)
downloadotp-8bdd9727cbf73b576e6b4303d5e86e3ebbc9e4fa.tar.gz
otp-8bdd9727cbf73b576e6b4303d5e86e3ebbc9e4fa.tar.bz2
otp-8bdd9727cbf73b576e6b4303d5e86e3ebbc9e4fa.zip
Merge branch 'lukas/erts/pgo/OTP-14604'
* lukas/erts/pgo/OTP-14604: erts: Only do PGO if gcc supports -fprofile-correction
Diffstat (limited to 'erts/configure.in')
-rw-r--r--erts/configure.in18
1 files changed, 7 insertions, 11 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 508e99a415..2f6043ee85 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -595,6 +595,8 @@ AS_HELP_STRING([--enable-pgo],
esac
],enable_pgo=default)
+LM_CHECK_ENABLE_CFLAG([-fprofile-use -fprofile-correction -Werror],[PROFILE_CORRECTION])
+
USE_PGO=false
AC_MSG_CHECKING([whether to do PGO of erts])
if test $enable_pgo = no; then
@@ -607,22 +609,16 @@ elif test $CROSS_COMPILING = yes; then
fi
elif test "X$host" = "Xwin32"; then
AC_MSG_RESULT([no, not supported in windows])
-elif test "X$PROFILE_GENERATE" = "Xtrue" -a "X$PROFILE_USE" = "Xtrue"; then
+elif test "X$PROFILE_GENERATE" = "Xtrue" -a "X$PROFILE_USE" = "Xtrue" -a "X$PROFILE_CORRECTION" = "Xtrue"; then
+ ## We need -fprofile-generate and -fprofile-correction support to use PGO with
+ ## gcc as multiple threads run within the executed object files
USE_PGO=true
- AC_MSG_RESULT([yes, using -fprofile-generate])
PROFILE_COMPILER=gcc
-# check if $CC accepts -fprofile-correction, if so we can use PGO on multi-threaded files.
- LM_CHECK_ENABLE_CFLAG([-fprofile-use -fprofile-correction -Werror],[PROFILE_CORRECTION])
- if test "X$PROFILE_CORRECTION" = "Xtrue"; then
- PROFILE_CORRECTION="-fprofile-correction"
- else
- PROFILE_CORRECTION=""
- fi
- AC_SUBST(PROFILE_CORRECTION)
+ AC_MSG_RESULT([yes, using -fprofile-generate -fprofile-correction])
elif test "X$PROFILE_INSTR_GENERATE" = "Xtrue" -a "X$PROFILE_INSTR_USE" = "Xtrue"; then
USE_PGO=true
- AC_MSG_RESULT([yes, using -fprofile-instr-generate])
PROFILE_COMPILER=clang
+ AC_MSG_RESULT([yes, using -fprofile-instr-generate])
else
if $enable_pgo = yes; then
AC_MSG_ERROR(cannot use PGO with this compiler)