gh-130048: Reintroduce full LTO as default on Clang (GH-130049)

This commit is contained in:
Ken Jin 2025-02-13 22:06:00 +08:00 committed by GitHub
parent 1eb3ade6e5
commit 34c06ccc4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 102 deletions

View file

@ -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}"
@ -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