Skip to content

gh-96761: Fix lto-build for clang #96762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions configure

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

7 changes: 4 additions & 3 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,9 @@ 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