From 95970a86fafd65e9a046679001f06b0a873fe802 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 29 Nov 2018 16:34:47 +0100 Subject: [PATCH 1/2] bpo-35351: Pass link time optimization flags to CFLAGS_NODIST. 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. --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index e9e33b3715d1218..8d3336387c34baf 100755 --- 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 diff --git a/configure.ac b/configure.ac index 15d03ba381299a4..5c1c0219208737c 100644 --- a/configure.ac +++ b/configure.ac @@ -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 From 83ffac90f9593793d4704d69a24d445aa36b7d16 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 4 Dec 2018 15:33:40 +0100 Subject: [PATCH 2/2] Add NEWS entry --- Misc/NEWS.d/next/Build/2018-12-04-15-33-28.bpo-35351.ZhhBfT.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2018-12-04-15-33-28.bpo-35351.ZhhBfT.rst 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 000000000000000..ee6c870b060f6ab --- /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.