Commit 3fbe644c authored by Ariadne Conill's avatar Ariadne Conill

main/musl: track pthread guard sizes

parent 8fc44f5c
From 21845fbedb172de1e14946fcf4c517ebc4d12fc1 Mon Sep 17 00:00:00 2001
From: William Pitcock <nenolod@dereferenced.org>
Date: Sat, 6 Jan 2018 04:42:44 +0000
Subject: [PATCH] track pthread stack guard sizes
some applications (rustc) are dependent on pthread_getattr_np() providing the guard size.
---
src/internal/pthread_impl.h | 1 +
src/thread/pthread_create.c | 1 +
src/thread/pthread_getattr_np.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
index 56e19348..c2cafeaa 100644
--- a/src/internal/pthread_impl.h
+++ b/src/internal/pthread_impl.h
@@ -48,6 +48,7 @@ struct pthread {
void *stdio_locks;
uintptr_t canary_at_end;
void **dtv_copy;
+ size_t guard_size;
};
struct __timer {
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index 6cbf85b3..0faad765 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -265,6 +265,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
new->map_size = size;
new->stack = stack;
new->stack_size = stack - stack_limit;
+ new->guard_size = guard;
new->start = entry;
new->start_arg = arg;
new->self = new;
diff --git a/src/thread/pthread_getattr_np.c b/src/thread/pthread_getattr_np.c
index ae26a5ab..29a209bd 100644
--- a/src/thread/pthread_getattr_np.c
+++ b/src/thread/pthread_getattr_np.c
@@ -7,6 +7,7 @@ int pthread_getattr_np(pthread_t t, pthread_attr_t *a)
{
*a = (pthread_attr_t){0};
a->_a_detach = !!t->detached;
+ a->_a_guardsize = t->guard_size;
if (t->stack) {
a->_a_stackaddr = (uintptr_t)t->stack;
a->_a_stacksize = t->stack_size;
--
2.15.0
......@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.1.18
pkgrel=3
pkgrel=4
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
......@@ -19,6 +19,7 @@ esac
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
0001-fix-sysconf-for-infinite-rlimits.patch
0001-use-the-name-UTC-instead-of-GMT-for-UTC-timezone.patch
0001-track-pthread-stack-guard-sizes.patch
1000-implement-strftime-GNU-extension-padding-specifiers-.patch
2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
3002-stdio-implement-fopencookie-3.patch
......@@ -148,6 +149,7 @@ compat() {
sha512sums="4d55c92efe41dfdd9fff6aca5dda76a632a3be60d10e5a7f66a4731d8f7040fb0a20b998965ba4d069b4f8a3527fcd7388e646cb66afc649c4d0cc6c3d358c9c musl-1.1.18.tar.gz
7b44cc006d37672a67bc261de33e64d11f6426fd1ab3ff80f9f980aefc8e0b099ab61f95d110eeb59f75c2fe772fe13bc5546c194c3f90ca9ec4c812dfff6b1b 0001-fix-sysconf-for-infinite-rlimits.patch
c28abac671f531d200bd1ebc934fc57b1c04404e49237dd6cfde4fe72e4fd8b855df0e75f76d62ec930c56daa00a12a6a3b3bb1c86576c7504fdf9628ad58975 0001-use-the-name-UTC-instead-of-GMT-for-UTC-timezone.patch
e15f00d34756dc77547ee9040b85061cbf480be8bbc997051567dd1251b72db1254501eff95e87a3e8f6aa0c5e1fe905dd12052a9217005a45f686f29cfc97c2 0001-track-pthread-stack-guard-sizes.patch
7e4c703e57a3564cd3ee1d5334b806cbe654355179ba55d4d25361dfc555eb4a7d081d80d64fdaff8476949afd04558d278b124d1fb108080beaa5ba2f8ce2b9 1000-implement-strftime-GNU-extension-padding-specifiers-.patch
2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
bdc6fe197779088507d6f8bb72560239f908a635b39eb677bfcf91da28b92ee52b67696e627dad08ccb8a7dcaf7a72b574276098fb3fddd4a6b646a0f0799785 3002-stdio-implement-fopencookie-3.patch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment