public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/100429] New: threading support on windows
@ 2021-05-05 7:54 unlvsur at live dot com
2021-05-05 7:56 ` [Bug libstdc++/100429] threading support on windows. _GLIBCXX_HAS_GTHREADS macro is not 1 but libgcc is correct unlvsur at live dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: unlvsur at live dot com @ 2021-05-05 7:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100429
Bug ID: 100429
Summary: threading support on windows
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: unlvsur at live dot com
Target Milestone: ---
It looks like libgcc DOES provide threading support for windows. However,
_GLIBCXX_HAS_GTHREADS does not get defined for libstdc++, I guess it is another
libtool issue.
SO GOOD, if we fix them, we will have our own threading support for GCC on
windows.
https://github.com/gcc-mirror/gcc/blob/master/libgcc/config/i386/gthr-win32.h
_GLIBCXX_HAS_GTHREADS
In file included from
d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr.h:148,
from b.cc:4:
d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr-default.h: In
function 'int __gthread_setspecific(__gthread_key_t, const void*)':
d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr-default.h:629:27:
error: types may not be defined in casts
629 | if (TlsSetValue (__key, CONST_CAST2(void *, const void *, __ptr)) !=
0)
| ^~~~~~~~~~~
BTW. there is another bug in libgcc. This does not work.
An alternative code should be if (TlsSetValue (__key, void*( __ptr)) != 0)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/100429] threading support on windows. _GLIBCXX_HAS_GTHREADS macro is not 1 but libgcc is correct
2021-05-05 7:54 [Bug libstdc++/100429] New: threading support on windows unlvsur at live dot com
@ 2021-05-05 7:56 ` unlvsur at live dot com
2021-05-05 12:11 ` redi at gcc dot gnu.org
2021-05-05 16:14 ` unlvsur at live dot com
2 siblings, 0 replies; 4+ messages in thread
From: unlvsur at live dot com @ 2021-05-05 7:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100429
--- Comment #1 from cqwrteur <unlvsur at live dot com> ---
if (TlsSetValue (__key, (void*) __ptr) != 0)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/100429] threading support on windows. _GLIBCXX_HAS_GTHREADS macro is not 1 but libgcc is correct
2021-05-05 7:54 [Bug libstdc++/100429] New: threading support on windows unlvsur at live dot com
2021-05-05 7:56 ` [Bug libstdc++/100429] threading support on windows. _GLIBCXX_HAS_GTHREADS macro is not 1 but libgcc is correct unlvsur at live dot com
@ 2021-05-05 12:11 ` redi at gcc dot gnu.org
2021-05-05 16:14 ` unlvsur at live dot com
2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2021-05-05 12:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100429
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #0)
> It looks like libgcc DOES provide threading support for windows. However,
> _GLIBCXX_HAS_GTHREADS does not get defined for libstdc++, I guess it is
> another libtool issue.
>
> SO GOOD, if we fix them, we will have our own threading support for GCC on
> windows.
>
>
> https://github.com/gcc-mirror/gcc/blob/master/libgcc/config/i386/gthr-win32.h
>
>
> _GLIBCXX_HAS_GTHREADS
Just read the comments in libgcc/gthr.h
If the following are also defined, you should
#define __GTHREADS_CXX0X 1
to enable the c++0x thread library.
None of the required functions are defined by gthr-win32.h so it (correctly)
doesn't define __GTHREADS_CXX0X and so libstdc++ doesn't use it.
> In file included from
> d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr.h:148,
> from b.cc:4:
> d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr-default.h: In
> function 'int __gthread_setspecific(__gthread_key_t, const void*)':
> d:\toolchains\include\c++\12.0.0\x86_64-w64-mingw32\bits\gthr-default.h:629:
> 27: error: types may not be defined in casts
> 629 | if (TlsSetValue (__key, CONST_CAST2(void *, const void *, __ptr))
> != 0)
> | ^~~~~~~~~~~
>
> BTW. there is another bug in libgcc. This does not work.
>
> An alternative code should be if (TlsSetValue (__key, void*( __ptr)) != 0)
This seems like an entirely separate issue.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/100429] threading support on windows. _GLIBCXX_HAS_GTHREADS macro is not 1 but libgcc is correct
2021-05-05 7:54 [Bug libstdc++/100429] New: threading support on windows unlvsur at live dot com
2021-05-05 7:56 ` [Bug libstdc++/100429] threading support on windows. _GLIBCXX_HAS_GTHREADS macro is not 1 but libgcc is correct unlvsur at live dot com
2021-05-05 12:11 ` redi at gcc dot gnu.org
@ 2021-05-05 16:14 ` unlvsur at live dot com
2 siblings, 0 replies; 4+ messages in thread
From: unlvsur at live dot com @ 2021-05-05 16:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100429
cqwrteur <unlvsur at live dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from cqwrteur <unlvsur at live dot com> ---
invalid
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-05-05 16:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 7:54 [Bug libstdc++/100429] New: threading support on windows unlvsur at live dot com
2021-05-05 7:56 ` [Bug libstdc++/100429] threading support on windows. _GLIBCXX_HAS_GTHREADS macro is not 1 but libgcc is correct unlvsur at live dot com
2021-05-05 12:11 ` redi at gcc dot gnu.org
2021-05-05 16:14 ` unlvsur at live dot com
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).