Skip to content

Commit

Permalink
gh-86082: bpo-41916: allow cross-compiled python to have -pthread set…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
virtuald committed Jan 5, 2023
1 parent 1ae619c commit cc87487
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Allow override of ac_cv_cxx_thread so that cross compiled python can set
-pthread for CXX.
13 changes: 10 additions & 3 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2653,11 +2653,10 @@ fi

# If we have set a CC compiler flag for thread support then
# check if it works for CXX, too.
ac_cv_cxx_thread=no
if test ! -z "$CXX"
then
AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
ac_save_cxx="$CXX"
AC_CACHE_CHECK([whether $CXX also accepts flags for thread support], [ac_cv_cxx_thread],
[ac_save_cxx="$CXX"
if test "$ac_cv_kpthread" = "yes"
then
Expand All @@ -2671,6 +2670,8 @@ elif test "$ac_cv_pthread" = "yes"
then
CXX="$CXX -pthread"
ac_cv_cxx_thread=yes
else
ac_cv_cxx_thread=no
fi
if test $ac_cv_cxx_thread = yes
Expand All @@ -2686,9 +2687,10 @@ then
fi
rm -fr conftest*
fi
AC_MSG_RESULT($ac_cv_cxx_thread)
CXX="$ac_save_cxx"])
else
ac_cv_cxx_thread=no
fi
CXX="$ac_save_cxx"

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

0 comments on commit cc87487

Please sign in to comment.