llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.8k stars 11.91k forks source link

[libcxx] cannot build with clang++ --target=x86_64-windows-msvc #114591

Open trcrsired opened 2 hours ago

trcrsired commented 2 hours ago

hello, No known features for the CXX compiler. What's going on?

-- Performing Test CXX_SUPPORTS_WNO_ERROR_FLAG
-- Performing Test CXX_SUPPORTS_WNO_ERROR_FLAG - Failed
-- Performing Test CXX_SUPPORTS_EHSC_FLAG
-- Performing Test CXX_SUPPORTS_EHSC_FLAG - Failed
-- Configuring done (11.3s)
CMake Error in /home/csrg/toolchains_build/llvm-project/libcxx/src/CMakeLists.txt:
  No known features for CXX compiler

  "Clang"

  version 20.0.0.

CMake Generate step failed.  Build files cannot be regenerated correctly.
runtimesconfigure build failure
trcrsired commented 2 hours ago
-- Could NOT find LLVM (missing: LLVM_DIR)
-- Could NOT find Clang (missing: Clang_DIR)
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
-- Configuring for clang-cl
-- Using libc++ testing configuration: /home/csrg/toolchains_build/llvm-project/libcxx/test/configs/llvm-libc++-shared-clangcl.cfg.in
-- Configuring done (0.2s)
CMake Error in /home/csrg/toolchains_build/llvm-project/libcxx/src/CMakeLists.txt:
  No known features for CXX compiler

  "Clang"

  version 20.0.0.

clang-cl isn't correct since I am cross compiling on linux with just normal clang

trcrsired commented 1 hour ago

@ldionne

trcrsired commented 1 hour ago
clang: error: no such file or directory: '/clang:--target=x86_64-unknown-linux-gnu'
clang: error: no such file or directory: '/clang:-print-target-triple'
clang: error: no input files
CMake Warning at CMakeLists.txt:201 (message):
  Failed to execute
  `/home/csrg/toolchains/llvm/x86_64-generic-linux-gnu/llvm/bin/clang
  /clang:--target=x86_64-unknown-linux-gnu /clang:-print-target-triple` to
  normalize target triple.

-- Configuring for clang-cl
trcrsired commented 1 hour ago
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 830165c799c2..28050c03fc3e 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -185,7 +185,7 @@ set(LLVM_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")

 if(CMAKE_C_COMPILER_ID MATCHES "Clang")
   set(option_prefix "")
-  if (CMAKE_C_SIMULATE_ID MATCHES "MSVC")
+  if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT MATCHES "MSVC")
     set(option_prefix "/clang:")
   endif()
   set(print_target_triple ${CMAKE_C_COMPILER} ${option_prefix}--target=${LLVM_DEFAULT_TARGET_TRIPLE} ${option_prefix}-print-target-triple)

I think this should be CMAKE_CXX_COMPILER_FRONTEND_VARIANT right?