[LLVMdev] Living on Clang

Douglas Gregor dgregor at apple.com
Mon Apr 19 15:42:53 PDT 2010


On Apr 19, 2010, at 2:52 AM, Diego Iastrubni wrote:

> How about building this in the CMake or auto* level we build a separate build script for it? I attache a simple version here. It does seem to work here. It's a shell script, which uses cmake for the building but it seems the second stage file works. I am not really sure why a third stage is needed, but it can be added quite easily. A windows version should be trivial to write (next week).

We can do this with a script, although it would be more convenient if it were a part of the build system itself. Regarding the script itself...

mkdir -p bootstrap-stage-1
cd    bootstrap-stage-1
cmake -DVARIABLE:CMAKE_BUILD_TYPE=release ../
make VERBOSE=1
cd ..

Your CMake command-line syntax is wrong. To set CMAKE_BUILD_TYPE to Release, use

cmake -DCMAKE_BUILD_TYPE:STRING=Release ../

> A few rants about clang:
> This is the first time I was able to bootstrap the whole compiler. Which is great, don't get me wrong. But it was painfully slow, and the CPU of my machine became *really* hot unlike with gcc. The whole building process took more then 4 hours on this old cual core machine, while stage one took an hour more or less (I need to do a test again, without ccache).

That's what happens when you use an unoptimized Clang to build Clang :) Your mis-typed setting of CMAKE_BUILD_TYPE meant that the first stage built a debug Clang. I'm sure things will go better when you turn optimization on.

	- Doug



More information about the llvm-dev mailing list