From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from devianza.investici.org (devianza.investici.org [198.167.222.108]) by sourceware.org (Postfix) with ESMTPS id 3BE873858400 for ; Wed, 2 Nov 2022 08:14:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3BE873858400 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=autistici.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=autistici.org Received: from 1.mail-backend.investici.org (unknown [10.0.0.11]) by devianza.investici.org (Postfix) with ESMTP id 4N2KS15WXzz6v6F for ; Wed, 2 Nov 2022 08:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1667376881; bh=z6l3EHgfIoco8lfGG82q9vCgb1hPDvweHlXyGcTLUHQ=; h=Date:From:To:Subject:From; b=kxe2mdQWO1jgAjwhUcTtum/RI8wkQSCkpRy+cKkjbamjUrzCmxwUcaLkrD7G9hu7U rAWltxQ5LgnqgqHeQcnsmszg4A/JDh1kTIoUSApiOfS2It2gv32aJcsrKiEyMCc3JL BYIOvjn0AdRDfzGASCQ65i5gedrL9zjS3Ks+Yg5E= Received: from 1.webmail.investici.org (localhost [127.0.0.1]) (Authenticated sender: i.nixman@autistici.org) by 1.mail-backend.investici.org (Postfix) with ESMTPA id 4N2KS14rbbz5t7d for ; Wed, 2 Nov 2022 08:14:41 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 02 Nov 2022 08:14:41 +0000 From: i.nixman@autistici.org To: gdb@sourceware.org Subject: _WIN32_WINNT redefined? User-Agent: Roundcube Webmail Message-ID: <6485dbfe07e21a1c451b17d3fda5b3d9@autistici.org> X-Sender: i.nixman@autistici.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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!