[cfe-dev] [LLVMdev] Living on Clang

Óscar Fuentes ofv at wanadoo.es
Mon Apr 19 06:52:18 PDT 2010

Diego Iastrubni <diegoiast at gmail.com>

> How about building this in the CMake or auto* level we build a separate
> build script for it?

I was thinking along the same lines, although a cmake script will do
too, the only tricky point being the special syntax required for
executing 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.

The third stage is for comparing the output of clang (as compiled by
gcc) against clang (as compiled by clang). The whole process is:

Stage 1: build clang with gcc

Stage 2: build clang with the clang created by gcc

Stage 3: build clang with the clang created by clang.

Final test: compare the object files geneated on Stage 2 with the object
files generated on Stage 3.

The last step is useful for detecting bugs on clang (and on gcc).

> A windows version should be trivial to write (next week).

Comparing the object files on Windows may be tricky, because IIRC they
contain timestamps.

> 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).

Building llvm+clang requires less than 10 minutes here with an Intel
Q6600, Linux x86_64.

More information about the cfe-dev mailing list