Skip to content

Conversation

@pirama-arumuga-nainar
Copy link
Collaborator

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

Musl has 64-bit off_t by default and has macros that redefine
[f]truncate64 to [f]truncate.
@llvmbot
Copy link
Member

llvmbot commented Feb 28, 2025

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

Author: None (pirama-arumuga-nainar)

Changes

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

@pirama-arumuga-nainar pirama-arumuga-nainar merged commit 5cf9435 into llvm:main Feb 28, 2025
13 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