summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch
blob: 3fb9ee98deefa4ed60ba9a6a2614ba279eea0d9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
The patch is needed in order to support recent glibc (2.34).

Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=91f8a7a34cf29ae7c465603a801326767f1cc7e9]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

---
--- a/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp	2022-03-15 07:59:54.515325204 -0700
+++ b/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp	2022-03-15 08:01:45.919405931 -0700
@@ -166,9 +166,10 @@
 #if !SANITIZER_GO
 // TODO(glider): different tools may require different altstack size.
 static uptr GetAltStackSize() {
-  // SIGSTKSZ is not enough.
-  static const uptr kAltStackSize = SIGSTKSZ * 4;
-  return kAltStackSize;
+  // Note: since GLIBC_2.31, SIGSTKSZ may be a function call, so this may be
+  // more costly that you think. However GetAltStackSize is only call 2-3 times
+  // per thread so don't cache the evaluation.
+  return SIGSTKSZ * 4;
 }
 
 void SetAlternateSignalStack() {