Issue 174701
Summary OpenMP configured as runtime breaks CLANG_DEFAULT_CXX_STDLIB=libc++ build
Labels libc++
Assignees
Reporter pkl97
    When compiling clang like this, the build terminates during compiling of binaries in directory llvm-project/openmp/tools/omptest/src.

```
cmake -G "Ninja" \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=install \
	-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;lldb;polly" \
	-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind;openmp" \
	-DCLANG_DEFAULT_CXX_STDLIB=libc++ \
	-DCLANG_DEFAULT_LINKER=lld \
	-DLLVM_BUILD_LLVM_DYLIB=ON \
	-DLLVM_ENABLE_EH=ON \
	-DLLVM_ENABLE_RTTI=ON \
	-DLLVM_LINK_LLVM_DYLIB=ON \
	-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
	-DCOMPILER_RT_USE_LLVM_UNWINDER=OFF \
	../llvm-project/llvm

cmake --build . --verbose > output_compile.txt 2>&1
```

This is the output of the compile run:
[output_compile.txt](https://github.com/user-attachments/files/24465191/output_compile.txt)

The error messages indicate that libc++ header files are needed but not found:
```
llvm-binaries/bin/../include/c++/v1/cctype:45:5: error: <cctype> tried including <ctype.h> but didn't find libc++'s <ctype.h> header.
 This usually means that your header search paths are not configured properly.
           The header search paths should contain the C++ Standard Library headers before
           any C Standard Library.
142    45 | # error <cctype> tried including <ctype.h> but didn't find libc++'s <ctype.h> header. \
143       |     ^
```

It turns out that CLANG_DEFAULT_CXX_STDLIB=libc++ triggers the problem. If this switch is removed then clang compiles fine.
However we need a clang version that by default picks libc++ as its C++ Standard Library.

The problem occurs since "openmp" had to be moved from LLVM_ENABLE_PROJECTS to LLVM_ENABLE_RUNTIMES.

Is this kind of build no longer supported or is this behavior a bug?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to