8000 Revert "gh-130048: Reintroduce full LTO as default on Clang (GH-13004… · python/cpython@aa28423 · GitHub
[go: up one dir, main page]

Skip to content

Commit aa28423

Browse files
Revert "gh-130048: Reintroduce full LTO as default on Clang (GH-130049)" (#130088)
This reverts commit 34c06cc.
1 parent 28f5e3d commit aa28423

File tree

5 files changed

+102
-14
lines changed

5 files changed

+102
-14
lines changed

Doc/using/configure.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,6 @@ also be used to improve performance.
575575
.. versionchanged:: 3.12
576576
Use ThinLTO as the default optimization policy on Clang if the compiler accepts the flag.
577577

578-
.. versionchanged:: next
579-
Revert to using full LTO as the default optimization policy on Clang.
580-
581578
.. option:: --enable-bolt
582579

583580
Enable usage of the `BOLT post-link binary optimizer

Doc/whatsnew/3.14.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,10 +1279,6 @@ Build changes
12791279
* GNU Autoconf 2.72 is now required to generate :file:`configure`.
12801280
(Contributed by Erlend Aasland in :gh:`115765`.)
12811281

1282-
* CPython now uses Full LTO as the default link time optimization policy
1283-
on Clang. This reverts an earlier change in CPython 3.12.
1284-
(Contributed by Ken Jin in :gh:`130049`.)
1285-
12861282
.. _whatsnew314-pep761:
12871283

12881284
PEP 761: Discontinuation of PGP signatures

Misc/NEWS.d/next/Build/2025-02-12-19-51-19.gh-issue-130048.kHNkzP.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

configure

Lines changed: 91 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,8 +1986,15 @@ if test "$Py_LTO" = 'true' ; then
19861986
# Any changes made here should be reflected in the GCC+Darwin case below
19871987
if test $Py_LTO_POLICY = default
19881988
then
1989-
LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
1990-
LTOCFLAGS="-flto"
1989+
# Check that ThinLTO is accepted.
1990+
AX_CHECK_COMPILE_FLAG([-flto=thin],[
1991+
LTOFLAGS="-flto=thin -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
1992+
LTOCFLAGS="-flto=thin"
1993+
],[
1994+
LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
1995+
LTOCFLAGS="-flto"
1996+
]
1997+
)
19911998
else
19921999
LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
19932000
LTOCFLAGS="-flto=${Py_LTO_POLICY}"
@@ -1996,7 +2003,8 @@ if test "$Py_LTO" = 'true' ; then
19962003
*)
19972004
if test $Py_LTO_POLICY = default
19982005
then
1999-
LTOFLAGS="-flto"
2006+
# Check that ThinLTO is accepted
2007+
AX_CHECK_COMPILE_FLAG([-flto=thin],[LTOFLAGS="-flto=thin"],[LTOFLAGS="-flto"])
20002008
else
20012009
LTOFLAGS="-flto=${Py_LTO_POLICY}"
20022010
fi

0 commit comments

Comments
 (0)
0