[Python-checkins] cpython: Issue #21122: Fix LTO builds on OS X.

ned.deily python-checkins at python.org
Tue Sep 6 18:09:58 EDT 2016


https://hg.python.org/cpython/rev/cc5f8179a7ba
changeset:   103154:cc5f8179a7ba
user:        Ned Deily <nad at python.org>
date:        Tue Sep 06 15:09:20 2016 -0700
summary:
  Issue #21122: Fix LTO builds on OS X.
Patch by Brett Cannon.

files:
  Misc/NEWS    |   2 ++
  configure    |  27 +++++++++++----------------
  configure.ac |  13 ++++++++++---
  3 files changed, 23 insertions(+), 19 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -212,6 +212,8 @@
 
 - Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2.
 
+- Issue #21122: Fix LTO builds on OS X.
+
 Windows
 -------
 
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -775,7 +775,6 @@
 docdir
 oldincludedir
 includedir
-runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -886,7 +885,6 @@
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1139,15 +1137,6 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
-  | --runstate | --runstat | --runsta | --runst | --runs \
-  | --run | --ru | --r)
-    ac_prev=runstatedir ;;
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
-  | --run=* | --ru=* | --r=*)
-    runstatedir=$ac_optarg ;;
-
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1285,7 +1274,7 @@
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir runstatedir
+		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1438,7 +1427,6 @@
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -6484,13 +6472,20 @@
 if test "$Py_LTO" = 'true' ; then
   case $CC in
     *clang*)
-      # Any changes made here should be reflected in the GCC+Darwin case below
-      LTOFLAGS="-flto"
+      case $ac_sys_system in
+        Darwin*)
+          # Any changes made here should be reflected in the GCC+Darwin case below
+          LTOFLAGS="-flto -Wl,-export_dynamic"
+          ;;
+        *)
+          LTOFLAGS="-flto"
+          ;;
+      esac
       ;;
     *gcc*)
       case $ac_sys_system in
         Darwin*)
-          LTOFLAGS="-flto"
+          LTOFLAGS="-flto -Wl,-export_dynamic"
           ;;
         *)
           LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1299,13 +1299,20 @@
 if test "$Py_LTO" = 'true' ; then
   case $CC in
     *clang*)
-      # Any changes made here should be reflected in the GCC+Darwin case below
-      LTOFLAGS="-flto"
+      case $ac_sys_system in
+        Darwin*)
+          # Any changes made here should be reflected in the GCC+Darwin case below
+          LTOFLAGS="-flto -Wl,-export_dynamic"
+          ;;
+        *)
+          LTOFLAGS="-flto"
+          ;;
+      esac
       ;;
     *gcc*)
       case $ac_sys_system in
         Darwin*)
-          LTOFLAGS="-flto"
+          LTOFLAGS="-flto -Wl,-export_dynamic"
           ;;
         *)
           LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list