Issue 58073
Summary Compilation fails because `CMAKE_CXX_COMPILER_ID` not defined in `CheckProblematicConfigurations.cmake`
Labels new issue
Assignees
Reporter LukeSkyw
    Trying to compile `clang` and `lld` as static executables targeting WebAssembly only (you can copy paste this in `/tmp` for ex):

```bash
LLVM_BRANCH="release/15.x"
FOLDER=`echo llvm-project-${LLVM_BRANCH} | tr '/' '_'`
git clone https://github.com/llvm/llvm-project.git --branch ${LLVM_BRANCH} --single-branch --depth 1 ${FOLDER}
mkdir -p ${FOLDER}/build
cd ${FOLDER}/build

cmake ../llvm -DLLVM_ENABLE_PROJECTS='clang;lld' \
  -DCMAKE_BUILD_TYPE=MinSizeRel \
  -DCMAKE_EXE_LINKER_FLAGS=-static \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -DLLVM_TARGETS_TO_BUILD=WebAssembly \
  -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi'
make -j $(nproc) -i
```
In the phase:
```
[100%] Performing configure step for 'runtimes'
```
compilation fails because `CMAKE_CXX_COMPILER_ID` is not defined in `CheckProblematicConfigurations.cmake`:
```bash
-- Linker detection: GNU ld
CMake Error at /tmp/llvm-project-release_15.x/llvm/cmake/modules/CheckProblematicConfigurations.cmake:14 (if):
  if given arguments:

    "STREQUAL" "MSVC"

  Unknown arguments specified
Call Stack (most recent call first):
  /tmp/llvm-project-release_15.x/llvm/cmake/modules/HandleLLVMOptions.cmake:10 (include)
  CMakeLists.txt:149 (include)
```

My setup:
```bash
:~$ cc --version
cc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

:~$ c++ --version
c++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

:~$ cmake --version
cmake version 3.22.1
~$ python3 --version
Python 3.10.4
```

Compilation goes on for a while before failing so I doubt it is a problem with my system. I'm able to compile `clang` and `lld` without the "runtimes" option. Only when I set the runtimes does a configure stage happens in the middle of the compilation and fails this way.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to