[compiler-rt] Changes to support running tests for Windows arm64 asan (PR #66973)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 05:00:02 PST 2023


================
@@ -260,6 +260,14 @@
 #  define SANITIZER_ARM64 0
 #endif
 
+#if SANITIZER_WINDOWS64 && SANITIZER_ARM64
+#  define SANITIZER_WINDOWS_ARM64 1
+#  define SANITIZER_WINDOWS_x64 0
+#else
+#  define SANITIZER_WINDOWS_ARM64 0
+#  define SANITIZER_WINDOWS_x64 1
----------------
mstorsjo wrote:

This broke ASAN on Windows/i386. This is within a generic context, and doing `#define SANITIZER_WINDOWS_x64 1` if `#if SANITIZER_WINDOWS64 && SANITIZER_ARM64` doesn't hold, means that `SANITIZER_WINDOWS_x64` gets enabled everywhere, on every platform, except for windows/arm64. This probably has little effect outside of `interception_win.cpp` though, which means that it breaks things for all windows architectures other than x86_64 and aarch64.

It's simple to fix though, e.g. like this:
```diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
index 49d8a67cc12d..34baf1bea58b 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -260,13 +260,18 @@
 #  define SANITIZER_ARM64 0
 #endif

-#if SANITIZER_WINDOWS64 && SANITIZER_ARM64
+#if SANITIZER_WINDOWS64
+#if SANITIZER_ARM64
 #  define SANITIZER_WINDOWS_ARM64 1
 #  define SANITIZER_WINDOWS_x64 0
 #else
 #  define SANITIZER_WINDOWS_ARM64 0
 #  define SANITIZER_WINDOWS_x64 1
 #endif
+#else
+#  define SANITIZER_WINDOWS_ARM64 0
+#  define SANITIZER_WINDOWS_x64 0
+#endif

 #if SANITIZER_SOLARIS && SANITIZER_WORDSIZE == 32
 #  define SANITIZER_SOLARIS32 1

```

Do people prefer me to revert this commit and you can redo it, or for me to just push this fix? (I can push either a revert or a fix later today.)

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


More information about the llvm-commits mailing list