summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na@python.org>2022-09-23 02:00:44 (GMT)
committerGitHub <noreply@github.com>2022-09-23 02:00:44 (GMT)
commit83d84e67cd203cc75687152e57572895f56245fa (patch)
treea24cbe0850aaa45900900dce36a5f45cfacf0e74 /configure
parent9d432b4a181cd42017699de4354e7b36c5b87d88 (diff)
downloadcpython-83d84e67cd203cc75687152e57572895f56245fa.zip
cpython-83d84e67cd203cc75687152e57572895f56245fa.tar.gz
cpython-83d84e67cd203cc75687152e57572895f56245fa.tar.bz2
gh-96761: Fix build process of the clang compiler for _bootstrap_python (gh-96945)
Co-authored-by: Matthias Goergens <matthias.goergens@gmail.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure39
1 files changed, 37 insertions, 2 deletions
diff --git a/configure b/configure
index 08ec216..0e9f72f 100755
--- a/configure
+++ b/configure
@@ -7640,7 +7640,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROFILE_TASK" >&5
$as_echo "$PROFILE_TASK" >&6; }
-# 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.
@@ -7705,7 +7705,42 @@ fi
if test "$Py_LTO" = 'true' ; then
case $CC in
*clang*)
- LDFLAGS_NOLTO="-fno-lto"
+ LDFLAGS_NOLTO="-fno-lto"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -flto=thin" >&5
+$as_echo_n "checking whether C compiler accepts -flto=thin... " >&6; }
+if ${ax_cv_check_cflags___flto_thin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ax_check_save_flags=$CFLAGS
+ CFLAGS="$CFLAGS -flto=thin"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ax_cv_check_cflags___flto_thin=yes
+else
+ ax_cv_check_cflags___flto_thin=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$ax_check_save_flags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___flto_thin" >&5
+$as_echo "$ax_cv_check_cflags___flto_thin" >&6; }
+if test "x$ax_cv_check_cflags___flto_thin" = xyes; then :
+ LDFLAGS_NOLTO="-flto=thin"
+else
+ LDFLAGS_NOLTO="-flto"
+fi
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}llvm-ar", so it can be a program name with args.