mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-29 00:42:58 +02:00
libGL: expand the stack size on musl when creating new threads.
fixes #933.
This commit is contained in:
parent
b347842deb
commit
18838a6cd6
2 changed files with 36 additions and 1 deletions
35
srcpkgs/libGL/patches/musl-stacksize.patch
Normal file
35
srcpkgs/libGL/patches/musl-stacksize.patch
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'libGL'
|
# Template file for 'libGL'
|
||||||
pkgname=libGL
|
pkgname=libGL
|
||||||
version=18.1.4
|
version=18.1.4
|
||||||
revision=1
|
revision=2
|
||||||
wrksrc="mesa-${version}"
|
wrksrc="mesa-${version}"
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
configure_args="--enable-shared-glapi --enable-gbm
|
configure_args="--enable-shared-glapi --enable-gbm
|
||||||
|
|
Loading…
Add table
Reference in a new issue