public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* _WIN32_WINNT redefined?
@ 2022-11-02  8:14 i.nixman
  2022-11-02  8:21 ` i.nixman
  0 siblings, 1 reply; 17+ messages in thread
From: i.nixman @ 2022-11-02  8:14 UTC (permalink / raw)
  To: gdb


hello!

host: x86_64-w64-mingw32
target: x86_64-w64-mingw32

I'm trying to build GDB using GCC that I built myself.
the GCC was patched and configured the way when std-threads implemented 
by libgcc using WINAPI directly, without winpthreads.
the compiler works, as far as I can test it.

but I have faced with a trouble with building GDB using the compiler.
the trouble looks like this:
```
In file included from 
mingw64/lib/gcc/x86_64-w64-mingw32/13.0.0/include/c++/mutex:45,
                  from 
../src/gdb-11.2/gdbsupport/../gdbsupport/thread-pool.h:27,
                  from ../src/gdb-11.2/gdbsupport/thread-pool.cc:24:
mingw64/lib/gcc/x86_64-w64-mingw32/13.0.0/include/c++/bits/std_mutex.h:163:5: 
error: '__gthread_cond_t' does not name a type; did you mean 
'__gthread_once_t'?
   163 |     __gthread_cond_t* native_handle() noexcept { return 
&_M_cond; }
       |     ^~~~~~~~~~~~~~~~
```

the problem is a consequence of the fact that `_WIN32_WINNT` is 
redefined somewhere to another value that is less than necessary.
but when I pass `-D_WIN32_WINNT=0x0601` for CFLAGS/CXXFLAGS - the 
trouble is gone.

the mingw-w64-api was configured with 
`--with-default-win32-winnt=0x0601` and I can confirm the `_WIN32_WINNT` 
is actually set to the correct value.
moreover, using the compiler I can successfully build a simple program 
that uses `std::thread` without the need to pass `-D_WIN32_WINNT=0x0601` 
for CFLAGS/CXXFLAGS.


so my question is: could it be so the `_WIN32_WINNT` macro is reassigned 
somewhere in GDB sources?




best!

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-11-02 18:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02  8:14 _WIN32_WINNT redefined? i.nixman
2022-11-02  8:21 ` i.nixman
2022-11-02  8:44   ` i.nixman
2022-11-02  9:46     ` i.nixman
2022-11-02 10:15       ` i.nixman
2022-11-02 12:59         ` Eli Zaretskii
2022-11-02 13:10           ` Jeffrey Walton
2022-11-02 13:26             ` Eli Zaretskii
2022-11-02 12:50       ` Eli Zaretskii
2022-11-02 14:13         ` i.nixman
2022-11-02 15:18           ` Eli Zaretskii
2022-11-02 15:51             ` i.nixman
2022-11-02 16:02               ` i.nixman
2022-11-02 16:51               ` Eli Zaretskii
2022-11-02 17:20                 ` i.nixman
2022-11-02 18:13                   ` Eli Zaretskii
2022-11-02 12:55     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).