aboutsummaryrefslogtreecommitdiff
path: root/gdbserver
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-03-31 08:26:12 -0600
committerTom Tromey <tromey@adacore.com>2022-04-14 09:28:56 -0600
commitc560a5fbae3b6e0b7c2119e6fc276941517377fa (patch)
treee07887af60fda3b3e30d5b491501fc28e41fe24d /gdbserver
parent11d7dd3357997616427e22969ea8a929f5db59c9 (diff)
downloadgdb-c560a5fbae3b6e0b7c2119e6fc276941517377fa.zip
gdb-c560a5fbae3b6e0b7c2119e6fc276941517377fa.tar.gz
gdb-c560a5fbae3b6e0b7c2119e6fc276941517377fa.tar.bz2
Let std::thread check pass even without pthreads
Currently, the configure check for std::thread relies on pthreads existing. However, this means that if std::thread is implemented for a non-pthreads host, then the check will yield the wrong answer. This happened in AdaCore internal builds. Here, we have this GCC patch: https://gcc.gnu.org/legacy-ml/gcc-patches/2019-06/msg01840.html ... which adds mingw support to GCC's gthreads implementation, and also to std::thread. This configure change fixes this problem and enables threading for gdb.
Diffstat (limited to 'gdbserver')
-rwxr-xr-xgdbserver/configure19
1 files changed, 9 insertions, 10 deletions
diff --git a/gdbserver/configure b/gdbserver/configure
index bcb1594..e6b46c2 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -7930,12 +7930,11 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
- if test "$threads" = "yes"; then
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$PTHREAD_CFLAGS $save_CXXFLAGS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::thread" >&5
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$PTHREAD_CFLAGS $save_CXXFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::thread" >&5
$as_echo_n "checking for std::thread... " >&6; }
if ${gdb_cv_cxx_std_thread+:} false; then :
$as_echo_n "(cached) " >&6
@@ -7943,7 +7942,7 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <thread>
- void callback() { }
+ void callback() { }
int
main ()
{
@@ -7962,6 +7961,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_cxx_std_thread" >&5
$as_echo "$gdb_cv_cxx_std_thread" >&6; }
+ if test "$threads" = "yes"; then
# This check must be here, while LIBS includes any necessary
# threading library.
for ac_func in pthread_sigmask pthread_setname_np
@@ -7976,10 +7976,9 @@ _ACEOF
fi
done
-
- LIBS="$save_LIBS"
- CXXFLAGS="$save_CXXFLAGS"
fi
+ LIBS="$save_LIBS"
+ CXXFLAGS="$save_CXXFLAGS"
if test "$want_threading" = "yes"; then
if test "$gdb_cv_cxx_std_thread" = "yes"; then