diff options
author | 2024-05-06 07:07:07 +0200 | |
---|---|---|
committer | 2024-05-06 18:44:54 +0200 | |
commit | 45e83f865876e42d22cf4bc242725bb4a25a12e3 (patch) | |
tree | a89244942087d486543190ceb2a567145f58599e /gdbsupport/common.m4 | |
parent | [gdb/testsuite] Handle ptrace operation not permitted in can_spawn_for_attach (diff) | |
download | binutils-gdb-45e83f865876e42d22cf4bc242725bb4a25a12e3.tar.gz binutils-gdb-45e83f865876e42d22cf4bc242725bb4a25a12e3.tar.bz2 binutils-gdb-45e83f865876e42d22cf4bc242725bb4a25a12e3.zip |
Fix build issues with mingw toolchain
With a x86_64-pc-mingw32 toolchain there is a build issue
whether or not the --disable-threading option is used.
The problem happens because _WIN32_WINNT is defined to 0x501
before #include <mutex> which makes the compilation abort
due to missing support for __gthread_cond_t in std_mutex.h,
which is conditional on _WIN32_WINNT >= 0x600.
Fix the case when --disable-threading is used, by only
including <mutex> in gdb/complaints.c when STD_CXX_THREAD
is defined.
Additionally make the configure script try to #include <mutex>
to automatically select --disable-threading when the header file
is not able to compile.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdbsupport/common.m4')
-rw-r--r-- | gdbsupport/common.m4 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 index 240ec008f2a..bef396445ba 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -114,6 +114,7 @@ AC_DEFUN([GDB_AC_COMMON], [ # endif #endif /* __MINGW32__ || __CYGWIN__ */ #include <thread> + #include <mutex> void callback() { }]], [[std::thread t(callback);]])], gdb_cv_cxx_std_thread=yes, |