[compiler-rt] 5cf9435 - [compiler-rt][rtsan] Do not intercept [f]truncate64 for musl (#129331)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 15:08:09 PST 2025


Author: pirama-arumuga-nainar
Date: 2025-02-28T15:08:06-08:00
New Revision: 5cf9435fd4e7ab0a27ba514557e0982f9c882bc0

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

LOG: [compiler-rt][rtsan] Do not intercept [f]truncate64 for musl (#129331)

Musl has 64-bit off_t by default and has macros that redefine
[f]truncate64 to [f]truncate.

Added: 
    

Modified: 
    compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index d41af795db724..cd57107450a47 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -295,7 +295,7 @@ INTERCEPTOR(int, ftruncate, int fd, off_t length) {
   return REAL(ftruncate)(fd, length);
 }
 
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_MUSL
 INTERCEPTOR(int, truncate64, const char *pathname, off64_t length) {
   __rtsan_notify_intercepted_call("truncate64");
   return REAL(truncate64)(pathname, length);


        


More information about the llvm-commits mailing list