]> granicus.if.org Git - python/commitdiff
bpo-35351: Pass link time optimization flags to CFLAGS_NODIST (GH-10797)
authorstratakis <cstratak@redhat.com>
Tue, 4 Dec 2018 14:54:01 +0000 (15:54 +0100)
committerVictor Stinner <vstinner@redhat.com>
Tue, 4 Dec 2018 14:54:01 +0000 (15:54 +0100)
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.

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 e9e33b3715d1218d4f96ca20c56c15cab89409b4..8d3336387c34bafb2151ef4d11e484ccfbc3fa2e 100755 (executable)
--- a/configure
+++ b/configure
@@ -6626,7 +6626,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 15d03ba381299a4611dc972bd09820d7964b87f8..5c1c0219208737ca7e41772d230d7daf662dc6e5 100644 (file)
@@ -1357,7 +1357,7 @@ if test "$Py_LTO" = 'true' ; then
       LTOFLAGS="$LTOFLAGS -g"
   fi
 
-  BASECFLAGS="$BASECFLAGS $LTOFLAGS"
+  CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS"
   LDFLAGS="$LDFLAGS $LTOFLAGS"
 fi