[musl] Fwd: mesa | Remove USE_ELF_TLS macro (!17213)

罗勇刚(Yonggang Luo) luoyonggang at gmail.com
Sat Jun 25 05:25:31 UTC 2022

On Sat, Jun 25, 2022 at 12:47 PM Markus Wichmann <nullplan at gmx.net> wrote:
> On Sat, Jun 25, 2022 at 11:36:09AM +0800, 罗勇刚(Yonggang Luo) wrote:
> > So I am confused. What's the situation about ELF-TLS support in musl?
> > Is that still broken now?
> musl has always supported ELF-TLS anywhere except in libc itself. That
> was also never the problem. The problem was that the mesa people select
> the initial-exec TLS model explicitly, even though libGL ends up being
> dlopen()ed quite often, and then you should be using the general-dynamic
> model instead.

My question is does musl support ELS-TLS when using dl-open.

> According to [1], Rich proposed dropping the initial-exec attribute and
> replacing it with -mtls-dialect=gnu2 eight years ago. Has that happened
> yet? If so, dlopen()ing libGL with musl ought to work.

`initial-exec` are only specified for  __GLIBC__, If musl  not predefined
macro ` __GLIBC__`
#if defined(__GLIBC__)
#define __THREAD_INITIAL_EXEC thread_local
#define __THREAD_INITIAL_EXEC thread_local

> Ciao,
> Markus
> [1] https://gitlab.freedesktop.org/mesa/mesa/-/issues/966

Yonggang Luo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20220625/c1de77de/attachment.htm>

More information about the mesa-dev mailing list