commit:     c2ac367b649aeab3ce9cbf8e1184f204f255ad93
Author:     Jory A. Pratt <anarchy <AT> bull <DOT> penguingeek>
AuthorDate: Thu Mar 14 23:26:27 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Thu Mar 14 23:26:27 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=c2ac367b

media-libs/mesa - address bug #670052 with upstream patch to disable tls

 .../mesa-18.2.4-add-disable-tls-support.patch      | 46 ++++++++++++++++++++++
 media-libs/mesa/mesa-18.2.4.ebuild                 |  6 +++
 2 files changed, 52 insertions(+)

diff --git a/media-libs/mesa/files/mesa-18.2.4-add-disable-tls-support.patch 
b/media-libs/mesa/files/mesa-18.2.4-add-disable-tls-support.patch
new file mode 100644
index 0000000..7eebc0d
--- /dev/null
+++ b/media-libs/mesa/files/mesa-18.2.4-add-disable-tls-support.patch
@@ -0,0 +1,46 @@
+From beca1b215950f4e917c21f916fd3c16fb09fb3fa Mon Sep 17 00:00:00 2001
+From: root <root@bull.penguingeek>
+Date: Wed, 6 Mar 2019 15:52:59 -0600
+Subject: [PATCH] Allow disable tls for musl
+
+---
+ meson.build       | 5 ++++-
+ meson_options.txt | 6 ++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 5b0eea1..d6a7675 100644
+--- a/meson.build
++++ b/meson.build
+@@ -327,7 +327,10 @@ if with_egl and not (with_platform_drm or 
with_platform_surfaceless)
+   endif
+ endif
+ 
+-pre_args += '-DGLX_USE_TLS'
++if get_option('glx-tls')
++  pre_args += '-DGLX_USE_TLS'
++endif
++
+ if with_glx != 'disabled'
+   if not (with_platform_x11 and with_any_opengl)
+     error('Cannot build GLX support without X11 platform support and at least 
one OpenGL API')
+diff --git a/meson_options.txt b/meson_options.txt
+index 5bb560b..3b721a6 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -277,6 +277,12 @@ option(
+   choices : ['none', 'classic', 'gallium'],
+   description : 'Build OSmesa.'
+ )
++option(
++  'glx-tls',
++  type : 'boolean',
++  value : true,
++  description : 'Enable thread-local storage in GLX and EGL'
++)
+ option(
+   'osmesa-bits',
+   type : 'combo',
+-- 
+2.21.0
+

diff --git a/media-libs/mesa/mesa-18.2.4.ebuild 
b/media-libs/mesa/mesa-18.2.4.ebuild
index ab4c917..09f49a9 100644
--- a/media-libs/mesa/mesa-18.2.4.ebuild
+++ b/media-libs/mesa/mesa-18.2.4.ebuild
@@ -238,6 +238,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-18-musl-invocation_name.patch
        "${FILESDIR}"/${PN}-18-musl-pthread.patch
        "${FILESDIR}"/${PN}-18-musl-amdgpu-include-pthread.patch
+       "${FILESDIR}"/${P}-add-disable-tls-support.patch
 )
 
 llvm_check_deps() {
@@ -451,6 +452,11 @@ multilib_src_configure() {
                emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
        fi
 
+       # Disable glx tls support on musl
+       if use elibc_musl; then
+               emesonargs+=( -Dglx-tls=false )
+       fi
+
        # on abi_x86_32 hardened we need to have asm disable
        if [[ ${ABI} == x86* ]] && use pic; then
                emesonargs+=( -Dasm=false )

Reply via email to