Open glandium opened 2 years ago
> -DCMAKE_CXX_FLAGS=-I$PWD/obj2/include/c++/v1
works around the problem.
Interestingly, adding this on other platforms breaks the build because of missing __config_site
.
Scrap that, that was coming from -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON
can confirm this issue on 10.14 trying to build compiler-rt standalone using
cmake . -B build -DCMAKE_C_COMPILER=/Users/Gagan/.mozbuild/clang/bin/clang -DCMAKE_CXX_COMPILER=/Users/Gagan/.mozbuild/clang/bin/clang+
STR, on a mac with MacOSX11.1.sdk (any SDK < 11.3 should do, alternatively, remove the usr/include/c++ directory from the SDK):
The last command fails with e.g.:
Failures happen in all C++ code in compiler-rt because SDKs before MacOSX11.3.sdk didn't include the C++ headers, and for some reason the
-I${LIBCXX_GENERATED_INCLUDE_DIR}
doesn't make it to the flags for those files, while it makes it for C++ code for e.g. libcxxabi. Interestingly, the dependencies are set correctly for the C++ headers to be generated before the C++ code is compiled, only the-I
flag is missing. Also interestingly, things work properly when doing it all with one cmake invocation using bothLLVM_ENABLE_PROJECTS
andLLVM_ENABLE_RUNTIMES
.-DCMAKE_CXX_FLAGS=-I$PWD/obj2/include/c++/v1
works around the problem.