From f970f7dbd85f9ae8ce0612990a08c6659e26f4b0 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Sat, 2 Feb 2019 08:46:52 +0100 Subject: [PATCH] Revert "libGL: request stack size on newer musl systems" This reverts commit 3dc48b45dd100cbbe7ce5ef0d70ac2a4d04188e1. libGL and mesa drivers are commonly loaded dynamicly. This commit re-introduces the patch to make sure stack-size is loaded properly even if the library is loaded dynamicly. --- srcpkgs/libGL/patches/musl-stacksize.patch | 35 ++++++++++++++++++++++ srcpkgs/libGL/template | 3 +- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/libGL/patches/musl-stacksize.patch diff --git a/srcpkgs/libGL/patches/musl-stacksize.patch b/srcpkgs/libGL/patches/musl-stacksize.patch new file mode 100644 index 00000000000..a8fb6735517 --- /dev/null +++ b/srcpkgs/libGL/patches/musl-stacksize.patch @@ -0,0 +1,35 @@ +diff --git ./include/c11/threads_posix.h ./include/c11/threads_posix.h +index 45cb6075e6..1a2ea1a450 100644 +--- ./include/c11/threads_posix.h ++++ ./include/c11/threads_posix.h +@@ -281,15 +281,29 @@ static inline int + thrd_create(thrd_t *thr, thrd_start_t func, void *arg) + { + struct impl_thrd_param *pack; ++#ifdef __GLIBC__ ++ pthread_attr_t *attrp = NULL; ++#else ++ pthread_attr_t attr = { 0 }; ++ pthread_attr_init(&attr); ++ pthread_attr_setstacksize(&attr, 8388608); ++ pthread_attr_t *attrp = &attr; ++#endif + assert(thr != NULL); + pack = (struct impl_thrd_param *)malloc(sizeof(struct impl_thrd_param)); + if (!pack) return thrd_nomem; + pack->func = func; + pack->arg = arg; +- if (pthread_create(thr, NULL, impl_thrd_routine, pack) != 0) { ++ if (pthread_create(thr, attrp, impl_thrd_routine, pack) != 0) { ++#ifndef __GLIBC__ ++ pthread_attr_destroy(&attr); ++#endif + free(pack); + return thrd_error; + } ++#ifndef __GLIBC__ ++ pthread_attr_destroy(&attr); ++#endif + return thrd_success; + } + diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template index b29fa672c82..2765b6c020e 100644 --- a/srcpkgs/libGL/template +++ b/srcpkgs/libGL/template @@ -1,7 +1,7 @@ # Template file for 'libGL' pkgname=libGL version=18.3.2 -revision=2 +revision=3 wrksrc="mesa-${version}" build_style=meson configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true @@ -22,7 +22,6 @@ homepage="https://www.mesa3d.org/" changelog="https://www.mesa3d.org/relnotes/${version}.html" distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz" checksum=f7ce7181c07b6d8e0132da879af1729523a6c8aa87f79a9d59dfd064024cfb35 -LDFLAGS+=" -Wl,-z,stack-size=2097152" # Set subpackages manually to set proper rdeps in 32bit pkgs. subpackages="libglapi libgbm libEGL libGLES libOSMesa"