[Libreoffice] [PATCH] fixing some errors when building with clang on linux

August Sodora augsod at gmail.com
Mon Jan 2 11:11:48 PST 2012


Hello all,

For the past couple of weeks I've been trying to build LO with clang
on linux and have hit a couple of obstacles. I can't get the internal
nss to build and I didn't even try to enable mozilla because it fails
to build on ubuntu anyway. The -Qunused-arguments is really to silence
warnings from clang that -ggdb2 and other options are not recognized.
Ultimately, I can complete make with

./autogen.sh --with-jdk-home=/usr/lib/jvm/java-1.6.0-openjdk
--disable-mozilla --with-system-nss --with-max-jobs=1
--with-num-cpus=1 CC="clang -Qunused-arguments" CXX="clang++
-Qunused-arguments"

The max-jobs and num-cpus options are because customshapepresests*.cxx
take up too much memory for me to run in parallel :(

The first patch attached fixes an error related to implicitly
converting constants to a type that should be too small to hold the
constant. I've added static_casts to make the situation a lot more
explicit which also suppresses the error, I'm just not sure that this
is a real solution.

The second and third patches simply fix warnings that flood the screen
so often that it makes it difficult to diagnose other problems.

The fourth and final patch is the most troubling one because there is
no way it can be correct. Clang really doesn't like stlport trying to
use placement new to call a "helper" constructor and according to [1]
it might not do what was intended there anyway. I would rather not
have to do --without-stlport because my understanding is that it would
break abi compat. Is there a better way to fix this issue than making
an init() method somewhere that both constructors can call?

August Sodora
augsod at gmail.com
(201) 280-8138
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-clang-Fix-implicit-type-narrowing-in-initializer-lis.patch
Type: text/x-patch
Size: 129755 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120102/ba7799fe/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-clang-Fix-boost-warnings.patch
Type: text/x-patch
Size: 2071 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120102/ba7799fe/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-clang-Fix-cppunit-warnings.patch
Type: text/x-patch
Size: 1747 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120102/ba7799fe/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-clang-Fix-build-error-in-stlport-this-can-t-be-the-r.patch
Type: text/x-patch
Size: 1548 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120102/ba7799fe/attachment-0007.bin>


More information about the LibreOffice mailing list