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

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 14:18:40 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

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

Author: None (pirama-arumuga-nainar)

<details>
<summary>Changes</summary>

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

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


1 Files Affected:

- (modified) compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp (+1-1) 


``````````diff
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);

``````````

</details>


https://github.com/llvm/llvm-project/pull/129331


More information about the llvm-commits mailing list