@@ -306,17 +306,6 @@ else
306
306
patch -p1 -i " ${ROOT} /patch-python-configure-add-enable-static-libpython-for-interpreter-${PYTHON_MAJMIN_VERSION} .patch"
307
307
fi
308
308
309
- # We patched configure.ac above. Reflect those changes.
310
- autoconf
311
-
312
- # configure assumes cross compiling when host != target and doesn't provide a way to
313
- # override. Our target triple normalization may lead configure into thinking we
314
- # aren't cross-compiling when we are. So force a static "yes" value when our
315
- # build system says we are cross-compiling.
316
- if [ -n " ${CROSS_COMPILING} " ]; then
317
- patch -p1 -i ${ROOT} /patch-force-cross-compile.patch
318
- fi
319
-
320
309
# BOLT instrumented binaries segfault in some test_embed tests for unknown reasons.
321
310
# On 3.12 (minimum BOLT version), the segfault causes the test harness to
322
311
# abort and BOLT optimization uses the partial test results. On 3.13, the segfault
@@ -582,6 +571,14 @@ else
582
571
fi
583
572
584
573
if [ -n " ${CROSS_COMPILING} " ]; then
574
+ # configure assumes cross compiling when host != target and doesn't
575
+ # provide a way to override. Our target triple normalization may
576
+ # lead configure into thinking we aren't cross-compiling when we
577
+ # are. So force a static "yes" value when our build system says we
578
+ # are cross-compiling.
579
+ # See also https://savannah.gnu.org/support/?110348
580
+ CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} cross_compiling=yes"
581
+
585
582
# configure doesn't like a handful of scenarios when cross-compiling.
586
583
#
587
584
# getaddrinfo buggy test fails for some reason. So we short-circuit it.
@@ -598,8 +595,18 @@ if [ -n "${CROSS_COMPILING}" ]; then
598
595
if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
599
596
CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_working_tzset=yes"
600
597
fi
598
+
599
+ # Also, it cannot detect whether the compiler supports -pthread or
600
+ # not, and conservatively defaults to no, which is not the right
601
+ # default on relatively modern compilers.
602
+ CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_pthread=yes"
603
+
604
+ # TODO: There are probably more of these, see #399.
601
605
fi
602
606
607
+ # We patched configure.ac above. Reflect those changes.
608
+ autoconf
609
+
603
610
CFLAGS=$CFLAGS CPPFLAGS=$CFLAGS LDFLAGS=$LDFLAGS \
604
611
./configure ${CONFIGURE_FLAGS}
605
612
0 commit comments