Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 7, 2024

Conversation

androm3da
Copy link
Member

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.

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.
@llvmbot
Copy link
Member

llvmbot commented Sep 7, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Brian Cain (androm3da)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/107667.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h (+5-3)
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)

@androm3da androm3da merged commit dbb03f8 into llvm:main Sep 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants