Visitar URL original
bpo-44340: Add support for building with clang full/thin lto by corona10 · Pull Request #27231 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-44340: Update
  • Loading branch information
corona10 committed Jul 18, 2021
commit 566851071d33bce18034cd6666f35a2206d247ee
19 changes: 15 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6601,7 +6601,7 @@ $as_echo "yes" >&6; }
;;
yes)
Py_LTO='true'
Py_LTO_POLICY='full'
Py_LTO_POLICY='default'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
;;
Expand Down Expand Up @@ -6753,11 +6753,22 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
case $ac_sys_system in
Darwin*)
# Any changes made here should be reflected in the GCC+Darwin case below
LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic"
LTOCFLAGS="-flto=${Py_LTO_POLICY}"
if test $Py_LTO_POLICY = 'default'
then
LTOFLAGS="-flto -Wl,-export_dynamic"
LTOCFLAGS="-flto"
else
LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic"
LTOCFLAGS="-flto=${Py_LTO_POLICY}"
fi
;;
*)
LTOFLAGS="-flto={Py_LTO_POLICY}"
if test $Py_LTO_POLICY = 'default'
then
LTOFLAGS="-flto"
else
LTOFLAGS="-flto={Py_LTO_POLICY}"
fi
;;
esac
;;
Expand Down
19 changes: 15 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ case "$withval" in
;;
yes)
Py_LTO='true'
Py_LTO_POLICY='full'
Py_LTO_POLICY='default'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the Py_LTO_POLICY is the default, it will follow the default LTO option of compiler

AC_MSG_RESULT(yes)
;;
no)
Expand Down Expand Up @@ -1423,11 +1423,22 @@ if test "$Py_LTO" = 'true' ; then
case $ac_sys_system in
Darwin*)
# Any changes made here should be reflected in the GCC+Darwin case below
LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic"
LTOCFLAGS="-flto=${Py_LTO_POLICY}"
if test $Py_LTO_POLICY = 'default'
then
LTOFLAGS="-flto -Wl,-export_dynamic"
LTOCFLAGS="-flto"
else
LTOFLAGS="-flto=${Py_LTO_POLICY} -Wl,-export_dynamic"
LTOCFLAGS="-flto=${Py_LTO_POLICY}"
fi
;;
*)
LTOFLAGS="-flto={Py_LTO_POLICY}"
if test $Py_LTO_POLICY = 'default'
then
LTOFLAGS="-flto"
else
LTOFLAGS="-flto={Py_LTO_POLICY}"
fi
;;
esac
;;
Expand Down