From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A9C0E3858CDB; Mon, 23 Jan 2023 10:54:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9C0E3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674471259; bh=uXfTii2My/anmp4C/Z+f9FhM9cXM1l+fxcyyHBvVE5A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RsV+UE2O80tgvHR4de0sYV2J1tj1J7Z+y0zfMZI0zo9IaI0ul/uc3AwN8rNOFYc87 E8jy0eV6IIr63V7UDTnpC5y+1R7QoSNpOC6bf0InuCc49EoCpq640rHeLkdklnQVCj +azzTcZNjPHLA5qUpNIp/xmBQf/EPzDD58tBbIdc= From: "jwakely.gcc at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug build/29966] Cannot build anymore for win32 thread model of gdb Date: Mon, 23 Jan 2023 10:54:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jwakely.gcc at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: tromey at sourceware dot org X-Bugzilla-Target-Milestone: 13.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29966 --- Comment #52 from Jonathan Wakely --- I think unless OP starts being helpful this should just be closed. We don't have enough info to even reproduce the issue. I've built GCC trunk with --target=3Dx86_64-w64-mingw32 --enable-threads=3D= win32 and I can then build GDB with --target=3Dx86_64-w64-mingw32 --host=3Dx86_64-w64-mingw32. This works fine. Adding CXXFLAGS=3D-D_WIN32_WINNT=3D0x0501 to the GDB flags fails, but not i= n any way related to this bug: make[5]: Entering directory '/tmp/gdb-win32/gnulib/import' CC libgnu_a-closedir.o /home/jwakely/src/binutils-gdb/gnulib/import/closedir.c: In function 'closedir': /home/jwakely/src/binutils-gdb/gnulib/import/closedir.c:58:11: error: 'DIR'= has no member named 'current' 58 | if (dirp->current !=3D INVALID_HANDLE_VALUE) | ^~ /home/jwakely/src/binutils-gdb/gnulib/import/closedir.c:59:20: error: 'DIR'= has no member named 'current' 59 | FindClose (dirp->current); | ^~ make[5]: *** [Makefile:2632: libgnu_a-closedir.o] Error 1 So without more information to be able to reproduce OP's problem, this shou= ld be closed IMHO. For that failing build, without the patch in comment 47 gdbsupport/config.l= og shows: configure:8963: checking for std::thread configure:8990: x86_64-w64-mingw32-g++ -c -pthread -D_WIN32_WINNT=3D0x0501= =20=20=20 conftest.cpp >&5 configure:8990: $? =3D 0 configure:8997: result: yes With the patch it shows: configure:8963: checking for std::thread and std::mutex configure:8993: x86_64-w64-mingw32-g++ -c -pthread -D_WIN32_WINNT=3D0x0501= =20=20=20 conftest.cpp >&5 In file included from /home/jwakely/gcc/mingw-win32/include/c++/mutex:45, from conftest.cpp:67: /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:164:5: error: '__gthread_cond_t' does not name a type; did you mean '__gthread_once_t'? 164 | __gthread_cond_t* native_handle() noexcept { return &_M_cond; } | ^~~~~~~~~~~~~~~~ | __gthread_once_t /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:208:5: error: '__gthread_cond_t' does not name a type; did you mean '__gthread_once_t'? 208 | __gthread_cond_t _M_cond; | ^~~~~~~~~~~~~~~~ | __gthread_once_t /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In constructor 'std::__condvar::__condvar()': /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:151:37: error: '_M_cond' was not declared in this scope 151 | __GTHREAD_COND_INIT_FUNCTION(&_M_cond); | ^~~~~~~ In file included from /home/jwakely/gcc/mingw-win32/include/c++/x86_64-w64-mingw32/bits/gthr.h:14= 8, from /home/jwakely/gcc/mingw-win32/include/c++/bits/std_thread.h:46, from /home/jwakely/gcc/mingw-win32/include/c++/thread:45, from conftest.cpp:66: /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:151:7: error: '__gthread_cond_init_function' was not declared in this scope; did you mean '__gthread_mutex_init_function'? 151 | __GTHREAD_COND_INIT_FUNCTION(&_M_cond); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In destructor 'std::__condvar::~__condvar()': /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:157:69: error: '_M_cond' was not declared in this scope 157 | int __e __attribute__((__unused__)) =3D __gthread_cond_destroy(&_M_cond); |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ^~~~~~~ /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:157:45: error: '__gthread_cond_destroy' was not declared in this scope; did you mean '__gthread_mutex_destroy'? 157 | int __e __attribute__((__unused__)) =3D __gthread_cond_destroy(&_M_cond); | ^~~~~~~~~~~~~~~~~~~~~~ | __gthread_mutex_destroy /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In member funct= ion 'void std::__condvar::wait(std::mutex&)': /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:171:32: error: '_M_cond' was not declared in this scope 171 | =3D __gthread_cond_wait(&_M_cond, __m.native_handle()); | ^~~~~~~ /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:171:11: error: '__gthread_cond_wait' was not declared in this scope; did you mean '__gthread_once_t'? 171 | =3D __gthread_cond_wait(&_M_cond, __m.native_handle()); | ^~~~~~~~~~~~~~~~~~~ | __gthread_once_t /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In member funct= ion 'void std::__condvar::wait_until(std::mutex&, timespec&)': /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:178:33: error: '_M_cond' was not declared in this scope 178 | __gthread_cond_timedwait(&_M_cond, __m.native_handle(), &__abs_time); | ^~~~~~~ /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:178:7: error: '__gthread_cond_timedwait' was not declared in this scope 178 | __gthread_cond_timedwait(&_M_cond, __m.native_handle(), &__abs_time); | ^~~~~~~~~~~~~~~~~~~~~~~~ /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In member funct= ion 'void std::__condvar::notify_one()': /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:193:68: error: '_M_cond' was not declared in this scope 193 | int __e __attribute__((__unused__)) =3D __gthread_cond_signal(&_M_cond); |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ^~~~~~~ /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:193:45: error: '__gthread_cond_signal' was not declared in this scope 193 | int __e __attribute__((__unused__)) =3D __gthread_cond_signal(&_M_cond); | ^~~~~~~~~~~~~~~~~~~~~ /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In member funct= ion 'void std::__condvar::notify_all()': /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:200:71: error: '_M_cond' was not declared in this scope 200 | int __e __attribute__((__unused__)) =3D __gthread_cond_broadcast(&_M_cond); |=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ^~~~~~~ /home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h:200:45: error: '__gthread_cond_broadcast' was not declared in this scope 200 | int __e __attribute__((__unused__)) =3D __gthread_cond_broadcast(&_M_cond); | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/jwakely/gcc/mingw-win32/include/c++/mutex:48: /home/jwakely/gcc/mingw-win32/include/c++/condition_variable: At global sco= pe: /home/jwakely/gcc/mingw-win32/include/c++/condition_variable:83:13: error: '__gthread_cond_t' does not name a type; did you mean '__gthread_once_t'? 83 | typedef __gthread_cond_t* native_handle_type; | ^~~~~~~~~~~~~~~~ | __gthread_once_t /home/jwakely/gcc/mingw-win32/include/c++/condition_variable:183:5: error: 'native_handle_type' does not name a type 183 | native_handle_type | ^~~~~~~~~~~~~~~~~~ conftest.cpp: In function 'int main()': conftest.cpp:74:10: error: 'local_guard' is not a member of 'std'; did you = mean 'lock_guard'? 74 | std::local_guard l(m); | ^~~~~~~~~~~ | lock_guard conftest.cpp:74:32: error: expected primary-expression before '>' token 74 | std::local_guard l(m); | ^ conftest.cpp:74:34: error: 'l' was not declared in this scope 74 | std::local_guard l(m); | ^ configure:8993: $? =3D 1 configure: failed program was: ... configure:9000: result: no So the error is pretty ugly, but gdbsupport/configure correctly detects that std::thread and std::mutex cannot be used when -D_WIN32_WINNT=3D0x0501 is u= sed. But with or without the patch, libiberty fails when using -D_WIN32_WINNT=3D= 0x0501 so OP must be doing something that he's not showing. And that's just wasting everybody's time. --=20 You are receiving this mail because: You are on the CC list for the bug.=