LibreOffice 3.6.0alpha built on clang

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

A big kudos to Kristian Rietveld for his hard work described here

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

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

2. nss (unix/os_Linux_x86.s asterix as comment character). Also
mentioned by Stephen Bergmann here

3. moz (missing this pointers/default constructor). Mentioned by
Julien2412, Stephen and others.

4. connectivity (typedef for CardPropertyGetter/Setter in
The patch was submitted here

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)

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

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.

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: <>
-------------- 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: <>
-------------- 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: <>

More information about the LibreOffice mailing list