LibreOffice 3.6.0alpha built on clang

Khoo Wei Ming weimzz at gmail.com
Sun Feb 19 09:59:46 PST 2012


A big kudos to Kristian Rietveld for his hard work described here
http://wiki.documentfoundation.org/Development/Building_LibreOffice_with_Clang

So for what it's worth, here's the route I took (by no means ideal). I
built LibO 3.6.0alpha using clang 3.1 on Ubuntu 11.04 Natty 32 bits
and

./autogen.sh CC=clang CXX=clang++

It built eventually, but barely. I was even surprised that it executed
successfully too.

The main modifications I made were
1. stlport (stl/_locale.h new operator unrecognised). This was
addressed by August Sodora (4th patch) here, although I patched it
differently.
http://lists.freedesktop.org/archives/libreoffice/2012-January/023182.html

2. nss (unix/os_Linux_x86.s asterix as comment character). Also
mentioned by Stephen Bergmann here
http://lists.freedesktop.org/archives/libreoffice/2012-January/023189.html

3. moz (missing this pointers/default constructor). Mentioned by
Julien2412, Stephen and others.
http://lists.freedesktop.org/archives/libreoffice/2012-February/025966.html

4. connectivity (typedef for CardPropertyGetter/Setter in
connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx).
The patch was submitted here
http://lists.freedesktop.org/archives/libreoffice/2012-February/026435.html

Other issues.
5. cairo (disable mutexes). Julien ran into this, I decided to simply
disable multi-threading in cairo (not too clear what this has to do
with clang though)
http://lists.freedesktop.org/archives/libreoffice/2012-February/026195.html

6. incompatible -std=c++0x option. Not sure what the deal is here, but
I gather there's some discrepancy between what gcc and clang
understand is the "standard C++ library(tm)".

7. Macros in sw are broken in the clang-build it seems. Yet to figure out why.

8. There was a bug which I attribute to clang. The
warn_attribute_not_on_decl diagnostic was defined as an error instead
of a warning. I can't remember when it comes up, but error message
contained the phrase "... attribute ignored when parsing type ...".

9. I'm not sure why I didn't run into the -fvisibility=hidden bug
discovered by Stephen. I suspect this flag has been made optional(?).
The bug is here
http://llvm.org/bugs/show_bug.cgi?id=11250

Future plans
I plan to try out the clang static analyzer, and if I survive that
maybe I'll give KLEE a go.

Apologies for the lengthy post.

Regards,
Wei Ming
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-stlport-stl-_locale.h-new-operator-unrecognized.patch
Type: text/x-patch
Size: 1684 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120219/1114ce4c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-nss-unix-os_Linux_x86.s-asterix-as-comment-character.patch
Type: text/x-patch
Size: 7666 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120219/1114ce4c/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-moz-missing-this-pointers-default-constructor.patch
Type: text/x-patch
Size: 4623 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120219/1114ce4c/attachment-0002.bin>


More information about the LibreOffice mailing list