Today I’m fighting the annoying fight. Sometimes I get the feeling the fight is to get Qt 4.4 to compile with all the bits on OpenSolaris in spite of Trolltech. An interesting string snuck into Qt 4.4’s configure with some recent qt-copy update, as it now says in the help message:<blockquote>WebKit is built if a decent C++ compiler is used.</blockquote>Something similar applies to phonon. Fortunately the command-line arguments to configure can be used to work around this (add -phonon and -webkit), but the definition of “decent compiler” is kind of weak.

I do realize that “Sun Studio 12 with stdcxx and the flags used by the KDE-Solaris team” is hard to test for. And since I ported WebKit to Sun’s ancient Cstd STL earlier this week, I know what kind of ugly patches would be needed to support the indecent combination of Studio with Cstd. So I don’t blame anyone, just annoyed to get the build broken like that all of a sudden.

Remember, punch your pillow, not the wall. Actually, I’ll just try to whomp someone over the head with a pillow, that always makes me feel better (where is that picture of me in a pillow fight with some GNOME folk?). So here’s some patches and explanation (is that pillow talk, then?):

One thing that always bites with Studio 12 is the way a const T is different from a T (and this is reflected in the name mangling, too). In particular, this means that declaring a method with a const T parameter and implementing it without the const gives you linking errors. Eventually, anyway. From a practical types unification point of view I think the distinction is useful and necessary, and it annoys the heck out of me that gcc ignores it. I hear there are long discussions about it on -core-devel, too. In any case, CLucene and Patternist suffer from this kind of little thing (as does WebKit and other places, but these two patches illustrate quite well and are self-contained).

Studio 12 can be quite stupid (or quite strict, depending on your interpretation) about disambiguation. Within WebKit, there’s ample opportunity for confusion between String and QString, and Studio 12 just can’t figure out what makes sense when adding a const char * to strings (either String or QString) with operator +. Patch adds explicit String() constructors all over; kind of ugly so not providing a separate link.

Strict math implementations don’t give you isfinite() in C++ because isfinite() is c99 and C++ is based off the c98 standard (approximately; I don’t feel like looking up the details again). Signbit is similarly missing. Fortunately we had this kind of fixes in kdelibs already, so coming up with them wasn’t hard. JavaScriptCore suffers from this. Messy patch includes <ieeefp.h> and more such, no separate link.

I’m not sure if <cstdio> is supposed to do using std::fprintf; mine doesn’t, leading to help generator patches as well.

There’s more patches, some fugly just to get the job done, some almost acceptable as is; they can be checked out of KDE-Solaris SVN as they evolve. I just got one patch in from Paul F. dealing with qatomic – it seems that gcc and icc get to use qatomic.cpp and everyone else shouldn’t, but the logic in the .pri files isn’t quite right. But we’re getting there: I have Qt 4.4 designer up and running and now waiting for the next recompile (slow on a single core machine) to see if all the demos will work.

The Wayback Machine does not archive everything. Broken image links are marked with a 💔.