public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Switching x86_64-linux-gnu to GNU2 TLS descriptors by default
@ 2023-12-13 14:17 Florian Weimer
  2023-12-13 17:53 ` H.J. Lu
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Florian Weimer @ 2023-12-13 14:17 UTC (permalink / raw)
  To: gcc

I feel like I have asked this before.  Currently, GCC uses calls to
__tls_get_addr to obtain the address of global-dynamic TLS variables.
On other architectures with support for GNU2 TLS descriptors, those are
used by default.

Should we flip the default to GNU2 descriptors?  Support has been
available in glibc for a long, long time.  Is there any other reason for
not doing this?  On the glibc side, the behavior regarding lazy
initialization and symbol binding does not change whether the old or new
interface is used.

Thanks,
Florian


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

* Re: Switching x86_64-linux-gnu to GNU2 TLS descriptors by default
  2023-12-13 14:17 Switching x86_64-linux-gnu to GNU2 TLS descriptors by default Florian Weimer
@ 2023-12-13 17:53 ` H.J. Lu
  2023-12-13 19:58 ` Sam James
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: H.J. Lu @ 2023-12-13 17:53 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc

On Wed, Dec 13, 2023 at 6:19 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
>
> I feel like I have asked this before.  Currently, GCC uses calls to
> __tls_get_addr to obtain the address of global-dynamic TLS variables.
> On other architectures with support for GNU2 TLS descriptors, those are
> used by default.
>
> Should we flip the default to GNU2 descriptors?  Support has been
> available in glibc for a long, long time.  Is there any other reason for
> not doing this?  On the glibc side, the behavior regarding lazy
> initialization and symbol binding does not change whether the old or new
> interface is used.
>
> Thanks,
> Florian
>

It sounds good to me.

Thanks.

-- 
H.J.

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

* Re: Switching x86_64-linux-gnu to GNU2 TLS descriptors by default
  2023-12-13 14:17 Switching x86_64-linux-gnu to GNU2 TLS descriptors by default Florian Weimer
  2023-12-13 17:53 ` H.J. Lu
@ 2023-12-13 19:58 ` Sam James
  2023-12-13 21:08 ` Andrew Pinski
  2023-12-14  6:28 ` Sam James
  3 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2023-12-13 19:58 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc


Florian Weimer via Gcc <gcc@gcc.gnu.org> writes:

> I feel like I have asked this before.  Currently, GCC uses calls to
> __tls_get_addr to obtain the address of global-dynamic TLS variables.
> On other architectures with support for GNU2 TLS descriptors, those are
> used by default.
>
> Should we flip the default to GNU2 descriptors?  Support has been
> available in glibc for a long, long time.  Is there any other reason for
> not doing this?  On the glibc side, the behavior regarding lazy
> initialization and symbol binding does not change whether the old or new
> interface is used.
>

I was planning on bringing this up but I was worried there was some
reason we hadn't done it given it's been so long. Thank you!



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

* Re: Switching x86_64-linux-gnu to GNU2 TLS descriptors by default
  2023-12-13 14:17 Switching x86_64-linux-gnu to GNU2 TLS descriptors by default Florian Weimer
  2023-12-13 17:53 ` H.J. Lu
  2023-12-13 19:58 ` Sam James
@ 2023-12-13 21:08 ` Andrew Pinski
  2023-12-14  5:47   ` Andrew Pinski
  2023-12-14  6:28 ` Sam James
  3 siblings, 1 reply; 6+ messages in thread
From: Andrew Pinski @ 2023-12-13 21:08 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc

On Wed, Dec 13, 2023 at 6:19 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
>
> I feel like I have asked this before.  Currently, GCC uses calls to
> __tls_get_addr to obtain the address of global-dynamic TLS variables.
> On other architectures with support for GNU2 TLS descriptors, those are
> used by default.
>
> Should we flip the default to GNU2 descriptors?  Support has been
> available in glibc for a long, long time.  Is there any other reason for
> not doing this?  On the glibc side, the behavior regarding lazy
> initialization and symbol binding does not change whether the old or new
> interface is used.

Just FYI, the last time this was asked was 6 years ago but maybe
things has changed since:
https://inbox.sourceware.org/gcc-patches/CAMe9rOp_68qpdLz25PoHa1ewB6pGQuVv_+H5bXGFhU05MH9+Vg@mail.gmail.com/

Thanks,
Andrew

>
> Thanks,
> Florian
>

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

* Re: Switching x86_64-linux-gnu to GNU2 TLS descriptors by default
  2023-12-13 21:08 ` Andrew Pinski
@ 2023-12-14  5:47   ` Andrew Pinski
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Pinski @ 2023-12-14  5:47 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc

On Wed, Dec 13, 2023 at 1:08 PM Andrew Pinski <pinskia@gmail.com> wrote:
>
> On Wed, Dec 13, 2023 at 6:19 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
> >
> > I feel like I have asked this before.  Currently, GCC uses calls to
> > __tls_get_addr to obtain the address of global-dynamic TLS variables.
> > On other architectures with support for GNU2 TLS descriptors, those are
> > used by default.
> >
> > Should we flip the default to GNU2 descriptors?  Support has been
> > available in glibc for a long, long time.  Is there any other reason for
> > not doing this?  On the glibc side, the behavior regarding lazy
> > initialization and symbol binding does not change whether the old or new
> > interface is used.
>
> Just FYI, the last time this was asked was 6 years ago but maybe
> things has changed since:
> https://inbox.sourceware.org/gcc-patches/CAMe9rOp_68qpdLz25PoHa1ewB6pGQuVv_+H5bXGFhU05MH9+Vg@mail.gmail.com/

Oh I noticed that was a bug filed before that asking for testcases to
be added for it on x86_64 but it looks like it was not implemented:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48868

So it might even be broken.

Thanks,
Andrew


>
> Thanks,
> Andrew
>
> >
> > Thanks,
> > Florian
> >

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

* Re: Switching x86_64-linux-gnu to GNU2 TLS descriptors by default
  2023-12-13 14:17 Switching x86_64-linux-gnu to GNU2 TLS descriptors by default Florian Weimer
                   ` (2 preceding siblings ...)
  2023-12-13 21:08 ` Andrew Pinski
@ 2023-12-14  6:28 ` Sam James
  3 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2023-12-14  6:28 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc, Andrew Pinski


Florian Weimer via Gcc <gcc@gcc.gnu.org> writes:

> [...]
> On other architectures with support for GNU2 TLS descriptors, those are
> used by default.
>

It looks like arm32 defaults to gnu, not gnu2. andrew mentioned fdpic
will be an issue there but maybe we could carve that out.

> Should we flip the default to GNU2 descriptors?
> [...]

thanks,
sam

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

end of thread, other threads:[~2023-12-14  6:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 14:17 Switching x86_64-linux-gnu to GNU2 TLS descriptors by default Florian Weimer
2023-12-13 17:53 ` H.J. Lu
2023-12-13 19:58 ` Sam James
2023-12-13 21:08 ` Andrew Pinski
2023-12-14  5:47   ` Andrew Pinski
2023-12-14  6:28 ` Sam James

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