public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-10020] sanitizer: cherry pick 414482751452e54710f16bae58458c66298aaf69
@ 2021-08-05  8:49 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-08-05  8:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6bbaa64881715b8df2d717e418eeec7b7e974a22

commit r10-10020-g6bbaa64881715b8df2d717e418eeec7b7e974a22
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Aug 5 10:43:17 2021 +0200

    sanitizer: cherry pick 414482751452e54710f16bae58458c66298aaf69
    
    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.

Diff:
---
 libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp b/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp
index ac88fbe074e..44359b3d1ac 100644
--- a/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp
@@ -170,9 +170,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() {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-05  8:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05  8:49 [gcc r10-10020] sanitizer: cherry pick 414482751452e54710f16bae58458c66298aaf69 Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).