]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sanitizer: cherry pick 414482751452e54710f16bae58458c66298aaf69
authorMartin Liska <mliska@suse.cz>
Thu, 5 Aug 2021 08:43:17 +0000 (10:43 +0200)
committerMartin Liska <mliska@suse.cz>
Thu, 5 Aug 2021 08:45:03 +0000 (10:45 +0200)
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.

libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp

index 7ff48c35851ebc728a8c37a6230dfc3a90c7134d..a65b16f5290eded78bfdb5635d6be284a197aa95 100644 (file)
@@ -166,9 +166,10 @@ bool SupportsColoredOutput(fd_t fd) {
 #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() {