[compiler-rt] [ASan] Recognize WASI as a platform with 64-bit off_t (PR #144441)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 16 14:55:56 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

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

Author: Yuta Saito (kateinoigakukun)

<details>
<summary>Changes</summary>

WASI defines `off_t` as 64-bit signed integers to support files larger than 2 GiB. https://github.com/WebAssembly/wasi-libc/blob/wasi-sdk-25/libc-bottom-half/headers/public/__typedef_off_t.h

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


1 Files Affected:

- (modified) compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h (+2-1) 


``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index fff60c96f632f..5a5d44e7f895e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -190,7 +190,8 @@ typedef int pid_t;
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_APPLE ||             \
     (SANITIZER_SOLARIS && (defined(_LP64) || _FILE_OFFSET_BITS == 64)) || \
     (SANITIZER_LINUX && !SANITIZER_GLIBC && !SANITIZER_ANDROID) ||        \
-    (SANITIZER_LINUX && (defined(__x86_64__) || defined(__hexagon__)))
+    (SANITIZER_LINUX && (defined(__x86_64__) || defined(__hexagon__))) || \
+    SANITIZER_WASI
 typedef u64 OFF_T;
 #else
 typedef uptr OFF_T;

``````````

</details>


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


More information about the llvm-commits mailing list