]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
gcc: sanitizer: Fix tsan against glibc 2.34
authorSundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Tue, 15 Mar 2022 15:55:07 +0000 (21:25 +0530)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 3 Apr 2022 10:28:57 +0000 (11:28 +0100)
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.

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/gcc/gcc-11.2.inc
meta/recipes-devtools/gcc/gcc/0042-Fix-thread-stack-size-init.patch [new file with mode: 0644]

index 2394c86e297a8b951f2072311861232b1a7109f0..68e0d203fc5cf92b4401f7056427a5e16e429670 100644 (file)
@@ -68,6 +68,7 @@ SRC_URI = "\
            file://0003-CVE-2021-42574.patch \
            file://0004-CVE-2021-42574.patch \
            file://0001-CVE-2021-46195.patch \
+           file://0042-Fix-thread-stack-size-init.patch \
 "
 SRC_URI[sha256sum] = "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b"
 
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 (file)
index 0000000..3fb9ee9
--- /dev/null
@@ -0,0 +1,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() {