-
Notifications
You must be signed in to change notification settings - Fork 14k
[ASan] Recognize WASI platform in sanitizer_platform.h #139017
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
[ASan] Recognize WASI platform in sanitizer_platform.h #139017
Conversation
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Yuta Saito (kateinoigakukun) ChangesThe groundwork for upcoming WASI support. Full diff: https://github.com/llvm/llvm-project/pull/139017.diff 1 Files Affected:
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
index 9f5f41cd85514..0a116da0d895b 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -14,7 +14,8 @@
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
!defined(__APPLE__) && !defined(_WIN32) && !defined(__Fuchsia__) && \
- !(defined(__sun__) && defined(__svr4__)) && !defined(__HAIKU__)
+ !(defined(__sun__) && defined(__svr4__)) && !defined(__HAIKU__) && \
+ !defined(__wasi__)
# error "This operating system is not supported"
#endif
@@ -61,6 +62,12 @@
# define SANITIZER_HAIKU 0
#endif
+#if defined(__wasi__)
+# define SANITIZER_WASI 1
+#else
+# define SANITIZER_WASI 0
+#endif
+
// - SANITIZER_APPLE: all Apple code
// - TARGET_OS_OSX: macOS
// - SANITIZER_IOS: devices (iOS and iOS-like)
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
74b640e
to
8d1bd7d
Compare
/cc @sunfishcode @sbc100 |
Yeah, I think we can share a few things about shadow memory mapping. If you're happy, I can upstream a part of the Emscripten stuff at the same time later. |
Sounds good to me (also /cc @aheejin). |
While this is a very platform-scoped change, I'd like to have explicit approval before landing. Would someone give approval on this? |
Thanks! |
We are working porting ASan to Wasm/WASI (not Emscripten). This is the groundwork for upcoming WASI support in ASan runtime library.