diff options
author | Dong-hee Na <donghee.na@python.org> | 2022-09-16 10:40:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-16 10:40:05 (GMT) |
commit | e47b96c44f7b48a1e95de24f38f6e3de879b4d61 (patch) | |
tree | 56cd8f495c33eccdf04681132d1d84009dd5434c /configure.ac | |
parent | 16c33a9676e2f3ef330d09f2ab515c56636fa09f (diff) | |
download | cpython-e47b96c44f7b48a1e95de24f38f6e3de879b4d61.zip cpython-e47b96c44f7b48a1e95de24f38f6e3de879b4d61.tar.gz cpython-e47b96c44f7b48a1e95de24f38f6e3de879b4d61.tar.bz2 |
gh-89536: Use ThinLTO policy if possible (gh-96766)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index a61adcc..7d2e83c 100644 --- a/configure.ac +++ b/configure.ac @@ -1863,8 +1863,15 @@ 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 - LTOFLAGS="-flto -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto" - LTOCFLAGS="-flto" + # 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" + ] + ) else LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic -Wl,-object_path_lto,\"\$@\".lto" LTOCFLAGS="-flto=${Py_LTO_POLICY}" @@ -1873,7 +1880,8 @@ if test "$Py_LTO" = 'true' ; then *) if test $Py_LTO_POLICY = default then - LTOFLAGS="-flto" + # Check that ThinLTO is accepted + AX_CHECK_COMPILE_FLAG([-flto=thin],[LTOFLAGS="-flto=thin"],[LTOFLAGS="-flto"]) else LTOFLAGS="-flto=${Py_LTO_POLICY}" fi |