@@ -70,12 +70,14 @@ cat Makefile.extra
7070pushd Python-${PYTHON_VERSION}
7171
7272# configure doesn't support cross-compiling on Apple. Teach it.
73- if [ " ${PYTHON_MAJMIN_VERSION} " = " 3.13" ]; then
74- patch -p1 -i ${ROOT} /patch-apple-cross-3.13.patch
75- elif [ " ${PYTHON_MAJMIN_VERSION} " = " 3.12" ]; then
76- patch -p1 -i ${ROOT} /patch-apple-cross-3.12.patch
77- else
78- patch -p1 -i ${ROOT} /patch-apple-cross.patch
73+ if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
74+ if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_13} " ]; then
75+ patch -p1 -i ${ROOT} /patch-apple-cross-3.13.patch
76+ elif [ " ${PYTHON_MAJMIN_VERSION} " = " 3.12" ]; then
77+ patch -p1 -i ${ROOT} /patch-apple-cross-3.12.patch
78+ else
79+ patch -p1 -i ${ROOT} /patch-apple-cross.patch
80+ fi
7981fi
8082
8183# This patch is slightly different on Python 3.10+.
9496# Configure nerfs RUNSHARED when cross-compiling, which prevents PGO from running when
9597# we can in fact run the target binaries (e.g. x86_64 host and i686 target). Undo that.
9698if [ -n " ${CROSS_COMPILING} " ]; then
97- if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_13} " ]; then
99+ if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_14} " ]; then
100+ patch -p1 -i ${ROOT} /patch-dont-clear-runshared-14.patch
101+ elif [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_13} " ]; then
98102 patch -p1 -i ${ROOT} /patch-dont-clear-runshared-13.patch
99103 elif [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_11} " ]; then
100104 patch -p1 -i ${ROOT} /patch-dont-clear-runshared.patch
@@ -471,6 +475,18 @@ if [ "${PYBUILD_PLATFORM}" = "macos" ]; then
471475 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_func_ptsname_r=no"
472476fi
473477
478+ # explicit_bzero is only available in glibc 2.25+, but we target a lower version for compatibility.
479+ # it's only needed for the HACL Blake2 implementation in Python 3.14+
480+ if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_14} " ]; then
481+ CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_func_explicit_bzero=no"
482+ fi
483+
484+ # On 3.14+ `test_strftime_y2k` fails when cross-compiling for `x86_64_v2` and `x86_64_v3` targets on
485+ # Linux, so we ignore it. See https://github.com/python/cpython/issues/128104
486+ if [[ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_14} " && -n " ${CROSS_COMPILING} " && " ${PYBUILD_PLATFORM} " != " macos" ]]; then
487+ export PROFILE_TASK=' -m test --pgo --ignore test_strftime_y2k'
488+ fi
489+
474490# We use ndbm on macOS and BerkeleyDB elsewhere.
475491if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
476492 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} --with-dbmliborder=ndbm"
0 commit comments