Bug 142442 - Build failure with gcc-11
Summary: Build failure with gcc-11
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.1.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Dev-Bugs
  Show dependency treegraph
 
Reported: 2021-05-23 08:41 UTC by Ali Haydar Çalışkan
Modified: 2021-11-23 10:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
build log (1.03 MB, text/plain)
2021-05-23 08:45 UTC, Ali Haydar Çalışkan
Details
gcc 10 patch (6.23 KB, patch)
2021-06-05 18:29 UTC, Ali Haydar Çalışkan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Haydar Çalışkan 2021-05-23 08:41:52 UTC
When I try to build LO 7.1.3.2 I get this build error:

/an/duyum/etki/ld: /libreoffice-7.1.3.2/libreoffice-7.1.3.2/workdir/CxxObject/xmloff/source/core/xmlimp.o: in function `SvXMLImport::SetAutoStyles(SvXMLStylesContext*)':
xmlimp.cxx:(.text+0x8ec0): undefined reference to `non-virtual thunk to cppu::WeakImplHelper<com::sun::star::xml::sax::XFastAttributeList, com::sun::star::util::XCloneable>::acquire()'
collect2: error: ld returned 1 exit status
make[1]: *** [/libreoffice-7.1.3.2/libreoffice-7.1.3.2/xmloff/Library_xo.mk:20: /libreoffice-7.1.3.2/libreoffice-7.1.3.2/instdir/program/libxolo.so] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:274: build] Error 2


I've tried to add these lines into the xmloff/source/core/xmlimp.cxx file:

template class uno::Reference< io::XInputStream > ;
template class ::cppu::WeakImplHelper< css::io::XInputStream >;

I still get the same error. Any ideas how to fix this? I'm compiling with gcc-11.1.0 on custom musl based distribution(similar to void linux/alpine linux).
Comment 1 Ali Haydar Çalışkan 2021-05-23 08:45:12 UTC
Created attachment 172260 [details]
build log

Here is the complete build log until the error occurs.
Comment 2 Aron Budea 2021-05-31 03:44:32 UTC
Is there a reason why you aren't building master branch? (where it's likely already fixed)
Not sure what the best procedure is, Stephan you tend to deal with similar build issues, can you please advise if something like this should be handled in libreoffice-7-1?
Comment 3 Stephan Bergmann 2021-05-31 07:54:17 UTC
I at least can't remember having seen this issue before.  (If I had seen it with a recent GCC version, I would have fixed it at least on the LO master branch.)

You can check whether the issue happens to not show up on the master branch, but generally you're on your own trying to fix this issue, it appears.
Comment 4 Xisco Faulí 2021-05-31 14:16:59 UTC
Hello Ali,
Please try with a master build and give us feedback. Setting this to NEEDINFO meanwhile.
Comment 5 Ali Haydar Çalışkan 2021-05-31 17:05:40 UTC
I get the same compilation error with the master branch:

/an/duyum/etki/ld: /libreoffice-7.2.0.0.alpha1/libreoffice-7.2.0.0.alpha1/workdir/CxxObject/xmloff/source/core/xmlimp.o: in function `SvXMLImport::SetAutoStyles(SvXMLStylesContext*)':
xmlimp.cxx:(.text+0x8d96): undefined reference to `non-virtual thunk to cppu::WeakImplHelper<com::sun::star::xml::sax::XFastAttributeList, com::sun::star::util::XCloneable>::acquire()'
collect2: error: ld returned 1 exit status
make[1]: *** [/libreoffice-7.2.0.0.alpha1/libreoffice-7.2.0.0.alpha1/xmloff/Library_xo.mk:20: /libreoffice-7.2.0.0.alpha1/libreoffice-7.2.0.0.alpha1/instdir/program/libxolo.so] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:285: build] Error 2


I managed to build LO 6.4.7.2 without issues though.
Comment 6 QA Administrators 2021-06-01 04:30:51 UTC Comment hidden (obsolete)
Comment 7 Ali Haydar Çalışkan 2021-06-05 18:26:23 UTC
Alpine Linux developers have a workaround patch for LO 6 that I have adopted to LO 7 with some additions. There is a hint on "utl::OInputStreamWrapper" that might confuse ld. Here is the bug report:

https://gitlab.alpinelinux.org/alpine/aports/-/issues/12109
Comment 8 Ali Haydar Çalışkan 2021-06-05 18:29:23 UTC
Created attachment 172646 [details]
gcc 10 patch

This patch worked before on LO 7.1 with gcc 10 and some other updates. Now the same patch is not enough to build LO 7.2.
Comment 9 Ali Haydar Çalışkan 2021-06-05 21:31:53 UTC
building with clang gives me this error without the gcc patch:

I/O warning : failed to load external entity "file:///libreoffice-7.1.4.1/libreoffice-7.1.4.1/external/tarballs/libreoffice-help-7.1.4.1/helpcontent2/source/text/swriter/guide/standard_template.xhp"
I/O warning : failed to load external entity "file:///libreoffice-7.1.4.1/libreoffice-7.1.4.1/workdir/HelpTranslatePartTarget/tr/helpcontent2/source/text/swriter/guide/standard_template.xhp"
I/O warning : failed to load external entity "file:///libreoffice-7.1.4.1/libreoffice-7.1.4.1/workdir/HelpTranslatePartTarget/sv/helpcontent2/source/text/swriter/guide/standard_template.xhp"
[build CXX] test/source/diff/diff.cxx
I/O warning : failed to load external entity "file:///libreoffice-7.1.4.1/libreoffice-7.1.4.1/workdir/HelpTranslatePartTarget/pt-BR/helpcontent2/source/text/swriter/guide/standard_template.xhp"
I/O warning : failed to load external entity "file:///libreoffice-7.1.4.1/libreoffice-7.1.4.1/workdir/HelpTranslatePartTarget/en-GB/helpcontent2/source/text/swriter/guide/standard_template.xhp"
[build CXX] test/source/callgrind.cxx
[build CXX] test/source/xmltesttools.cxx
[build CXX] test/source/htmltesttools.cxx
[build CXX] test/source/screenshot_test.cxx
[build CXX] test/source/unoapi_property_testers.cxx
[build CXX] test/source/helper/form.cxx
[build CXX] test/source/helper/shape.cxx
[build CXX] test/source/helper/transferable.cxx
[build BIN] tools
[build LNK] Library/libsotlo.so
[build LNK] Library/libi18nutil.so
ld.lld: error: undefined symbol: non-virtual thunk to cppu::WeakImplHelper<com::sun::star::io::XInputStream>::acquire()
>>> referenced by ucbstorage.cxx
>>>               /libreoffice-7.1.4.1/libreoffice-7.1.4.1/workdir/CxxObject/sot/source/sdstor/ucbstorage.o:(UCBStorage_Impl::Init())
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [/libreoffice-7.1.4.1/libreoffice-7.1.4.1/sot/Library_sot.mk:20: /libreoffice-7.1.4.1/libreoffice-7.1.4.1/instdir/program/libsotlo.so] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:282: build] Error 2
Comment 10 Ali Haydar Çalışkan 2021-06-05 22:40:30 UTC
I have been successfully built LO 7.1.4.1 with clang using the gcc 10 patch.
Comment 11 Xisco Faulí 2021-11-23 10:09:22 UTC
(In reply to Ali Haydar Çalışkan from comment #10)
> I have been successfully built LO 7.1.4.1 with clang using the gcc 10 patch.

Closing as RESOLVED NOTOURBUG
For further issues in the build process, please use the development mailing list < https://wiki.documentfoundation.org/Development/Mailing_List >