diff --git a/0039-libsanitizer-Fixup-pr59063-2-link-error.patch b/0039-libsanitizer-Fixup-pr59063-2-link-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..77dd9c4c9a65d381916a4d84516cedd87dd38da1 --- /dev/null +++ b/0039-libsanitizer-Fixup-pr59063-2-link-error.patch @@ -0,0 +1,32 @@ +From c2cb368a2df815c7bde675c87eeee4c78c635d91 Mon Sep 17 00:00:00 2001 +From: XingLi +Date: Fri, 6 Jan 2023 16:43:30 +0800 +Subject: [PATCH] libsanitizer: Fixup pr59063-2 link error + +undefined reference to __cxa_guard_acquire and __cxa_guard_release +occured when linking, backport upstream modification for GetAltStackSize +--- + 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 ac88fbe07..44359b3d1 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() { +-- +2.33.0 + diff --git a/gcc.spec b/gcc.spec index e9a81ec9e19fe78848c3d6a8c7f69f3395f98439..afbd8a96de76cfe0bfcf4445b5af3f93b0987a35 100644 --- a/gcc.spec +++ b/gcc.spec @@ -61,7 +61,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: 12 +Release: 13 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD URL: https://gcc.gnu.org @@ -155,6 +155,7 @@ Patch35: 0035-lra-clear-lra_insn_recog_data-after-simplifying-a-me.patch Patch36: 0036-Add-LoongArch-ABI-2.01-support.patch Patch37: 0037-Testsuite-Mark-check_effective_target_exceptions_ena.patch Patch38: 0038-libsanitizer-Add-LoongArch-support.patch +Patch39: 0039-libsanitizer-Fixup-pr59063-2-link-error.patch %endif %global gcc_target_platform %{_arch}-linux-gnu @@ -636,6 +637,7 @@ not stable, so plugins must be rebuilt any time GCC is updated. %patch36 -p1 %patch37 -p1 %patch38 -p1 +%patch39 -p1 %endif @@ -2610,6 +2612,12 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Fri Jan 6 2023 lixing - 10.3.1-13 +- Type:Sync +- ID:NA +- SUG:NA +- DESC:Fixup pr59063-2 link error + * Mon Dec 19 2022 lixing - 10.3.1-12 - Type:Sync - ID:NA