<div dir="ltr"><br><br>On Sat, Jun 25, 2022 at 12:47 PM Markus Wichmann <<a href="mailto:nullplan@gmx.net">nullplan@gmx.net</a>> wrote:<br>><br>> On Sat, Jun 25, 2022 at 11:36:09AM +0800, 罗勇刚(Yonggang Luo) wrote:<br>> > So I am confused. What's the situation about ELF-TLS support in musl?<br>> > Is that still broken now?<br>><br>> musl has always supported ELF-TLS anywhere except in libc itself. That<br>> was also never the problem. The problem was that the mesa people select<br>> the initial-exec TLS model explicitly, even though libGL ends up being<br>> dlopen()ed quite often, and then you should be using the general-dynamic<br>> model instead.<div><br></div><div>My question is does musl support ELS-TLS when using dl-open.</div><div><br></div><div><br></div><div><br>><br>> According to [1], Rich proposed dropping the initial-exec attribute and<br>> replacing it with -mtls-dialect=gnu2 eight years ago. Has that happened<br>> yet? If so, dlopen()ing libGL with musl ought to work.<br><br>`initial-exec` are only specified for 

__GLIBC__, If musl  not predefined macro `

__GLIBC__`<br>```<br>#if defined(__GLIBC__)<br>#define __THREAD_INITIAL_EXEC thread_local __attribute__((tls_model("initial-exec")))<br>#define REALLY_INITIAL_EXEC<br>#else<br>#define __THREAD_INITIAL_EXEC thread_local<br>#endif<br>```<div><br><br>><br>> Ciao,<br>> Markus<br>><br>> [1] <a href="https://gitlab.freedesktop.org/mesa/mesa/-/issues/966">https://gitlab.freedesktop.org/mesa/mesa/-/issues/966</a><br><br><br><br>--<br>         此致<br>礼<br>罗勇刚<br>Yours<br>    sincerely,<br>Yonggang Luo<br></div></div></div>