glapi: Support "ELF" TLS on Windows

To avoid a massive rename, I'm leaving this as a misnomer, it's not
really ELF TLS, but it's the same concept.

Note that Windows doesn't support thread-local variables imported
or exported between modules, so we can only support this when we're
not using a shared glapi.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4050
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9165>
This commit is contained in:
Jesse Natalie
2021-02-19 14:55:57 -08:00
committed by Marge Bot
parent d7e1f492bc
commit ba141b95a7
3 changed files with 14 additions and 1 deletions

View File

@@ -449,7 +449,9 @@ endif
# Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
use_elf_tls = false
if not ['windows', 'freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
(not with_platform_android or get_option('platform-sdk-version') >= 29) and
(not with_platform_windows or not with_shared_glapi))
pre_args += '-DUSE_ELF_TLS'
use_elf_tls = true
endif