public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla@sourceware.org>
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	[thread overview]
Message-ID: <bug-29966-4717-ixRQQ0YnvA@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29966-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29966

--- Comment #52 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
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=x86_64-w64-mingw32 --enable-threads=win32
and I can then build GDB with --target=x86_64-w64-mingw32
--host=x86_64-w64-mingw32. This works fine.

Adding CXXFLAGS=-D_WIN32_WINNT=0x0501 to the GDB flags fails, but not in 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 != 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 should
be closed IMHO.

For that failing build, without the patch in comment 47 gdbsupport/config.log
shows:

configure:8963: checking for std::thread
configure:8990: x86_64-w64-mingw32-g++ -c -pthread -D_WIN32_WINNT=0x0501   
conftest.cpp >&5
configure:8990: $? = 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=0x0501   
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:148,
                 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__)) =
__gthread_cond_destroy(&_M_cond);
      |                                                                    
^~~~~~~
/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__)) =
__gthread_cond_destroy(&_M_cond);
      |                                             ^~~~~~~~~~~~~~~~~~~~~~
      |                                             __gthread_mutex_destroy
/home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In member function
'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 |         = __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 |         = __gthread_cond_wait(&_M_cond, __m.native_handle());
      |           ^~~~~~~~~~~~~~~~~~~
      |           __gthread_once_t
/home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In member function
'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 function
'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__)) =
__gthread_cond_signal(&_M_cond);
      |                                                                   
^~~~~~~
/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__)) =
__gthread_cond_signal(&_M_cond);
      |                                             ^~~~~~~~~~~~~~~~~~~~~
/home/jwakely/gcc/mingw-win32/include/c++/bits/std_mutex.h: In member function
'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__)) =
__gthread_cond_broadcast(&_M_cond);
      |                                                                      
^~~~~~~
/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__)) =
__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 scope:
/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<std::mutex> l(m);
      |          ^~~~~~~~~~~
      |          lock_guard
conftest.cpp:74:32: error: expected primary-expression before '>' token
   74 |     std::local_guard<std::mutex> l(m);
      |                                ^
conftest.cpp:74:34: error: 'l' was not declared in this scope
   74 |     std::local_guard<std::mutex> l(m);
      |                                  ^
configure:8993: $? = 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=0x0501 is used.

But with or without the patch, libiberty fails when using -D_WIN32_WINNT=0x0501
so OP must be doing something that he's not showing. And that's just wasting
everybody's time.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-01-23 10:54 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06  0:14 [Bug build/29966] New: " euloanty at live dot com
2023-01-06 13:41 ` [Bug build/29966] " tromey at sourceware dot org
2023-01-07  0:53 ` euloanty at live dot com
2023-01-07  0:54 ` euloanty at live dot com
2023-01-07  3:41 ` tromey at sourceware dot org
2023-01-07  3:42 ` tromey at sourceware dot org
2023-01-07 18:14 ` euloanty at live dot com
2023-01-07 19:34 ` tromey at sourceware dot org
2023-01-07 19:44 ` euloanty at live dot com
2023-01-07 20:07 ` tromey at sourceware dot org
2023-01-07 21:13 ` euloanty at live dot com
2023-01-07 21:40 ` euloanty at live dot com
2023-01-07 21:58 ` jwakely.gcc at gmail dot com
2023-01-07 22:00 ` euloanty at live dot com
2023-01-07 22:04 ` jwakely.gcc at gmail dot com
2023-01-07 22:05 ` jwakely.gcc at gmail dot com
2023-01-07 22:08 ` jwakely.gcc at gmail dot com
2023-01-07 22:13 ` jwakely.gcc at gmail dot com
2023-01-08  1:16 ` tromey at sourceware dot org
2023-01-08  4:06 ` tromey at sourceware dot org
2023-01-09 14:48 ` tromey at sourceware dot org
2023-01-10  0:15 ` euloanty at live dot com
2023-01-10  0:45 ` jwakely.gcc at gmail dot com
2023-01-10  1:32 ` tromey at sourceware dot org
2023-01-10  6:57 ` euloanty at live dot com
2023-01-10 11:47 ` jwakely.gcc at gmail dot com
2023-01-10 14:06 ` tromey at sourceware dot org
2023-01-11  4:32 ` euloanty at live dot com
2023-01-11  6:19 ` tromey at sourceware dot org
2023-01-11  6:47 ` euloanty at live dot com
2023-01-11  9:48 ` jwakely.gcc at gmail dot com
2023-01-11 15:13 ` tromey at sourceware dot org
2023-01-11 18:00 ` cvs-commit at gcc dot gnu.org
2023-01-11 18:02 ` tromey at sourceware dot org
2023-01-12 14:59 ` cvs-commit at gcc dot gnu.org
2023-01-12 14:59 ` tromey at sourceware dot org
2023-01-13  7:07 ` euloanty at live dot com
2023-01-13  7:07 ` euloanty at live dot com
2023-01-13 12:33 ` jwakely.gcc at gmail dot com
2023-01-13 19:12 ` tromey at sourceware dot org
2023-01-13 19:14 ` euloanty at live dot com
2023-01-13 21:27 ` tromey at sourceware dot org
2023-01-13 21:31 ` euloanty at live dot com
2023-01-14  6:29 ` brobecker at gnat dot com
2023-01-14  6:36 ` brobecker at gnat dot com
2023-01-14 17:11 ` tromey at sourceware dot org
2023-01-14 17:45 ` jwakely.gcc at gmail dot com
2023-01-14 17:52 ` jwakely.gcc at gmail dot com
2023-01-14 17:58 ` jwakely.gcc at gmail dot com
2023-01-18 16:55 ` tromey at sourceware dot org
2023-01-19  1:28 ` euloanty at live dot com
2023-01-19 16:49 ` tromey at sourceware dot org
2023-01-23 10:25 ` jwakely.gcc at gmail dot com
2023-01-23 10:54 ` jwakely.gcc at gmail dot com [this message]
2023-01-27 19:32 ` tromey at sourceware dot org
2023-01-28  2:27 ` euloanty at live dot com
2023-01-28  2:28 ` euloanty at live dot com
2023-01-28  2:30 ` euloanty at live dot com
2023-01-28  4:00 ` euloanty at live dot com
2023-01-28 10:08 ` jwakely.gcc at gmail dot com
2023-01-28 11:48 ` mark at klomp dot org
2023-01-29  3:41 ` tromey at sourceware dot org
2023-01-29  3:43 ` euloanty at live dot com
2023-01-29  3:44 ` euloanty at live dot com
2023-01-29  3:45 ` euloanty at live dot com
2023-01-29  3:54 ` euloanty at live dot com
2023-01-29 11:44 ` brobecker at gnat dot com
2023-01-29 13:27 ` mark at klomp dot org
2023-01-30  1:21 ` tromey at sourceware dot org

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=bug-29966-4717-ixRQQ0YnvA@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).