8570a2a280
It is not portable to use initial-exec TLS in dlopened libraries. glibc and FreeBSD allocate extra memory for extra initial-exec variables specifically for libGL, but other libcs including musl do not. Keep initial-exec disabled on FreeBSD since it is apparently broken for some reason: https://gitlab.freedesktop.org/mesa/mesa/-/issues/966#note_394512 https://github.com/jbeich/mesa/commit/81dbdb15d55054242eded0eb2f32621d583c1aaf Enable TLS on OpenBSD and Haiku based on the u_thread.h comment that emutls is better than pthread_getspecific, which seems plausible given that emutls has strictly more information to work with. Fixes #966. Acked-by: Tapani Pälli <tapani.palli@intel.com> Acked-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12722>