Issue #21122: Fix LTO builds on OS X.

Patch by Brett Cannon.
This commit is contained in:
Ned Deily 2016-09-06 15:09:20 -07:00
parent b84fd04f39
commit 8482ce4868
3 changed files with 23 additions and 19 deletions

View File

@ -212,6 +212,8 @@ Build
- Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2. - Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2.
- Issue #21122: Fix LTO builds on OS X.
Windows Windows
------- -------

27
configure vendored
View File

@ -775,7 +775,6 @@ infodir
docdir docdir
oldincludedir oldincludedir
includedir includedir
runstatedir
localstatedir localstatedir
sharedstatedir sharedstatedir
sysconfdir sysconfdir
@ -886,7 +885,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc' sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com' sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var' localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include' includedir='${prefix}/include'
oldincludedir='/usr/include' oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1139,15 +1137,6 @@ do
| -silent | --silent | --silen | --sile | --sil) | -silent | --silent | --silen | --sile | --sil)
silent=yes ;; 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) -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;; ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1285,7 +1274,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \ datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir libdir localedir mandir
do do
eval ac_val=\$$ac_var eval ac_val=\$$ac_var
# Remove trailing slashes. # Remove trailing slashes.
@ -1438,7 +1427,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var] --localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib] --libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include] --includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include] --oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -6484,13 +6472,20 @@ fi
if test "$Py_LTO" = 'true' ; then if test "$Py_LTO" = 'true' ; then
case $CC in case $CC in
*clang*) *clang*)
# Any changes made here should be reflected in the GCC+Darwin case below case $ac_sys_system in
LTOFLAGS="-flto" Darwin*)
# Any changes made here should be reflected in the GCC+Darwin case below
LTOFLAGS="-flto -Wl,-export_dynamic"
;;
*)
LTOFLAGS="-flto"
;;
esac
;; ;;
*gcc*) *gcc*)
case $ac_sys_system in case $ac_sys_system in
Darwin*) Darwin*)
LTOFLAGS="-flto" LTOFLAGS="-flto -Wl,-export_dynamic"
;; ;;
*) *)
LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"

View File

@ -1299,13 +1299,20 @@ fi],
if test "$Py_LTO" = 'true' ; then if test "$Py_LTO" = 'true' ; then
case $CC in case $CC in
*clang*) *clang*)
# Any changes made here should be reflected in the GCC+Darwin case below case $ac_sys_system in
LTOFLAGS="-flto" Darwin*)
# Any changes made here should be reflected in the GCC+Darwin case below
LTOFLAGS="-flto -Wl,-export_dynamic"
;;
*)
LTOFLAGS="-flto"
;;
esac
;; ;;
*gcc*) *gcc*)
case $ac_sys_system in case $ac_sys_system in
Darwin*) Darwin*)
LTOFLAGS="-flto" LTOFLAGS="-flto -Wl,-export_dynamic"
;; ;;
*) *)
LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none" LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"