summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-12-09 00:35:13 -0800
committerGitHub <noreply@github.com>2018-12-09 00:35:13 -0800
commitf2d2cb12f2d3bd68a13c4098311e725f776768ad (patch)
tree284b366770600fe197bf72a0aa8163f4c2dadb3f
parentf83ee476d48dbeb90ddf3526b04936a49a87973a (diff)
downloadcpython-git-f2d2cb12f2d3bd68a13c4098311e725f776768ad.tar.gz
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@redhat.com>
-rw-r--r--Misc/NEWS.d/next/Build/2018-12-04-15-33-28.bpo-35351.ZhhBfT.rst2
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
3 files changed, 4 insertions, 2 deletions
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 0000000000..ee6c870b06
--- /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 5a494d9873..8cd730d219 100755
--- 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
diff --git a/configure.ac b/configure.ac
index 40ecb7d93d..bb14a87e54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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