]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libsanitizer: Restore local sanitizer_redefine_builtins.h patch
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 10 Dec 2025 08:24:53 +0000 (09:24 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 10 Dec 2025 08:24:53 +0000 (09:24 +0100)
The recent libsanitizer update broke the Solaris/SPARC build with the
native assembler: many files don't compile any longer like

/usr/bin/as: "/var/tmp//ccYsT60a.s", line 5: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 5: error: statement syntax
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 6: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 6: error: statement syntax
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 7: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 7: error: statement syntax

This happens because sanitizer_common/sanitizer_redefine_builtins.h lost
a local patch that guards use of .set in asm by HAVE_AS_SYM_ASSIGN.
This patch restores that patch.

Although the Darwin assembler accepts .set (thus HAVE_AS_SYM_ASSIGN is
defined), the __APPLE__ guard is kept to guard against the link failures
that prompted its upstreadm addition in LLVM commit

commit cfdbbb8fcc62f75dcf0b251dfab63353f3921227
Author: Dan Blackwell <dan_blackwell@apple.com>
Date:   Fri Aug 15 09:13:26 2025 +0100

    [sanitizer_common] Disable sanitizer_redefine_builtins on Apple platforms (#153381)

even though they didn't happen in the GCC build.

It also keeps the _AIX guard due to LLVM commit

commit d7c6cad744bc7ed28535dc6f75629902eda559ea
Author: Jake Egan <Jake.egan@ibm.com>
Date:   Wed Jun 11 20:22:15 2025 -0400

    [sanitizer_common] Implement interception on AIX (#138606)

Bootstrapped without regressions on sparc-sun-solaris2.11 with gas and
as, i386-pc-solaris2.11, x86_64-pc-linux-gnu, and
x86_64-apple-darwin25.1.0.

libsanitizer/sanitizer_common/sanitizer_redefine_builtins.h

index 7d889111765775aed6cd64afd229b8543f0e81ed..26f4b48e4fd2d19b57b86997cc86b0b1ea982d75 100644 (file)
@@ -15,7 +15,8 @@
 #    define SANITIZER_REDEFINE_BUILTINS_H
 
 // The asm hack only works with GCC and Clang.
-#    if !defined(_WIN32) && !defined(_AIX) && !defined(__APPLE__)
+#if !defined(_WIN32) && !defined(_AIX) && !defined(__APPLE__) &&               \
+    defined(HAVE_AS_SYM_ASSIGN)
 
 asm(R"(
     .set memcpy, __sanitizer_internal_memcpy