summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-12-03 15:01:11 (GMT)
committerGitHub <noreply@github.com>2021-12-03 15:01:11 (GMT)
commit84ca1232b0f1e4be368e89550a9ceb46f64a0eff (patch)
tree917838767e45e47c72931d4d2b370c4f0b2eaf0e /configure
parentccb73a0d50dd03bc8455fe210cb83e41a6dc91d8 (diff)
downloadcpython-84ca1232b0f1e4be368e89550a9ceb46f64a0eff.zip
cpython-84ca1232b0f1e4be368e89550a9ceb46f64a0eff.tar.gz
cpython-84ca1232b0f1e4be368e89550a9ceb46f64a0eff.tar.bz2
bpo-45950: Introduce Bootstrap Python again (#29859)
The build system now uses a :program:`_bootstrap_python` interpreter for freezing and deepfreezing again. To speed up build process the build tools :program:`_bootstrap_python` and :program:`_freeze_module` are no longer build with LTO. Cross building depends on a build Python interpreter, which must have same version and bytecode as target host Python.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 14 insertions, 1 deletions
diff --git a/configure b/configure
index 0aceffb..5d47d03 100755
--- a/configure
+++ b/configure
@@ -845,6 +845,7 @@ SHLIB_SUFFIX
LIBTOOL_CRUFT
OTHER_LIBTOOL_OPT
UNIVERSAL_ARCH_FLAGS
+LDFLAGS_NOLTO
LDFLAGS_NODIST
CFLAGS_NODIST
BASECFLAGS
@@ -932,6 +933,7 @@ CONFIG_ARGS
SOVERSION
VERSION
PYTHON_FOR_REGEN
+PYTHON_FOR_FREEZE
PYTHON_FOR_BUILD
FREEZE_MODULE
host_os
@@ -3250,6 +3252,7 @@ fi
as_fn_error $? "\"$with_build_python\" has incompatible version $build_python_ver (expected: $PACKAGE_VERSION)" "$LINENO" 5
fi
ac_cv_prog_PYTHON_FOR_REGEN=$with_build_python
+ PYTHON_FOR_FREEZE="$with_build_python"
PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$with_build_python
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_build_python" >&5
$as_echo "$with_build_python" >&6; }
@@ -3261,12 +3264,19 @@ else
fi
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
+ PYTHON_FOR_FREEZE="./_bootstrap_python"
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python interpreter freezing" >&5
+$as_echo_n "checking for Python interpreter freezing... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_FOR_FREEZE" >&5
+$as_echo "$PYTHON_FOR_FREEZE" >&6; }
+
+
for ac_prog in python$PACKAGE_VERSION python3.10 python3.9 python3.8 python3.7 python3.6 python3 python
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -3314,7 +3324,7 @@ test -n "$PYTHON_FOR_REGEN" || PYTHON_FOR_REGEN="python3"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python for regen version" >&5
$as_echo_n "checking Python for regen version... " >&6; }
-if command -v $PYTHON_FOR_REGEN >/dev/null 2>&1; then
+if command -v "$PYTHON_FOR_REGEN" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $($PYTHON_FOR_REGEN -V 2>/dev/null)" >&5
$as_echo "$($PYTHON_FOR_REGEN -V 2>/dev/null)" >&6; }
else
@@ -7101,6 +7111,7 @@ fi
if test "$Py_LTO" = 'true' ; then
case $CC in
*clang*)
+ LDFLAGS_NOLTO="-fno-lto"
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}llvm-ar", so it can be a program name with args.
@@ -7254,6 +7265,7 @@ $as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;}
then
as_fn_error $? "thin lto is not supported under gcc compiler." "$LINENO" 5
fi
+ LDFLAGS_NOLTO="-fno-lto"
case $ac_sys_system in
Darwin*)
LTOFLAGS="-flto -Wl,-export_dynamic"
@@ -7534,6 +7546,7 @@ fi
+
# The -arch flags for universal builds on macOS
UNIVERSAL_ARCH_FLAGS=