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 <[email protected]>
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 <[email protected]>
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.

Pre-approved by Jakub, committed to trunk.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2025-12-07  Rainer Orth  <[email protected]>

        libsanitizer:
        * sanitizer_common/sanitizer_redefine_builtins.h: Add
        HAVE_AS_SYM_ASSIGN guard.

# HG changeset patch
# Parent  6352233f535162d6c9fa164e5e148105cce98f34
libsanitizer: Restore local sanitizer_redefine_builtins.h patch

diff --git a/libsanitizer/sanitizer_common/sanitizer_redefine_builtins.h b/libsanitizer/sanitizer_common/sanitizer_redefine_builtins.h
--- a/libsanitizer/sanitizer_common/sanitizer_redefine_builtins.h
+++ b/libsanitizer/sanitizer_common/sanitizer_redefine_builtins.h
@@ -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

Reply via email to