llvm / llvm/llvm-project

Configuring compiler-rt fails when C compiler path contains spaces

Open
#184,407 0 comments 0 reactions 0 assignees View on GitHub
build-problem cmake compiler-rt
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The following error is emitted during configuration:
```
CMake Error at cmake/Modules/CheckSectionExists.cmake:72 (message):
Call Stack (most recent call first):
lib/builtins/CMakeLists.txt:1025 (check_section_exists)
```

This occurs because all spaces in `test_compile_command` are replaced with `;` [here](https://github.com/llvm/llvm-project/blob/6b040b0dee9cb8b38e56dbcb7e51182a62703e05/compiler-rt/cmake/Modules/CheckSectionExists.cmake#L61). It breaks the build with a default installation of LLVM on Windows (install path `C:\Program Files\LLVM`).

Contributor guide

Open the contributing guide

Research direction

Start in compiler-rt/cmake/Modules/CheckSectionExists.cmake around line 61, then follow its call from lib/builtins/CMakeLists.txt:1025. Reproduce configuration with an LLVM installation under C:\Program Files\LLVM and inspect how test_compile_command is handled. Done means configuration completes without the reported error when the compiler path contains spaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system, compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.