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

Saturday, April 16, 2011

clang+Qt+QtCreator binary package - compiled with clang alpha1

To continue what I did last week today I uploaded to GoogleCode (I have a working project there, but not abusing it...?) a snapshot build of clang (trunk) Qt (master) and QtCreator (master). The code was pulled around 2AM (GMT+3), a really random time stamp.

The script I used (which is included in the tarball) first compiles clang using the native compiler, then it compiles clang again using the first generation compiler (2 stage bootstrap), then it compile Qt with the 2nd stage compiler and finally QtCreator with Qt/clang. All compilations are done out of source, and clang/llvm is compiled using "cmake" and not "configure". Someone asked last week what changes are needed to compile this beast, the answer is none, it all compiles out of the box.

A few notes:
  1. I added a script which sets up the environment variables for this beast to work (LD_LIBRARY_PATH, PATH). You get a shell working, from which you can call the new "qmake" and "clang" commands, as well as running the QtCreator.
  2. The build is 64bit linux only, it was built on Ubuntu 10.10, but I think it should run on every modern linux distro. I will try to build 32bit builds in the future.
  3. The code east  kittens, tested very briefly for 20 seconds.Not recommended at all.
  4. The code has been pulled from the corresponding SCM at random times, so it's possible that clang is borked, Qt is borked or CtCreator is borked. Be warned - it is not supposed to work :)
  5. QtCreator picks the correct qmake (the clang bootstrapped) by default. However, even if it picks the correct mkspec, it will not really work as you expect, as QtCreator does not know (yet?) how to parse the output of clang. It should compile your applications though.
  6. The tarball contains the build script, and also the full build log - ~26mb long. If you are interested in re-produce this, look at the script and the output. Contact me for more details, I am available sometimes in IRC (#qt, -> cuco) or email (elcuco -> kde, diegoiast -> gmail)
Again, I cannot stress this enough - this build is very experimental, and not recommended. But still, if you are interested - here is the download link: http://code.google.com/p/qtedit4/downloads/detail?name=qtsdk-clang-amd64-alpha1.tar.xz

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?