[Python-checkins] bpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)

Miss Islington (bot) webhook-mailer at python.org
Tue Dec 4 10:06:27 EST 2018


https://github.com/python/cpython/commit/1751423686d05e3facdd6da2620202728e5d7917
commit: 1751423686d05e3facdd6da2620202728e5d7917
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-12-04T07:06:16-08:00
summary:

bpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)


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 at redhat.com>

files:
A Misc/NEWS.d/next/Build/2018-12-04-15-33-28.bpo-35351.ZhhBfT.rst
M configure
M 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
index 000000000000..ee6c870b060f
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2018-12-04-15-33-28.bpo-35351.ZhhBfT.rst
@@ -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.
diff --git a/configure b/configure
index bccedd18b7f8..4714ae887a67 100755
--- 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
 
diff --git a/configure.ac b/configure.ac
index 320671edada8..c35aea98e5b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
 



More information about the Python-checkins mailing list