]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 4 Dec 2018 15:06:16 +0000 (07:06 -0800)
committerGitHub <noreply@github.com>
Tue, 4 Dec 2018 15:06:16 +0000 (07:06 -0800)
When using link time optimizations, the -flto flag is passed to
BASECFLAGS, which makes it propagate to distutils. Those flags
should be reserved for the interpreter and the stdlib extension
modules only, thus moving those flags to CFLAGS_NODIST.
(cherry picked from commit f92c7aa1ae81efa475b5aecf66e4711ef0f52c4c)

Co-authored-by: stratakis <cstratak@redhat.com>
Misc/NEWS.d/next/Build/2018-12-04-15-33-28.bpo-35351.ZhhBfT.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2018-12-04-15-33-28.bpo-35351.ZhhBfT.rst b/Misc/NEWS.d/next/Build/2018-12-04-15-33-28.bpo-35351.ZhhBfT.rst
new file mode 100644 (file)
index 0000000..ee6c870
--- /dev/null
@@ -0,0 +1,2 @@
+When building Python with clang and LTO, LTO flags are no longer passed into
+CFLAGS to build third-party C extensions through distutils.
index bccedd18b7f84972e9182cd918dc1b5766704337..4714ae887a67ea15c208f3b48959daf2b7847ba7 100755 (executable)
--- a/configure
+++ b/configure
@@ -6670,7 +6670,7 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
       LTOFLAGS="$LTOFLAGS -g"
   fi
 
-  BASECFLAGS="$BASECFLAGS $LTOFLAGS"
+  CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS"
   LDFLAGS="$LDFLAGS $LTOFLAGS"
 fi
 
index 320671edada81f20699067e5a3f87be20bae1de7..c35aea98e5b2d043a788b4c606ed52af6bebaafb 100644 (file)
@@ -1394,7 +1394,7 @@ if test "$Py_LTO" = 'true' ; then
       LTOFLAGS="$LTOFLAGS -g"
   fi
 
-  BASECFLAGS="$BASECFLAGS $LTOFLAGS"
+  CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS"
   LDFLAGS="$LDFLAGS $LTOFLAGS"
 fi