aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2024-05-06 07:07:07 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2024-05-06 18:44:54 +0200
commit45e83f865876e42d22cf4bc242725bb4a25a12e3 (patch)
treea89244942087d486543190ceb2a567145f58599e /gdb
parent147fe7f9fb9a89b217d11d73053f53e8edacf90f (diff)
downloadbinutils-45e83f865876e42d22cf4bc242725bb4a25a12e3.zip
binutils-45e83f865876e42d22cf4bc242725bb4a25a12e3.tar.gz
binutils-45e83f865876e42d22cf4bc242725bb4a25a12e3.tar.bz2
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 'gdb')
-rw-r--r--gdb/complaints.c2
-rwxr-xr-xgdb/configure1
2 files changed, 3 insertions, 0 deletions
diff --git a/gdb/complaints.c b/gdb/complaints.c
index debafde..07c0f7e 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -24,7 +24,9 @@
#include "top.h"
#include "gdbsupport/selftest.h"
#include <unordered_map>
+#if CXX_STD_THREAD
#include <mutex>
+#endif
/* Map format strings to counters. */
diff --git a/gdb/configure b/gdb/configure
index c3d5cf7..98cd488 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -20854,6 +20854,7 @@ else
# endif
#endif /* __MINGW32__ || __CYGWIN__ */
#include <thread>
+ #include <mutex>
void callback() { }
int
main ()