Random rants from a KDE user which also works on making KDE more Hebrew friendly.

Sunday, April 10, 2011

Qt + clang = it compiles!

After more than a year I have been compiling Qt with clang, now I can honestly say it compiles and runs. Not only I can bootstrap clang properly, and it compiles the core Qt4, but it also compiles the WebKit module (and runs flash!), I also saw on the console messages about JDK being loaded, so the browser demo seems very functional to me:



I have also tested the browser using the SubSpider test, and I see that the browser is not that slow (QtSDK/64bit from Nokia runs at 360.0ms +/- 2.5%, and the compiled one in 415.4ms +/- 3.6%, Chromium runs at 249.2ms +/- 11.0%).

As a special bonus, I decided to build Qt-Creator. It compiles and works quite good. I assume you can even use the new toolchain to compile applications, even tough that the error messages will not be recognized by the IDE.


I will try to clean up my build scripts so I can publish it online. I am also thinking of releasing the results as a "qt-clang-sdk" or something. Is anyone interested in such thing?

10 comments:

vivo said...

not that slow does not fit so well 15,4% speedup from compile time optimization is a rather big improvement over the clang one

Djuro Drljaca said...

This might be a bit stupid question, but what does this help an "ordinary" developer and user?

Im not saying that you are wasting your time, I'm just curious :)

Unknown said...

I would totally want to try out your build scripts, keep em coming!

Primus said...

So technically KDE might not need gcc as dependancy in future. And AFAIK Clang is better in some things (mainly desktop usage) than gcc.

Unknown said...

@Djuro: clang gives much better error messages and has better code-checking.

ComaWhite said...

I want one, but I cannot wait until you can replace gcc with clang for the whole system.

Unknown said...

Have you seen a better compile times?

Sean said...

I'm pretty stoked about this, and I have to agree with Comawhite. If we can get KDE fully built and supported under Qt-Clang on a FreeBSD system, that would be awesome.

PC-BSD developers ought to keep a close eye on this.

Dave said...

What changes were needed to compile with clang? I was under the impression that it was designed to be 100% compatible with GCC.

Are you compiling with the clang only -O4 flag?

I'm pretty excited about clang.

Robert said...

I'd LOVE to get this working on my system, but compilation bails out with some weird errors about some of the system headers. Any advice/comments you can give would be VERY welcome. :-)