Bootstrapping clang

I'd like to try to bootstrap a native build of clang using the instructions at Advanced Build Configurations — LLVM 16.0.0git documentation. From what I read, it seems to take care of the bootstrap without manually invoking each step explicitly, as I've been doing.

It's not clear to me if it assumes a normal build before, the first stage, without using any cmake cache file or not. I attempted using the cmake cache files clang/cmake/caches/DistributionExample{,-stage2}.cmake, but the resulting clang does not use the run-times, even after trying to tweak them a little.

Is there any primer on how to bootstrap clang this way? or any pointer would do, actually.

Thank you,

Hi Evandro,

Sorry for my delay in responding.

When you start building the runtime libraries as part of your distribution things start to get complex very quickly, but we do have some in-tree examples that can lead the way. The Fuchsia CMake cache files in the clang directory are probably the best starting point.

In my experience building your first stage as a pretty straight forward release build is usually the best bet. Spending too much time optimizing the compiler that you're just going to throw away doesn't seem to pay off in the bootstrap build cycle.

Hope this gets you going in the right direction.

-Chris