]> 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>
Sun, 9 Dec 2018 08:35:13 +0000 (00:35 -0800)
committerGitHub <noreply@github.com>
Sun, 9 Dec 2018 08:35:13 +0000 (00:35 -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 5a494d987346aad7fd419021df1b86da7a97b606..8cd730d219e346438b2c8e406786a7ce0b2e43d6 100755 (executable)
--- a/configure
+++ b/configure
@@ -6726,7 +6726,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 40ecb7d93d8c12cc93b18273910660d57f6d3469..bb14a87e5463b30eb16f6568da262884c3761b7d 100644 (file)
@@ -1400,7 +1400,7 @@ if test "$Py_LTO" = 'true' ; then
       LTOFLAGS="$LTOFLAGS -g"
   fi
 
-  BASECFLAGS="$BASECFLAGS $LTOFLAGS"
+  CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS"
   LDFLAGS="$LDFLAGS $LTOFLAGS"
 fi