[compiler-rt] [ASan] Recognize WASI as a platform with 64-bit off_t (PR #144441)
Yuta Saito via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 16 14:55:28 PDT 2025
https://github.com/kateinoigakukun created https://github.com/llvm/llvm-project/pull/144441
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
>From c90b40da2593e413370b91de6b168ee72ee809d4 Mon Sep 17 00:00:00 2001
From: Yuta Saito <kateinoigakukun at gmail.com>
Date: Wed, 7 May 2025 18:11:45 +0800
Subject: [PATCH] [ASan] Recognize WASI as a platform with 64-bit off_t
https://github.com/WebAssembly/wasi-libc/blob/wasi-sdk-25/libc-bottom-half/headers/public/__typedef_off_t.h
---
compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
More information about the llvm-commits
mailing list