Describe the bug
When trying to build compiler rt test cases on windows I am getting the following linker error:
LINK : fatal error LNK1104: cannot open file 'stl_asan.lib'
I reported the bug to llvm, but the fix likely needs to come from MSVC to provide a stl_asan.lib for arm64.
llvm/llvm-project#66600
Without stl_asan.lib you can't build compiler_rt test cases using COMPILER_RT_INCLUDE_TESTS.
These test cases are important to validate a port of sanitzers for winodws arm64.
Command-line test case
cmake -GNinja -DLLVM_ENABLE_PROJECTS=llvm;compiler-rt -DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PDB=ON -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_TARGETS_TO_BUILD=AArch64 \
-DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe \
-DCOMPILER_RT_INCLUDE_TESTS=TRUE -DCMAKE_LINKER=lld-link.exe \
-S llvm-project\llvm -B compiler-rt_build
cd llvm_build
ninja
ninja check-all
Possible solutions
for arm64 set: _DISABLE_STRING_ANNOTATION and _DISABLE_VECTOR_ANNOTATION
|
#if !defined(_M_CEE_PURE) && !(defined(_DISABLE_STRING_ANNOTATION) && defined(_DISABLE_VECTOR_ANNOTATION)) |
or remove
defined(_M_ARM64) so that we don't try to invoke the linker for asan on windows arm64
|
#elif defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64) |
Describe the bug
When trying to build compiler rt test cases on windows I am getting the following linker error:
I reported the bug to llvm, but the fix likely needs to come from MSVC to provide a
stl_asan.libfor arm64.llvm/llvm-project#66600
Without
stl_asan.libyou can't build compiler_rt test cases usingCOMPILER_RT_INCLUDE_TESTS.These test cases are important to validate a port of sanitzers for winodws arm64.
Command-line test case
Possible solutions
for arm64 set:
_DISABLE_STRING_ANNOTATIONand_DISABLE_VECTOR_ANNOTATIONSTL/stl/inc/__msvc_sanitizer_annotate_container.hpp
Line 18 in 8f67ece
or remove
defined(_M_ARM64)so that we don't try to invoke the linker for asan on windows arm64STL/stl/inc/__msvc_sanitizer_annotate_container.hpp
Line 115 in 8f67ece