Skip to content

Commit dbb03f8

Browse files
authored
[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.
1 parent 3d0f44f commit dbb03f8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
// The asm hack only works with GCC and Clang.
1818
# if !defined(_WIN32)
1919

20-
asm("memcpy = __sanitizer_internal_memcpy");
21-
asm("memmove = __sanitizer_internal_memmove");
22-
asm("memset = __sanitizer_internal_memset");
20+
asm(R"(
21+
.set memcpy, __sanitizer_internal_memcpy
22+
.set memmove, __sanitizer_internal_memmove
23+
.set memset, __sanitizer_internal_memset
24+
)");
2325

2426
# if defined(__cplusplus) && \
2527
!defined(SANITIZER_COMMON_REDEFINE_BUILTINS_IN_STD)

0 commit comments

Comments
 (0)