Skip to content

Commit

Permalink
Reintroduce full LTO as default
Browse files Browse the repository at this point in the history
  • Loading branch information
Fidget-Spinner committed Feb 12, 2025
1 parent 1b27f36 commit 68678fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 102 deletions.
3 changes: 3 additions & 0 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ also be used to improve performance.
.. versionchanged:: 3.12
Use ThinLTO as the default optimization policy on Clang if the compiler accepts the flag.

.. versionchanged:: next
Revert to using full LTO as the default optimization policy on Clang.

.. option:: --enable-bolt

Enable usage of the `BOLT post-link binary optimizer
Expand Down
94 changes: 3 additions & 91 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1986,15 +1986,8 @@ if test "$Py_LTO" = 'true' ; then
# Any changes made here should be reflected in the GCC+Darwin case below
if test $Py_LTO_POLICY = default
then
# Check that ThinLTO is accepted.
AX_CHECK_COMPILE_FLAG([-flto=thin],[
LTOFLAGS="-flto=thin -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
LTOCFLAGS="-flto=thin"
],[
LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
LTOCFLAGS="-flto"
]
)
LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
LTOCFLAGS="-flto"
else
LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto"
LTOCFLAGS="-flto=${Py_LTO_POLICY}"
Expand All @@ -2003,8 +1996,7 @@ if test "$Py_LTO" = 'true' ; then
*)
if test $Py_LTO_POLICY = default
then
# Check that ThinLTO is accepted
AX_CHECK_COMPILE_FLAG([-flto=thin],[LTOFLAGS="-flto=thin"],[LTOFLAGS="-flto"])
LTOFLAGS="-flto"
else
LTOFLAGS="-flto=${Py_LTO_POLICY}"
fi
Expand Down

0 comments on commit 68678fa

Please sign in to comment.