Skip to content

LLVM can't build against LLVM and Ninja on Windows #146313

Open
@sucicf1

Description

@sucicf1

I have the following toolchain file:

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR AMD64)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(CMAKE_C_COMPILER "D:/Program Files/llvm-20.1.7-x86_64-pc-windows-msvc/bin/clang.exe")
set(CMAKE_CXX_COMPILER "D:/Program Files/llvm-20.1.7-x86_64-pc-windows-msvc/bin/clang++.exe")
set(LLVM_USE_LINKER lld)
set(CMAKE_RC_COMPILER "D:/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe")

And than I use the following command:

cmake -GNinja -DLLVM_ENABLE_PROJECTS="lld;clang;lldb;" -DCMAKE_BUILD_TYPE=Release -DLLVM_HOST_TRIPLE="x86_64-pc-windows" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-pc-windows" -DCMAKE_INSTALL_PREFIX="D:/Program Files/LLVMMy" -S llvm -B ..\llvmMy -DCMAKE_TOOLCHAIN_FILE="E:/repos/llvm-project/myToolChain.cmake"

I execute the command cmake --build .
and get the following error:

In file included from E:/repos/llvm-project/llvm/include\llvm/ADT/ArrayRef.h:13:
E:/repos/llvm-project/llvm/include\llvm/ADT/SmallVector.h:564:5: error: reference to 'memcpy' is ambiguous
564 | memcpy(reinterpret_cast<void >(this->end()), EltPtr, sizeof(T));
| ^
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include\vcruntime_string.h:43:15: note: candidate found by name lookup is 'memcpy'
43 | void
__cdecl memcpy(
| ^
E:/repos/llvmMy/include\llvm/IR/RuntimeLibcalls.inc:2461:3: note: candidate found by name lookup is 'llvm::RTLIB::memcpy'
2461 | memcpy = 1688, // memcpy
| ^
3 warnings and 4 errors generated.

What am I doing wrong or is this a bug?

Thank you.

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