Skip to content

Commit cc87487

Browse files
authored
gh-86082: bpo-41916: allow cross-compiled python to have -pthread set for CXX (#22525)
When cross-compiling, the compile/run test for -pthread always fails so -pthread will never be automatically set without an override from the cache. ac_cv_pthread can already be overridden, so do the same thing for ac_cv_cxx_thread.
1 parent 1ae619c commit cc87487

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Allow override of ac_cv_cxx_thread so that cross compiled python can set
2+
-pthread for CXX.

configure

+10-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+7-5
Original file line numberDiff line numberDiff line change
@@ -2653,11 +2653,10 @@ fi
26532653

26542654
# If we have set a CC compiler flag for thread support then
26552655
# check if it works for CXX, too.
2656-
ac_cv_cxx_thread=no
26572656
if test ! -z "$CXX"
26582657
then
2659-
AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
2660-
ac_save_cxx="$CXX"
2658+
AC_CACHE_CHECK([whether $CXX also accepts flags for thread support], [ac_cv_cxx_thread],
2659+
[ac_save_cxx="$CXX"
26612660
26622661
if test "$ac_cv_kpthread" = "yes"
26632662
then
@@ -2671,6 +2670,8 @@ elif test "$ac_cv_pthread" = "yes"
26712670
then
26722671
CXX="$CXX -pthread"
26732672
ac_cv_cxx_thread=yes
2673+
else
2674+
ac_cv_cxx_thread=no
26742675
fi
26752676
26762677
if test $ac_cv_cxx_thread = yes
@@ -2686,9 +2687,10 @@ then
26862687
fi
26872688
rm -fr conftest*
26882689
fi
2689-
AC_MSG_RESULT($ac_cv_cxx_thread)
2690+
CXX="$ac_save_cxx"])
2691+
else
2692+
ac_cv_cxx_thread=no
26902693
fi
2691-
CXX="$ac_save_cxx"
26922694

26932695
dnl # check for ANSI or K&R ("traditional") preprocessor
26942696
dnl AC_MSG_CHECKING(for C preprocessor type)

0 commit comments

Comments
 (0)