@@ -298,14 +298,6 @@ if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_10}" ]; then
298298 patch -p1 -i ${ROOT} /patch-configure-crypt-no-modify-libs.patch
299299fi
300300
301- # Build a libpython3.x.so, but statically link the interpreter against
302- # libpython.
303- if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_12} " ]; then
304- patch -p1 -i " ${ROOT} /patch-python-configure-add-enable-static-libpython-for-interpreter.patch"
305- else
306- patch -p1 -i " ${ROOT} /patch-python-configure-add-enable-static-libpython-for-interpreter-${PYTHON_MAJMIN_VERSION} .patch"
307- fi
308-
309301# BOLT instrumented binaries segfault in some test_embed tests for unknown reasons.
310302# On 3.12 (minimum BOLT version), the segfault causes the test harness to
311303# abort and BOLT optimization uses the partial test results. On 3.13, the segfault
@@ -379,10 +371,25 @@ CONFIGURE_FLAGS="
379371 --with-system-expat
380372 --with-system-libmpdec
381373 --without-ensurepip
382- --enable-static-libpython-for-interpreter
383374 ${EXTRA_CONFIGURE_FLAGS} "
384375
385376
377+ # Build a libpython3.x.so, but statically link the interpreter against
378+ # libpython.
379+ #
380+ # For now skip this on macos, because it causes some linker failures. Note that
381+ # this patch mildly conflicts with the macos-only patch-python-link-modules
382+ # applied above, so you will need to resolve that conflict if you re-enable
383+ # this for macos.
384+ if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
385+ if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_12} " ]; then
386+ patch -p1 -i " ${ROOT} /patch-python-configure-add-enable-static-libpython-for-interpreter.patch"
387+ else
388+ patch -p1 -i " ${ROOT} /patch-python-configure-add-enable-static-libpython-for-interpreter-${PYTHON_MAJMIN_VERSION} .patch"
389+ fi
390+ CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} --enable-static-libpython-for-interpreter"
391+ fi
392+
386393if [ " ${CC} " = " musl-clang" ]; then
387394 # In order to build the _blake2 extension module with SSE3+ instructions, we need
388395 # musl-clang to find headers that provide access to the intrinsics, as they are not
0 commit comments