8000 gh-96761: Fix build process of the clang compiler for _bootstrap_pyth… · python/cpython@83d84e6 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 83d84e6

Browse files
gh-96761: Fix build process of the clang compiler for _bootstrap_python (gh-96945)
Co-authored-by: Matthias Goergens <matthias.goergens@gmail.com>
1 parent 9d432b4 commit 83d84e6

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix the build process of clang compiler for :program:`_bootstrap_python` if
2+
LTO optimization is applied. Patch by Matthias Görgens and Dong-hee Na.

configure

Lines changed: 37 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ then
17741774
fi
17751775
AC_MSG_RESULT($PROFILE_TASK)
17761776

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

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

0 commit comments

Comments
 (0)
0