[compiler-rt] [compiler-rt][ASan] Work around msvc cl x64 build warnings (PR #156887)
Zack Johnson via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 4 06:59:51 PDT 2025
https://github.com/zacklj89 created https://github.com/llvm/llvm-project/pull/156887
None
>From 193f7aca560d7b34f35d7cfe453439fb6c26d3fa Mon Sep 17 00:00:00 2001
From: Zack Johnson <zajohnson at microsoft.com>
Date: Thu, 4 Sep 2025 09:50:48 -0400
Subject: [PATCH] [compiler-rt][ASan] Work around msvc cl x64 build warnings
---
compiler-rt/lib/asan/CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt
index 7d07ec765c005..459581fd0cff3 100644
--- a/compiler-rt/lib/asan/CMakeLists.txt
+++ b/compiler-rt/lib/asan/CMakeLists.txt
@@ -108,7 +108,8 @@ set(ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
# Win/ASan relies on the runtime functions being hotpatchable. See
# https://github.com/llvm/llvm-project/pull/149444
-if(MSVC)
+# MSVC cl 64 bit architectures treat /hotpatch as an unknown option
+if(CLANG_CL OR (MSVC AND "i386" IN_LIST ASAN_SUPPORTED_ARCH))
list(APPEND ASAN_CFLAGS /hotpatch)
endif()
More information about the llvm-commits
mailing list