Commit f92c7aa1 authored by stratakis's avatar stratakis Committed by Victor Stinner

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.
parent e63e617e
When building Python with clang and LTO, LTO flags are no longer passed into
CFLAGS to build third-party C extensions through distutils.
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment