From 12f6282b6bf59d45934c78118ad5d26039fb533b Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Fri, 16 Apr 2021 23:12:51 +0200 Subject: libpthread/nptl: create timer thread with sufficiant stack size (account for TLS) Create timer thread with sufficiant stack size (take into account allocated space for thread-local-storage), for this backport glibc commit 'Create internal threads with sufficient stack size' ([1], [2]) introducing __pthread_get_minstack() and use it in __start_helper_thread(). Fixes timer_create() in case of linking with library using large TLS area (e.g openblas, see [3]). [1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2c1094bd700e63a8d7f547b3f5495bedb55c0a08 [2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=630f4cc3aa019ede55976ea561f1a7af2f068639 [3] http://lists.busybox.net/pipermail/buildroot/2021-April/308281.html Signed-off-by: Peter Seiderer --- libpthread/nptl/init.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libpthread/nptl/init.c') diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c index 4959d5ed8..5d25ded7d 100644 --- a/libpthread/nptl/init.c +++ b/libpthread/nptl/init.c @@ -337,3 +337,9 @@ __pthread_initialize_minimal_internal (void) } strong_alias (__pthread_initialize_minimal_internal, __pthread_initialize_minimal) + +size_t +__pthread_get_minstack (const pthread_attr_t *attr) +{ + return __static_tls_size + PTHREAD_STACK_MIN; +} -- cgit v1.2.3