Skip to content

Commit

Permalink
gh-96761: Fix build process of the clang compiler for _bootstrap_pyth…
Browse files Browse the repository at this point in the history
…on (gh-96945)

Co-authored-by: Matthias Goergens <matthias.goergens@gmail.com>
  • Loading branch information
corona10 and matthiasgoergens authored Sep 23, 2022
1 parent 9d432b4 commit 83d84e6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix the build process of clang compiler for :program:`_bootstrap_python` if
LTO optimization is applied. Patch by Matthias Görgens and Dong-hee Na.
39 changes: 37 additions & 2 deletions configure

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

6 changes: 4 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ then
fi
AC_MSG_RESULT($PROFILE_TASK)

# Make llvm-relatec checks work on systems where llvm tools are not installed with their
# Make llvm-related checks work on systems where llvm tools are not installed with their
# normal names in the default $PATH (ie: Ubuntu). They exist under the
# non-suffixed name in their versioned llvm directory.

Expand Down Expand Up @@ -1828,8 +1828,10 @@ esac
if test "$Py_LTO" = 'true' ; then
case $CC in
*clang*)
dnl flag to disable lto during linking
LDFLAGS_NOLTO="-fno-lto"
dnl Clang linker requires -flto in order to link objects with LTO information.
dnl Thin LTO is faster and works for object files with full LTO information, too.
AX_CHECK_COMPILE_FLAG([-flto=thin],[LDFLAGS_NOLTO="-flto=thin"],[LDFLAGS_NOLTO="-flto"])
AC_SUBST(LLVM_AR)
AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
AC_SUBST(LLVM_AR_FOUND)
Expand Down

0 comments on commit 83d84e6

Please sign in to comment.