Issue 146313
Summary LLVM can't build against LLVM and Ninja on Windows
Labels new issue
Assignees
Reporter 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.

If I add in my toolchain the following 

> set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR AMD64)

it get pass the problematic point.

What am I doing wrong or is this a bug?

Thank you.


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to