public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: i.nixman@autistici.org
To: gdb@sourceware.org
Subject: _WIN32_WINNT redefined?
Date: Wed, 02 Nov 2022 08:14:41 +0000	[thread overview]
Message-ID: <6485dbfe07e21a1c451b17d3fda5b3d9@autistici.org> (raw)


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!

             reply	other threads:[~2022-11-02  8:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  8:14 i.nixman [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6485dbfe07e21a1c451b17d3fda5b3d9@autistici.org \
    --to=i.nixman@autistici.org \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).