Skip to content

[ASan] Recognize WASI as a platform with 64-bit off_t #144441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kateinoigakukun
Copy link
Member

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

@llvmbot
Copy link
Member

llvmbot commented Jun 16, 2025

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

Author: Yuta Saito (kateinoigakukun)

Changes

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

Copy link

github-actions bot commented Jun 16, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@kateinoigakukun kateinoigakukun force-pushed the pr-2f02c60fca17ae862ac609eaf50aee3d3960b5a9 branch from c90b40d to 1f8561b Compare June 16, 2025 21:59
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.

2 participants