summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSundeep KOKKONDA <sundeep.kokkonda@gmail.com>2022-03-15 21:25:07 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-03 11:29:05 +0100
commit99bcad583aee31d54f3f34d50fc4d6a417484114 (patch)
tree3d79772be1920c71d65ae3c59673ca3678e640f3
parentfb1291ea5f6f0edaf6612ba7bac52136e16af462 (diff)
downloadpoky-99bcad583aee31d54f3f34d50fc4d6a417484114.tar.gz
gcc: sanitizer: Fix tsan against glibc 2.34
The patch is needed in order to support recent glibc (2.34). libsanitizer/ChangeLog: PR sanitizer/101749 * sanitizer_common/sanitizer_posix_libcdep.cpp: Prevent generation of dependency on _cxa_guard for static initialization. (From OE-Core rev: c44c4e7fb3c860d9fcb2aada0c9d4acb1e1e8101) Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-11.2.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch23
2 files changed, 24 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-11.2.inc b/meta/recipes-devtools/gcc/gcc-11.2.inc
index 2394c86e29..68e0d203fc 100644
--- a/meta/recipes-devtools/gcc/gcc-11.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-11.2.inc
@@ -68,6 +68,7 @@ SRC_URI = "\
68 file://0003-CVE-2021-42574.patch \ 68 file://0003-CVE-2021-42574.patch \
69 file://0004-CVE-2021-42574.patch \ 69 file://0004-CVE-2021-42574.patch \
70 file://0001-CVE-2021-46195.patch \ 70 file://0001-CVE-2021-46195.patch \
71 file://0042-Fix-thread-stack-size-init.patch \
71" 72"
72SRC_URI[sha256sum] = "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b" 73SRC_URI[sha256sum] = "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b"
73 74
diff --git a/meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch b/meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch
new file mode 100644
index 0000000000..3fb9ee98de
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch
@@ -0,0 +1,23 @@
1The patch is needed in order to support recent glibc (2.34).
2
3Upstream-Status: Backport [https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=91f8a7a34cf29ae7c465603a801326767f1cc7e9]
4
5Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6
7---
8--- a/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp 2022-03-15 07:59:54.515325204 -0700
9+++ b/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp 2022-03-15 08:01:45.919405931 -0700
10@@ -166,9 +166,10 @@
11 #if !SANITIZER_GO
12 // TODO(glider): different tools may require different altstack size.
13 static uptr GetAltStackSize() {
14- // SIGSTKSZ is not enough.
15- static const uptr kAltStackSize = SIGSTKSZ * 4;
16- return kAltStackSize;
17+ // Note: since GLIBC_2.31, SIGSTKSZ may be a function call, so this may be
18+ // more costly that you think. However GetAltStackSize is only call 2-3 times
19+ // per thread so don't cache the evaluation.
20+ return SIGSTKSZ * 4;
21 }
22
23 void SetAlternateSignalStack() {