[compiler-rt] dbb03f8 - [compiler-rt] Replace assignment w/.set directive (#107667)

via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 7 13:46:21 PDT 2024


Author: Brian Cain
Date: 2024-09-07T15:46:17-05:00
New Revision: dbb03f8f606e587e981fc5f9393283828e30907a

URL: https://github.com/llvm/llvm-project/commit/dbb03f8f606e587e981fc5f9393283828e30907a
DIFF: https://github.com/llvm/llvm-project/commit/dbb03f8f606e587e981fc5f9393283828e30907a.diff

LOG: [compiler-rt] Replace assignment w/.set directive (#107667)

These assignment statements are rejected by `llvm-mc --triple=hexagon`,
likely because the syntax so strongly resembles hexagon asm mnemonics.

The statements were being normalized by llvm-mc into `.set` directives
for most architectures, so I assume that this change is a portable one.

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h b/compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h
index d24b179ef320c1..41e0613d6fc138 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h
@@ -17,9 +17,11 @@
 // The asm hack only works with GCC and Clang.
 #    if !defined(_WIN32)
 
-asm("memcpy = __sanitizer_internal_memcpy");
-asm("memmove = __sanitizer_internal_memmove");
-asm("memset = __sanitizer_internal_memset");
+asm(R"(
+    .set memcpy, __sanitizer_internal_memcpy
+    .set memmove, __sanitizer_internal_memmove
+    .set memset, __sanitizer_internal_memset
+    )");
 
 #      if defined(__cplusplus) && \
           !defined(SANITIZER_COMMON_REDEFINE_BUILTINS_IN_STD)


        


More information about the llvm-commits mailing list