]> granicus.if.org Git - python/commitdiff
issue28032: never imply --with-lto as part of --with-optimizations.
authorGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>
Thu, 8 Sep 2016 22:44:44 +0000 (22:44 +0000)
committerGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>
Thu, 8 Sep 2016 22:44:44 +0000 (22:44 +0000)
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.

README
configure
configure.ac

diff --git a/README b/README
index 61cf46b41aa76ed910f342e705732dee5955c728..3ff044f0486fa4ae2a97d59159a4c0d0c9354afa 100644 (file)
--- a/README
+++ b/README
@@ -175,8 +175,8 @@ top level directory.
 
 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.
 
 Once you have built a Python interpreter, see the subsections below on
 testing and installation.  If you run into trouble, see the next
@@ -217,9 +217,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.
 
 
 Troubleshooting
index 19e3782d6198208e8eba10953bc4469d6add723d..d9a22eb866aec94eb8a20749a991879345a332e7 100755 (executable)
--- a/configure
+++ b/configure
@@ -1500,7 +1500,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.
@@ -6423,12 +6423,10 @@ $as_echo "no" >&6; }
 fi
 
 if test "$Py_OPT" = 'true' ; then
-  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.
   Py_LTO='true'
   DEF_MAKE_ALL_RULE="profile-opt"
   REQUIRE_PGO="yes"
index ae67c1d676706aabca1ce0c41571ccfa390670b6..5edbf7b2b7efceec73e3ae65f72b60c7924113ec 100644 (file)
@@ -1385,7 +1385,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
@@ -1397,12 +1397,10 @@ else
 fi],
 [AC_MSG_RESULT(no)])
 if test "$Py_OPT" = 'true' ; then
-  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.
   Py_LTO='true'
   DEF_MAKE_ALL_RULE="profile-opt"
   REQUIRE_PGO="yes"