public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++-v3: Check for TLS support on mingw
@ 2018-02-19  8:59 Hugo Beauzée-Luyssen
  2018-02-26 21:05 ` Jonathan Wakely
  2021-08-31  9:02 ` Jonathan Wakely
  0 siblings, 2 replies; 7+ messages in thread
From: Hugo Beauzée-Luyssen @ 2018-02-19  8:59 UTC (permalink / raw)
  To: gcc-patches, libstdc++

libstdc++-v3: Check for TLS support on mingw

2018-02-16  Hugo Beauzée-Luyssen  <hugo@beauzee.fr>

    * crossconfig.m4: Check for TLS support on mignw
    * configure: regenerate

Index: libstdc++-v3/crossconfig.m4
===================================================================
--- libstdc++-v3/crossconfig.m4 (revision 257730)
+++ libstdc++-v3/crossconfig.m4 (working copy)
@@ -197,6 +197,7 @@ case "${host}" in
     GLIBCXX_CHECK_LINKER_FEATURES
     GLIBCXX_CHECK_MATH_SUPPORT
     GLIBCXX_CHECK_STDLIB_SUPPORT
+    GCC_CHECK_TLS
     ;;
   *-netbsd*)
     SECTION_FLAGS='-ffunction-sections -fdata-sections'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libstdc++-v3: Check for TLS support on mingw
  2018-02-19  8:59 [PATCH] libstdc++-v3: Check for TLS support on mingw Hugo Beauzée-Luyssen
@ 2018-02-26 21:05 ` Jonathan Wakely
  2021-08-31  9:02 ` Jonathan Wakely
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2018-02-26 21:05 UTC (permalink / raw)
  To: Hugo Beauzée-Luyssen; +Cc: gcc-patches, libstdc++

Apologies if you get this mail multiple times, I'm having some trouble
sending mail to @gcc.gnu.org lists.



On 19/02/18 09:59 +0100, Hugo Beauzée-Luyssen wrote:
> libstdc++-v3: Check for TLS support on mingw
>
> 2018-02-16  Hugo Beauzée-Luyssen  <hugo@beauzee.fr>
>
>    * crossconfig.m4: Check for TLS support on mignw

Typo "minwg"

>    * configure: regenerate
>
> Index: libstdc++-v3/crossconfig.m4
> ===================================================================
> --- libstdc++-v3/crossconfig.m4 (revision 257730)
> +++ libstdc++-v3/crossconfig.m4 (working copy)
> @@ -197,6 +197,7 @@ case "${host}" in
>     GLIBCXX_CHECK_LINKER_FEATURES
>     GLIBCXX_CHECK_MATH_SUPPORT
>     GLIBCXX_CHECK_STDLIB_SUPPORT
> +    GCC_CHECK_TLS
>     ;;
>   *-netbsd*)
>     SECTION_FLAGS='-ffunction-sections -fdata-sections'

Hi, thanks for the patch. I don't think we can apply it now, as the
GCC trunk is only open for regression fixes until GCC 8 is released.

How was this tested? Will it work for all versions of mingw that we
support? Is TLS enabled for native builds? (If so we definitely need
this, because otherwise mingw cross-compilers are not ABI compatibnle
with native ones).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libstdc++-v3: Check for TLS support on mingw
  2018-02-19  8:59 [PATCH] libstdc++-v3: Check for TLS support on mingw Hugo Beauzée-Luyssen
  2018-02-26 21:05 ` Jonathan Wakely
@ 2021-08-31  9:02 ` Jonathan Wakely
  2021-08-31 14:29   ` lhmouse
  2021-09-01  1:46   ` Jonathan Yong
  1 sibling, 2 replies; 7+ messages in thread
From: Jonathan Wakely @ 2021-08-31  9:02 UTC (permalink / raw)
  To: Hugo Beauzée-Luyssen
  Cc: gcc-patches, libstdc++, JonY, NightStrike, lh_mouse

It looks like my questions about this patch never got an answer, and
it never got applied.

Could somebody say whether TLS is enabled for native *-*-mingw*
builds? If it is, then we definitely need to add GCC_CHECK_TLS to the
cross-compiler config too.

For a linux-hosted x86_64-w64-mingw32 cross compiler I see TLS is not enabled:

/* Define to 1 if the target supports thread-local storage. */
/* #undef _GLIBCXX_HAVE_TLS */




On Mon, 19 Feb 2018 at 08:59, Hugo Beauzée-Luyssen <hugo@beauzee.fr> wrote:
>
> libstdc++-v3: Check for TLS support on mingw
>
> 2018-02-16  Hugo Beauzée-Luyssen  <hugo@beauzee.fr>
>
>     * crossconfig.m4: Check for TLS support on mignw
>     * configure: regenerate
>
> Index: libstdc++-v3/crossconfig.m4
> ===================================================================
> --- libstdc++-v3/crossconfig.m4 (revision 257730)
> +++ libstdc++-v3/crossconfig.m4 (working copy)
> @@ -197,6 +197,7 @@ case "${host}" in
>      GLIBCXX_CHECK_LINKER_FEATURES
>      GLIBCXX_CHECK_MATH_SUPPORT
>      GLIBCXX_CHECK_STDLIB_SUPPORT
> +    GCC_CHECK_TLS
>      ;;
>    *-netbsd*)
>      SECTION_FLAGS='-ffunction-sections -fdata-sections'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re:Re: [PATCH] libstdc++-v3: Check for TLS support on mingw
  2021-08-31  9:02 ` Jonathan Wakely
@ 2021-08-31 14:29   ` lhmouse
  2021-09-01  1:46   ` Jonathan Yong
  1 sibling, 0 replies; 7+ messages in thread
From: lhmouse @ 2021-08-31 14:29 UTC (permalink / raw)
  To: Jonathan Wakely
  Cc: Hugo Beauzée-Luyssen, gcc-patches, libstdc++, JonY, NightStrike

在 2021-08-31 17:02, Jonathan Wakely 写道:
> It looks like my questions about this patch never got an answer, and
> it never got applied.
> 
> Could somebody say whether TLS is enabled for native *-*-mingw*
> builds? If it is, then we definitely need to add GCC_CHECK_TLS to the
> cross-compiler config too.
> 
> For a linux-hosted x86_64-w64-mingw32 cross compiler I see TLS is not enabled:
> 
> /* Define to 1 if the target supports thread-local storage. */
> /* #undef _GLIBCXX_HAVE_TLS */
> 

I have been disabling it with `--disable-tls` for years, but... I couldn't remember why. Thread-local storage is implemented with emutls, no matter with or without this option.

Does 'thread-local storage' mean to access thread-local objects via the FS or GS register on x86? If so, then it is definitely not supported yet.


-- 
Best regards,
LIU Hao





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libstdc++-v3: Check for TLS support on mingw
  2021-08-31  9:02 ` Jonathan Wakely
  2021-08-31 14:29   ` lhmouse
@ 2021-09-01  1:46   ` Jonathan Yong
  2021-09-01  9:52     ` Jonathan Wakely
  1 sibling, 1 reply; 7+ messages in thread
From: Jonathan Yong @ 2021-09-01  1:46 UTC (permalink / raw)
  To: Jonathan Wakely, Hugo Beauzée-Luyssen
  Cc: gcc-patches, libstdc++, NightStrike, lh_mouse


[-- Attachment #1.1.1: Type: text/plain, Size: 1509 bytes --]

On 8/31/21 9:02 AM, Jonathan Wakely wrote:
> It looks like my questions about this patch never got an answer, and
> it never got applied.
> 
> Could somebody say whether TLS is enabled for native *-*-mingw*
> builds? If it is, then we definitely need to add GCC_CHECK_TLS to the
> cross-compiler config too.
> 
> For a linux-hosted x86_64-w64-mingw32 cross compiler I see TLS is not enabled:
> 
> /* Define to 1 if the target supports thread-local storage. */
> /* #undef _GLIBCXX_HAVE_TLS */
> 
> 
> 
> 
> On Mon, 19 Feb 2018 at 08:59, Hugo Beauzée-Luyssen <hugo@beauzee.fr> wrote:
>>
>> libstdc++-v3: Check for TLS support on mingw
>>
>> 2018-02-16  Hugo Beauzée-Luyssen  <hugo@beauzee.fr>
>>
>>      * crossconfig.m4: Check for TLS support on mignw
>>      * configure: regenerate
>>
>> Index: libstdc++-v3/crossconfig.m4
>> ===================================================================
>> --- libstdc++-v3/crossconfig.m4 (revision 257730)
>> +++ libstdc++-v3/crossconfig.m4 (working copy)
>> @@ -197,6 +197,7 @@ case "${host}" in
>>       GLIBCXX_CHECK_LINKER_FEATURES
>>       GLIBCXX_CHECK_MATH_SUPPORT
>>       GLIBCXX_CHECK_STDLIB_SUPPORT
>> +    GCC_CHECK_TLS
>>       ;;
>>     *-netbsd*)
>>       SECTION_FLAGS='-ffunction-sections -fdata-sections'

According to MSYS2 native from 
https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-gcc-10.3.0-5-any.pkg.tar.zst:

x86_64-w64-mingw32/bits/c++config.h:#define _GLIBCXX_HAVE_TLS 1

So yes.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 5627 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libstdc++-v3: Check for TLS support on mingw
  2021-09-01  1:46   ` Jonathan Yong
@ 2021-09-01  9:52     ` Jonathan Wakely
  2021-09-15  8:53       ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Wakely @ 2021-09-01  9:52 UTC (permalink / raw)
  To: Jonathan Yong
  Cc: Hugo Beauzée-Luyssen, gcc-patches, libstdc++, NightStrike, lh_mouse

On Wed, 1 Sept 2021 at 02:44, Jonathan Yong <10walls@gmail.com> wrote:
>
> On 8/31/21 9:02 AM, Jonathan Wakely wrote:
> > It looks like my questions about this patch never got an answer, and
> > it never got applied.
> >
> > Could somebody say whether TLS is enabled for native *-*-mingw*
> > builds? If it is, then we definitely need to add GCC_CHECK_TLS to the
> > cross-compiler config too.
> >
> > For a linux-hosted x86_64-w64-mingw32 cross compiler I see TLS is not enabled:
> >
> > /* Define to 1 if the target supports thread-local storage. */
> > /* #undef _GLIBCXX_HAVE_TLS */
> >
> >
> >
> >
> > On Mon, 19 Feb 2018 at 08:59, Hugo Beauzée-Luyssen <hugo@beauzee.fr> wrote:
> >>
> >> libstdc++-v3: Check for TLS support on mingw
> >>
> >> 2018-02-16  Hugo Beauzée-Luyssen  <hugo@beauzee.fr>
> >>
> >>      * crossconfig.m4: Check for TLS support on mignw
> >>      * configure: regenerate
> >>
> >> Index: libstdc++-v3/crossconfig.m4
> >> ===================================================================
> >> --- libstdc++-v3/crossconfig.m4 (revision 257730)
> >> +++ libstdc++-v3/crossconfig.m4 (working copy)
> >> @@ -197,6 +197,7 @@ case "${host}" in
> >>       GLIBCXX_CHECK_LINKER_FEATURES
> >>       GLIBCXX_CHECK_MATH_SUPPORT
> >>       GLIBCXX_CHECK_STDLIB_SUPPORT
> >> +    GCC_CHECK_TLS
> >>       ;;
> >>     *-netbsd*)
> >>       SECTION_FLAGS='-ffunction-sections -fdata-sections'
>
> According to MSYS2 native from
> https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-gcc-10.3.0-5-any.pkg.tar.zst:
>
> x86_64-w64-mingw32/bits/c++config.h:#define _GLIBCXX_HAVE_TLS 1
>
> So yes.

Thanks! I'll test the patch on a cross-compiler and apply it soon then.

(Thanks also to LH for the answer)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] libstdc++-v3: Check for TLS support on mingw
  2021-09-01  9:52     ` Jonathan Wakely
@ 2021-09-15  8:53       ` Jonathan Wakely
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2021-09-15  8:53 UTC (permalink / raw)
  To: Jonathan Yong
  Cc: Hugo Beauzée-Luyssen, gcc-patches, libstdc++, NightStrike, lh_mouse

On Wed, 1 Sept 2021 at 10:52, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
> On Wed, 1 Sept 2021 at 02:44, Jonathan Yong <10walls@gmail.com> wrote:
> >
> > On 8/31/21 9:02 AM, Jonathan Wakely wrote:
> > > It looks like my questions about this patch never got an answer, and
> > > it never got applied.
> > >
> > > Could somebody say whether TLS is enabled for native *-*-mingw*
> > > builds? If it is, then we definitely need to add GCC_CHECK_TLS to the
> > > cross-compiler config too.
> > >
> > > For a linux-hosted x86_64-w64-mingw32 cross compiler I see TLS is not enabled:
> > >
> > > /* Define to 1 if the target supports thread-local storage. */
> > > /* #undef _GLIBCXX_HAVE_TLS */
> > >
> > >
> > >
> > >
> > > On Mon, 19 Feb 2018 at 08:59, Hugo Beauzée-Luyssen <hugo@beauzee.fr> wrote:
> > >>
> > >> libstdc++-v3: Check for TLS support on mingw
> > >>
> > >> 2018-02-16  Hugo Beauzée-Luyssen  <hugo@beauzee.fr>
> > >>
> > >>      * crossconfig.m4: Check for TLS support on mignw
> > >>      * configure: regenerate
> > >>
> > >> Index: libstdc++-v3/crossconfig.m4
> > >> ===================================================================
> > >> --- libstdc++-v3/crossconfig.m4 (revision 257730)
> > >> +++ libstdc++-v3/crossconfig.m4 (working copy)
> > >> @@ -197,6 +197,7 @@ case "${host}" in
> > >>       GLIBCXX_CHECK_LINKER_FEATURES
> > >>       GLIBCXX_CHECK_MATH_SUPPORT
> > >>       GLIBCXX_CHECK_STDLIB_SUPPORT
> > >> +    GCC_CHECK_TLS
> > >>       ;;
> > >>     *-netbsd*)
> > >>       SECTION_FLAGS='-ffunction-sections -fdata-sections'
> >
> > According to MSYS2 native from
> > https://mirror.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-gcc-10.3.0-5-any.pkg.tar.zst:
> >
> > x86_64-w64-mingw32/bits/c++config.h:#define _GLIBCXX_HAVE_TLS 1
> >
> > So yes.
>
> Thanks! I'll test the patch on a cross-compiler and apply it soon then.
>
> (Thanks also to LH for the answer)

I've pushed this to trunk now. Thanks for the patch, Hugo. Sorry it
took so long to process.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-15  8:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19  8:59 [PATCH] libstdc++-v3: Check for TLS support on mingw Hugo Beauzée-Luyssen
2018-02-26 21:05 ` Jonathan Wakely
2021-08-31  9:02 ` Jonathan Wakely
2021-08-31 14:29   ` lhmouse
2021-09-01  1:46   ` Jonathan Yong
2021-09-01  9:52     ` Jonathan Wakely
2021-09-15  8:53       ` Jonathan Wakely

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).