how-lix-os-pkgs/mesa-dynamic/default/patches-available/0300-add-use-elf-tls.patch

29 lines
1.0 KiB
Diff

diff --git a/meson.build b/meson.build
index 76f72a9df7c..2802467f70e 100644
--- a/meson.build
+++ b/meson.build
@@ -437,7 +437,8 @@ 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'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
+with_use_elf_tls = get_option('use-elf-tls')
+if with_use_elf_tls and not ['windows', 'freebsd'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
pre_args += '-DUSE_ELF_TLS'
use_elf_tls = true
endif
diff --git a/meson_options.txt b/meson_options.txt
index bf031eeb11f..46bd7c4d898 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -406,3 +406,9 @@ option(
value : 'auto',
description : 'Use ZSTD instead of ZLIB in some cases.'
)
+option(
+ 'use-elf-tls',
+ type : 'boolean',
+ value : false,
+ description : 'Build support for initial-exec TLS model'
+)