musl: backport various post-1.1.15 fixes
[openwrt/staging/wigyori.git] / toolchain / musl / patches / 071-fix-build-regression-on-archs-with-variable-page-size.patch
1 From 4078a5c31fa67987051c2180db7a07702534032f Mon Sep 17 00:00:00 2001
2 From: Rich Felker <dalias@aerifal.cx>
3 Date: Tue, 8 Nov 2016 18:03:42 -0500
4 Subject: fix build regression on archs with variable page size
5
6 commit 31fb174dd295e50f7c5cf18d31fcfd5fe5a063b7 used
7 DEFAULT_GUARD_SIZE from pthread_impl.h in a static initializer,
8 breaking build on archs where its definition, PAGE_SIZE, is not a
9 constant. instead, just define DEFAULT_GUARD_SIZE as 4096, the minimal
10 page size on any arch we support. pthread_create rounds up to whole
11 pages anyway, so defining it to 1 would also work, but a moderately
12 meaningful value is nicer to programs that use
13 pthread_attr_getguardsize on default-initialized attribute objects.
14 ---
15 src/internal/pthread_impl.h | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 diff --git a/src/internal/pthread_impl.h b/src/internal/pthread_impl.h
19 index 3890bb5..7a679db 100644
20 --- a/src/internal/pthread_impl.h
21 +++ b/src/internal/pthread_impl.h
22 @@ -143,7 +143,7 @@ void __block_app_sigs(void *);
23 void __restore_sigs(void *);
24
25 #define DEFAULT_STACK_SIZE 81920
26 -#define DEFAULT_GUARD_SIZE PAGE_SIZE
27 +#define DEFAULT_GUARD_SIZE 4096
28
29 #define __ATTRP_C11_THREAD ((void*)(uintptr_t)-1)
30
31 --
32 cgit v0.11.2