Skip to content

Commit f92c7aa

Browse files
stratakisvstinner
authored andcommitted
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.
1 parent e63e617 commit f92c7aa

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
When building Python with clang and LTO, LTO flags are no longer passed into
2+
CFLAGS to build third-party C extensions through distutils.

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6626,7 +6626,7 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
66266626
LTOFLAGS="$LTOFLAGS -g"
66276627
fi
66286628

6629-
BASECFLAGS="$BASECFLAGS $LTOFLAGS"
6629+
CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS"
66306630
LDFLAGS="$LDFLAGS $LTOFLAGS"
66316631
fi
66326632

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ if test "$Py_LTO" = 'true' ; then
13571357
LTOFLAGS="$LTOFLAGS -g"
13581358
fi
13591359

1360-
BASECFLAGS="$BASECFLAGS $LTOFLAGS"
1360+
CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS"
13611361
LDFLAGS="$LDFLAGS $LTOFLAGS"
13621362
fi
13631363

0 commit comments

Comments
 (0)