Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8482ce4

Browse files
committed
Issue #21122: Fix LTO builds on OS X.
Patch by Brett Cannon.
1 parent b84fd04 commit 8482ce4

3 files changed

Lines changed: 23 additions & 19 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ Build
212212

213213
- Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2.
214214

215+
- Issue #21122: Fix LTO builds on OS X.
216+
215217
Windows
216218
-------
217219

configure

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,6 @@ infodir
775775
docdir
776776
oldincludedir
777777
includedir
778-
runstatedir
779778
localstatedir
780779
sharedstatedir
781780
sysconfdir
@@ -886,7 +885,6 @@ datadir='${datarootdir}'
886885
sysconfdir='${prefix}/etc'
887886
sharedstatedir='${prefix}/com'
888887
localstatedir='${prefix}/var'
889-
runstatedir='${localstatedir}/run'
890888
includedir='${prefix}/include'
891889
oldincludedir='/usr/include'
892890
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1139,15 +1137,6 @@ do
11391137
| -silent | --silent | --silen | --sile | --sil)
11401138
silent=yes ;;
11411139

1142-
-runstatedir | --runstatedir | --runstatedi | --runstated \
1143-
| --runstate | --runstat | --runsta | --runst | --runs \
1144-
| --run | --ru | --r)
1145-
ac_prev=runstatedir ;;
1146-
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1147-
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1148-
| --run=* | --ru=* | --r=*)
1149-
runstatedir=$ac_optarg ;;
1150-
11511140
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11521141
ac_prev=sbindir ;;
11531142
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1285,7 +1274,7 @@ fi
12851274
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12861275
datadir sysconfdir sharedstatedir localstatedir includedir \
12871276
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1288-
libdir localedir mandir runstatedir
1277+
libdir localedir mandir
12891278
do
12901279
eval ac_val=\$$ac_var
12911280
# Remove trailing slashes.
@@ -1438,7 +1427,6 @@ Fine tuning of the installation directories:
14381427
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14391428
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14401429
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1441-
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14421430
--libdir=DIR object code libraries [EPREFIX/lib]
14431431
--includedir=DIR C header files [PREFIX/include]
14441432
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -6484,13 +6472,20 @@ fi
64846472
if test "$Py_LTO" = 'true' ; then
64856473
case $CC in
64866474
*clang*)
6487-
# Any changes made here should be reflected in the GCC+Darwin case below
6488-
LTOFLAGS="-flto"
6475+
case $ac_sys_system in
6476+
Darwin*)
6477+
# Any changes made here should be reflected in the GCC+Darwin case below
6478+
LTOFLAGS="-flto -Wl,-export_dynamic"
6479+
;;
6480+
*)
6481+
LTOFLAGS="-flto"
6482+
;;
6483+
esac
64896484
;;
64906485
*gcc*)
64916486
case $ac_sys_system in
64926487
Darwin*)
6493-
LTOFLAGS="-flto"
6488+
LTOFLAGS="-flto -Wl,-export_dynamic"
64946489
;;
64956490
*)
64966491
LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"

configure.ac

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,13 +1299,20 @@ fi],
12991299
if test "$Py_LTO" = 'true' ; then
13001300
case $CC in
13011301
*clang*)
1302-
# Any changes made here should be reflected in the GCC+Darwin case below
1303-
LTOFLAGS="-flto"
1302+
case $ac_sys_system in
1303+
Darwin*)
1304+
# Any changes made here should be reflected in the GCC+Darwin case below
1305+
LTOFLAGS="-flto -Wl,-export_dynamic"
1306+
;;
1307+
*)
1308+
LTOFLAGS="-flto"
1309+
;;
1310+
esac
13041311
;;
13051312
*gcc*)
13061313
case $ac_sys_system in
13071314
Darwin*)
1308-
LTOFLAGS="-flto"
1315+
LTOFLAGS="-flto -Wl,-export_dynamic"
13091316
;;
13101317
*)
13111318
LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"

0 commit comments

Comments
 (0)