Details
Diff Detail
Event Timeline
I ran into a similar issue and posted https://github.com/llvm/llvm-project/pull/65517.
I don't think this is the path we want to take. We shouldn't be setting -isysroot manually in these configs, I've always seen it as technical debt that we did. What's your motivation for doing this?
I just did some digging and the reason for setting -isysroot manually in these config files is basically that CMake will resolve clang++ to the result of xcrun --find clang++ when it sets CMAKE_CXX_COMPILER: https://gitlab.kitware.com/cmake/cmake/-/issues/19180. Without this issue, we wouldn't be setting -isysroot manually at all.
We always use the just built Clang (built using the bootstrap build) even on Darwin, which is not recognized by xcrun --find clang, so we need to manually pass -isysroot.
I believe the latest incarnation of https://github.com/llvm/llvm-project/pull/66265 fixes your issues with the bootstrapping build as well. The reason why I want to go down that route instead of doing this patch is that we should aim to *simplify* how the compiler is invoked and make it closer to what end users will do, instead of adding more and more flags to make it do what we want. This is important because we strive to test-as-we-ship as much as we can, to avoid issues where our test suite doesn't really reflect the reality of how users use the library. If you agree that https://github.com/llvm/llvm-project/pull/66265 solves your problem, let's abandon this.