Bug 81799 - Clang 3.2 Fails to build LO 4.4 on Ubuntu
Summary: Clang 3.2 Fails to build LO 4.4 on Ubuntu
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected) Master
Hardware: Other Linux (All)
: medium normal
Assignee: David Tardon
Whiteboard: target:4.4.0
Depends on:
Reported: 2014-07-27 02:26 UTC by Luke
Modified: 2014-07-29 08:10 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

Build log (1.52 MB, text/plain)
2014-07-27 02:26 UTC, Luke

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2014-07-27 02:26:51 UTC
Created attachment 103530 [details]
Build log

Under Ubuntu 13.10 with the default clang 3.2, I can build LO 4.2 and 4.3, but the latest 4.4 fails with the following error:

[build LNK] Library/libavmedialo.so
(.data.rel.ro._ZTIN10comphelper16WeakImplHelper32IN3com3sun4star9container6XChildENS3_8document27XDocumentPropertiesSupplierENS6_13XCmisDocumentENS3_3rdf23XDocumentMetadataAccessENS6_17XDocumentRecoveryENS6_20XUndoManagerSupplierENS6_17XEventBroadcasterENS6_25XDocumentEventBroadcasterENS3_4lang14XEventListenerENS6_15XEventsSupplierENS6_16XEmbeddedScriptsENS6_24XScriptInvocationContextENS3_5frame7XModel2ENS3_4util12XModifiable2ENS3_4view10XPrintableENSO_20XPrintJobBroadcasterENSK_10XStorable2ENSK_9XLoadableENS3_6script16XStarBasicAccessENS6_17XViewDataSupplierENSM_10XCloseableENS3_12datatransfer13XTransferableENS6_27XDocumentSubStorageSupplierENS6_21XStorageBasedDocumentENST_8provider23XScriptProviderSupplierENS3_2ui31XUIConfigurationManagerSupplierENS3_5embed13XVisualObjectENSF_10XUnoTunnelENSK_7XModuleENSK_6XTitleENSK_23XTitleChangeBroadcasterENSK_16XUntitledNumbersEEE[_ZTIN10comphelper16WeakImplHelper32IN3com3sun4star9container6XChildENS3_8document27XDocumentPropertiesSupplierENS6_13XCmisDocumentENS3_3rdf23XDocumentMetadataAccessENS6_17XDocumentRecoveryENS6_20XUndoManagerSupplierENS6_17XEventBroadcasterENS6_25XDocumentEventBroadcasterENS3_4lang14XEventListenerENS6_15XEventsSupplierENS6_16XEmbeddedScriptsENS6_24XScriptInvocationContextENS3_5frame7XModel2ENS3_4util12XModifiable2ENS3_4view10XPrintableENSO_20XPrintJobBroadcasterENSK_10XStorable2ENSK_9XLoadableENS3_6script16XStarBasicAccessENS6_17XViewDataSupplierENSM_10XCloseableENS3_12datatransfer13XTransferableENS6_27XDocumentSubStorageSupplierENS6_21XStorageBasedDocumentENST_8provider23XScriptProviderSupplierENS3_2ui31XUIConfigurationManagerSupplierENS3_5embed13XVisualObjectENSF_10XUnoTunnelENSK_7XModuleENSK_6XTitleENSK_23XTitleChangeBroadcasterENSK_16XUntitledNumbersEEE]+0x10): undefined reference to `typeinfo for cppu::OWeakObject'

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [/home/luke/Downloads/lo/libreoffice/workdir/LinkTarget/CppunitTest/libtest_cppcanvas_emfplus.so] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [build] Error 2

$ uname -a
Linux luke-MM061 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 i686 i686 GNU/Linux

$ clang -v
Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2)
Target: i386-pc-linux-gnu
Comment 1 Michael Meeks 2014-07-27 19:15:27 UTC
Hi Luke,

Thanks for reporting that ! =) ultimately the tinderboxes seem to build with clang on that platform; its best to ask for help with build issues either on the mailing list (no subscription required) - libreoffice@lists.freedesktop.org - or better interactively on IRC: irc.freenode.net @libreoffice-dev.

Hoping we can get you up and running ! =)
Comment 2 David Tardon 2014-07-28 06:46:30 UTC
Does adding cppuhelper to the gb_CppunitTest_use_libraries list in cppcanvas/CppunitTest_cppcanvas_empflus.mk help?
Comment 3 Luke 2014-07-28 20:09:55 UTC
@David Tardon

In cppcanvas/CppunitTest_cppcanvas_emfplus.mk
adding cppuhelper like this:
$(eval $(call gb_CppunitTest_use_libraries,cppcanvas_emfplus, \
        comphelper \
        cppu \
        cppuhelper \

Fixed the issue. I can now build LO 4.4 with clang 3.2. How can we get this change merged in the master branch?
Comment 4 Luke 2014-07-29 02:59:37 UTC
I tested David's fix on my Ubuntu 14.04 box running gcc 4.8 and clang 3.4. They both compiled LO without errors. Calc, Writer, and Impress all appear to be running normally. This fix should be safe for Linux.

 $ uname -a
Linux Studio-XPS-435MT 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 21:40:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ clang -v
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu

$ gcc -v
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
Comment 5 Commit Notification 2014-07-29 08:10:03 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":


fdo#81799 we need cppuhelper here too

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.