Skip to content

[MSVC] LLVM failed to build when I do the cross-compiling and the target architecture is ARM64EC #100335

@Zhaojun-Liu

Description

@Zhaojun-Liu

Hi: when I use msvc to cross compile LLVM, the host is amd64 and the target is ARM64EC, it failed, can you help take a look? Thanks.

Repro steps:

  1. Open a VS2022 x64 command prompt
  2. git clone https://github.com/llvm/llvm-project C:\gitP\llvm\llvm-project
  3. mkdir C:\gitP\llvm\llvm-project\build_arm64ec & cd /d C:\gitP\llvm\llvm-project\build_arm64ec
  4. cmake -G "Visual Studio 17 2022" -A ARM64EC -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DLLVM_ENABLE_PROJECTS="clang" ..\llvm
  5. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64
  6. msbuild /m /p:Platform=ARM64EC /p:Configuration=RelWithDebInfo /p:PreferredToolArchitecture=x64 LLVM.sln /t:Rebuild

follow the above steps, it failed with a lot of errors, like error MSB8066 and LLVMSupport.lib(blake3_sse41_x86-64_windows_msvc.obj) : fatal error LNK1372: hybrid map entry target function 'llvm_blake3_compress_in_place_sse41' is not 4-byte aligned , you can see the detailed log:
Build (2).log

Note:
The above results are what I added 3 lines like below before https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/DebugInfo/CodeView/CodeView.h#L76, otherwise, follow the above repro steps, it would fail due to C:\gitP\llvm\llvm-project\llvm\include\llvm\DebugInfo\CodeView\CodeView.h(137,3): error C2143: syntax error: missing '}' before 'constant', you can check the detailed logs:
Build (1).log

#if ARM64EC
#undef ARM64EC
#endif

The commit of LLVM I used is 0af448b

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions