summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>2016-09-08 22:42:45 (GMT)
committerGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>2016-09-08 22:42:45 (GMT)
commitba7224f934165165e2ecdfcf0c1b467912e0e935 (patch)
tree94fc6a3b3139495d3dfee4d51cf0f36ab3973db3
parent32ca5cd5b0dddc251b446128dad9fe487040cdbe (diff)
parent14c7f71150c94ca35ca913b15c3d0cd236691ed6 (diff)
downloadcpython-ba7224f934165165e2ecdfcf0c1b467912e0e935.zip
cpython-ba7224f934165165e2ecdfcf0c1b467912e0e935.tar.gz
cpython-ba7224f934165165e2ecdfcf0c1b467912e0e935.tar.bz2
issue28032: never imply --with-lto as part of --with-optimizations.
Too many build tool chains do not properly support it, including building and linking an executable fine that simply segfaults when you try to run it (such as debian jessie 8.5's gcc 4.9). On others where it does appear to build (ubuntu 16.04's gcc 5.4) there are still test_distutils and test_gdb failures to deal with. We're not going to spend time attempting to maintain a complicated white list of what does and doesn't work in our configure.ac file.
-rw-r--r--README11
-rwxr-xr-xconfigure13
-rw-r--r--configure.ac13
3 files changed, 16 insertions, 21 deletions
diff --git a/README b/README
index ece06dc..ad3db25 100644
--- a/README
+++ b/README
@@ -48,8 +48,8 @@ You should do a "make clean" at the toplevel first.)
To get an optimized build of Python, "configure --with-optimizations" before
you run make. This sets the default make targets up to enable Profile Guided
-Optimization (PGO) and Link Time Optimization (LTO) on most platforms.
-For more details, see the sections bellow.
+Optimization (PGO) and may be used to auto-enable Link Time Optimization (LTO)
+on some platforms. For more details, see the sections bellow.
Profile Guided Optimization
@@ -79,9 +79,10 @@ that is optimized and suitable for distribution or production installation.
Link Time Optimization
----------------------
-LTO takes advantages of recent compiler toolchains ability to optimize across
-the otherwise arbitrary .o file boundary when building final executables or
-shared libraries for additional performance gains.
+Enabled via configure's --with-lto flag. LTO takes advantages of recent
+compiler toolchains ability to optimize across the otherwise arbitrary .o file
+boundary when building final executables or shared libraries for additional
+performance gains.
What's New
diff --git a/configure b/configure
index 04b1968..8c1650c 100755
--- a/configure
+++ b/configure
@@ -1510,7 +1510,7 @@ Optional Packages:
compiler
--with-suffix=.exe set executable suffix
--with-pydebug build with Py_DEBUG defined
- --with-optimizations Enable all optimizations when available (LTO, PGO,
+ --with-optimizations Enable expensive optimizations (PGO, maybe LTO,
etc). Disabled by default.
--with-lto Enable Link Time Optimization in PGO builds.
Disabled by default.
@@ -6495,13 +6495,10 @@ $as_echo "no" >&6; }
fi
if test "$Py_OPT" = 'true' ; then
- Py_LTO='true'
- case $ac_sys_system in
- Darwin*)
- # At least on macOS El Capitan, LTO does not work with PGO.
- Py_LTO='false'
- ;;
- esac
+ # Intentionally not forcing Py_LTO='true' here. Too many toolchains do not
+ # compile working code using it and both test_distutils and test_gdb are
+ # broken when you do managed to get a toolchain that works with it. People
+ # who want LTO need to use --with-lto themselves.
DEF_MAKE_ALL_RULE="profile-opt"
REQUIRE_PGO="yes"
DEF_MAKE_RULE="build_all"
diff --git a/configure.ac b/configure.ac
index 6f3ca24..06e6841 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1287,7 +1287,7 @@ AC_SUBST(DEF_MAKE_ALL_RULE)
AC_SUBST(DEF_MAKE_RULE)
Py_OPT='false'
AC_MSG_CHECKING(for --with-optimizations)
-AC_ARG_WITH(optimizations, AS_HELP_STRING([--with-optimizations], [Enable all optimizations when available (LTO, PGO, etc). Disabled by default.]),
+AC_ARG_WITH(optimizations, AS_HELP_STRING([--with-optimizations], [Enable expensive optimizations (PGO, maybe LTO, etc). Disabled by default.]),
[
if test "$withval" != no
then
@@ -1299,13 +1299,10 @@ else
fi],
[AC_MSG_RESULT(no)])
if test "$Py_OPT" = 'true' ; then
- Py_LTO='true'
- case $ac_sys_system in
- Darwin*)
- # At least on macOS El Capitan, LTO does not work with PGO.
- Py_LTO='false'
- ;;
- esac
+ # Intentionally not forcing Py_LTO='true' here. Too many toolchains do not
+ # compile working code using it and both test_distutils and test_gdb are
+ # broken when you do managed to get a toolchain that works with it. People
+ # who want LTO need to use --with-lto themselves.
DEF_MAKE_ALL_RULE="profile-opt"
REQUIRE_PGO="yes"
DEF_MAKE_RULE="build_all"