diff options
author | Tom Tromey <tromey@adacore.com> | 2023-01-09 07:43:29 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-01-11 11:00:42 -0700 |
commit | 2124b2de4bba05063218501dcccfc4cffe648cda (patch) | |
tree | 9116666e35c82145dc05d45936b19e27eb070719 /gdbsupport/common.m4 | |
parent | 1b9af5b949bff0c750ededb459400c1857fec416 (diff) | |
download | fsf-binutils-gdb-2124b2de4bba05063218501dcccfc4cffe648cda.zip fsf-binutils-gdb-2124b2de4bba05063218501dcccfc4cffe648cda.tar.gz fsf-binutils-gdb-2124b2de4bba05063218501dcccfc4cffe648cda.tar.bz2 |
Set _WIN32_WINNT in common.m4 configure check
GCC recently added support for the Windows thread model, enabling
libstdc++ to support Windows natively. However, this supporrt
requires a version of Windows later than the minimum version that is
supported by GDB.
PR build/29966 points out that the GDB configure test for std::thread
does not work in this situation, because _WIN32_WINNT is not defined
in test program, and so <thread> seems to be fine.
This patch is an attempt to fix the problem, by using the same setting
for _WIN32_WINNT at configure time as is used at build time.
I don't have access to one of the older systems so I don't think I can
truly test this. I did do a mingw cross build, though. I'm going to
ask the bug reporter to test it.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29966
Diffstat (limited to 'gdbsupport/common.m4')
-rw-r--r-- | gdbsupport/common.m4 | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 index c6b9a25..3909ec8 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -100,7 +100,18 @@ AC_DEFUN([GDB_AC_COMMON], [ AC_CACHE_CHECK([for std::thread], gdb_cv_cxx_std_thread, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[#include <thread> + dnl NOTE: this must be kept in sync with common-defs.h. + [[#if defined (__MINGW32__) || defined (__CYGWIN__) + # ifdef _WIN32_WINNT + # if _WIN32_WINNT < 0x0501 + # undef _WIN32_WINNT + # define _WIN32_WINNT 0x0501 + # endif + # else + # define _WIN32_WINNT 0x0501 + # endif + #endif /* __MINGW32__ || __CYGWIN__ */ + #include <thread> void callback() { }]], [[std::thread t(callback);]])], gdb_cv_cxx_std_thread=yes, |