Skip to content

MSVC 14.37.32822 does not ship with stl_asan.lib for arm64  #4035

@farzonl

Description

@farzonl

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARM64Related to the ARM64 architectureASanAddress SanitizerbugSomething isn't workingfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions