Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 713574 - app-office/libreoffice-6.4.2.2 clang-10 compilation error
Summary: app-office/libreoffice-6.4.2.2 clang-10 compilation error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard: fixed in 6.4.6.2
Keywords:
Depends on:
Blocks: systemwide-clang llvm-10
  Show dependency tree
 
Reported: 2020-03-20 09:49 UTC by Jan Psota
Modified: 2020-08-07 23:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info libreoffice (emerge-info.txt,19.83 KB, text/plain)
2020-03-21 00:21 UTC, Jan Psota
Details
build with llvm-10 log (build.log.xz,846.12 KB, application/octet-stream)
2020-03-21 00:22 UTC, Jan Psota
Details
libreoffice-6.4.2.2-clang.patch (libreoffice-6.4.2.2-clang.patch,38.16 KB, patch)
2020-03-24 13:10 UTC, Mark Wright
Details | Diff
fix gengal.bin SIGSEGV with libcxxabi-10 (libreoffice-6.4.2.2-libcxxabi-10.patch,877 bytes, patch)
2020-04-11 04:55 UTC, 12101111
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Psota 2020-03-20 09:49:47 UTC
(with gcc-9.3 Libre Office have just merged :-)

With clang there were errors:

[...]/libreoffice-6.4.2.2/sc/source/core/opencl/formulagroupcl.cxx:1340:14: error: 'sc::opencl::OpAverage' is an incomplete type
        if (!dynamic_cast<OpAverage*>(mpCodeGen.get()))
             ^           ~~~~~~~~~~~~
[...]/libreoffice-6.4.2.2/sc/source/core/opencl/formulagroupcl.cxx:1029:7: note: forward declaration of 'sc::opencl::OpAverage'
class OpAverage;
      ^
...and same with OpCount, "7 errors generated".

My system use dev-libs/ocl-icd-2.2.12-r1, clang-10.

I cannot easily say if clang-10 can compile previous version of LO,
because lo-6.3.5.2 merged well with clang-9 on my machine.
Comment 1 Jonas Stein gentoo-dev 2020-03-20 14:33:42 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. That is why I ask you to 
* attach the logs and 
* paste the emerge info 
as described on 
https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Please reopen this ticket (Status:UNCONFIRMED) afterwards.

This minimizes the number of callbacks and increases the efficiency of the maintainer.
Comment 2 Jan Psota 2020-03-21 00:21:23 UTC
Created attachment 623526 [details]
emerge --info libreoffice

emerge --info should filter out GENTOO_MIRRORS and PORTAGE_BINHOST,
because they can include passwords
Comment 3 Jan Psota 2020-03-21 00:22:36 UTC
Created attachment 623528 [details]
build with llvm-10 log
Comment 4 Jonas Stein gentoo-dev 2020-03-21 00:32:34 UTC
(In reply to Jan Psota from comment #2)
> emerge --info should filter out GENTOO_MIRRORS and PORTAGE_BINHOST,
> because they can include passwords

I fully support this, if that is true. 
Please open a new ticket about this.
Comment 5 Jan Psota 2020-03-21 01:49:38 UTC
> I fully support this, if that is true. 
> Please open a new ticket about this.
At your service, sir (-:
https://bugs.gentoo.org/713726
Comment 6 Andreas Sturmlechner gentoo-dev 2020-03-22 20:50:10 UTC
I'm not sure that llvm-10 tracker was intended for systemwide-clang reports...
Comment 7 Mark Wright gentoo-dev 2020-03-24 13:10:17 UTC
Created attachment 625002 [details, diff]
libreoffice-6.4.2.2-clang.patch

Patch (by me) fixes the clang 10.0.0 rc4 compiler error, however I don't know if it compiles with gcc.  Also the build fails later with a SIGSEGV:

/bin/sh: line 1: 20982 Segmentation fault      ( LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program" $I/program/gengal.bin --build-tree --destdir file://$S/extras/source/gallery --name "education" --path $W/Gallery/education --filenames file://$RESPONSEFILE )
Comment 8 Jan Psota 2020-03-24 13:36:56 UTC
(In reply to Mark Wright from comment #7)
> Created attachment 625002 [details, diff] [details, diff]
> libreoffice-6.4.2.2-clang.patch

I'll check if it works with gcc(-9.3), but could you, please, attach version with same indentation for original and patched code, so we can see what really changed? (besides class Op... removal)
Comment 9 Andreas Sturmlechner gentoo-dev 2020-03-24 13:42:19 UTC
Exactly: Unified diff, no unrelated changes, anything else is useless.
Comment 10 Mark Wright gentoo-dev 2020-03-24 22:11:40 UTC
(In reply to Jan Psota from comment #8)
> (In reply to Mark Wright from comment #7)
> > Created attachment 625002 [details, diff] [details, diff] [details, diff]
> > libreoffice-6.4.2.2-clang.patch
> 
> I'll check if it works with gcc(-9.3),

Great, thanks.

> but could you, please, attach version
> with same indentation for original and patched code, so we can see what
> really changed? (besides class Op... removal)

I tried that, but the patch looked much the same.  So I think its best that I just explain that all the patch does (besides removing the the forward declarations of OpAverage and OpCount) is to move the inline declarations of
the following methods:

template<class Base>
void ParallelReductionVectorRef<Base>::GenSlidingWindowFunction( std::stringstream& ss )

template<class Base>
size_t ParallelReductionVectorRef<Base>::GenReductionLoopHeader(
    std::stringstream& ss, int nResultSize, bool& needBody )

template<class Base>
size_t ParallelReductionVectorRef<Base>::Marshal( cl_kernel k, int argno, int w, cl_program mpProgram )

to be out of line and further down the file below the declarations of the classes OpAverage and OpCount.

There are no other changes to the code.
Comment 11 Andreas Sturmlechner gentoo-dev 2020-03-24 22:13:25 UTC
Please try harder. As-is this is non-upstreamable and consequently unacceptable for gentoo.git
Comment 12 Jan Psota 2020-03-26 00:10:30 UTC
No I see! Moving part of the program changed indentation level of huge part of code (verified using clang-format). Applied, compilation in progress.
Comment 13 Jan Psota 2020-03-26 09:34:25 UTC
app-office/libreoffice-6.4.2.2 merged using clang-10 :-D

I don't understand, how it worked, but you fixed it, Mark! :-)
Comment 14 Jan Psota 2020-03-26 09:48:37 UTC
(In reply to Andreas Sturmlechner from comment #11)
> Please try harder. As-is this is non-upstreamable and consequently
> unacceptable for gentoo.git

I tried to compact that patch from Mark executing
sed 's/^ \+//g' on original and patched formulagroupcl.cxx
(I thought it was indentation that matters),
but it didn't work: patch shrank from 38 KB to 31 KB
only because of leading spaces...

But it works :-)
Comment 15 12101111 2020-04-10 05:00:05 UTC
I also encounter this SIGSEGV, and I think It's related with libcxxabi-10.

This code cause SIGSEGV is https://github.com/LibreOffice/core/blob/master/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx#L86

lldb:
* thread #1, name = 'gengal.bin', stop reason = signal SIGSEGV: invalid address (fault address: 0x8)
  * frame #0: 0x00007fffee1dd8e4 libgcc3_uno.so`std::type_info::name(this=0x0000000000000000) const at typeinfo:289:44
    frame #1: 0x00007fffee1dd3ea libgcc3_uno.so`gcc3::deleteException(pExc=0x0000000000f1f5e0) at except.cxx:86:57
    frame #2: 0x00007ffff2efce0c libc++abi.so.1`__cxa_end_catch + 204
    frame #3: 0x00007ffff695f95d libmergedlo.so`FileExists(rURL=<unavailable>) at galmisc.cxx:0
    frame #4: 0x00007ffff695a185 libmergedlo.so`GalleryThemeEntry::ImplGetURLIgnoreCase(rURL=<unavailable>) at gallery1.cxx:204:10
    frame #5: 0x00007ffff6959c10 libmergedlo.so`GalleryThemeEntry::GalleryThemeEntry(this=0x0000000000f1e150, bCreateUniqueURL=true, rBaseURL=0x00007fffffffe038, rName=0x00007fffffffe190, _bReadOnly=false, _bNewFile=true, _nId=0, _bThemeNameFromResource=<unavailable>) at gallery1.cxx:131:36
    frame #6: 0x00007ffff695bae9 libmergedlo.so`Gallery::CreateTheme(this=0x0000000000ef0120, rThemeName=0x00007fffffffe190) at gallery1.cxx:608:44
    frame #7: 0x000000000020aa45 gengal.bin`createTheme(aThemeName=0x00007fffffffe190, aGalleryURL=<unavailable>, aDestDir=0x00007fffffffe198, rFiles=size=108, bRelativeURLs=false) at gengal.cxx:75:28
    frame #8: 0x000000000020a531 gengal.bin`GalApp::Main(this=0x0000000000213928) at gengal.cxx:299:9
    frame #9: 0x00007ffff750e1c0 libmergedlo.so`ImplSVMain() at svmain.cxx:191:35
    frame #10: 0x00007ffff750eb96 libmergedlo.so`SVMain() at svmain.cxx:225:12
    frame #11: 0x00000000002102e5 gengal.bin`sal_main() at salmain.cxx:35:12
    frame #12: 0x00000000002102bb gengal.bin`main(argc=<unavailable>, argv=<unavailable>) at salmain.cxx:29:1
    frame #13: 0x00007ffff2bcae1b libc.so.6`__libc_start_main + 235
    frame #14: 0x0000000000209f2a gengal.bin`_start + 42
Comment 16 Lukas Kahnert 2020-04-10 11:40:40 UTC
I also hit this issue and tried to search inside of the code.
It seems that libcxxabi-10 had an ABI break which breaks also libreoffice cause of their now outdated headers.

Upstream commit already a fix for MacOS:
https://github.com/LibreOffice/core/commit/f4b6f6a8ae60bdec53512728d00853b73fa18500

I try to apply these changes on linux too and test if it builds.
Comment 17 12101111 2020-04-11 04:55:32 UTC
Created attachment 632028 [details, diff]
fix gengal.bin SIGSEGV with libcxxabi-10

I can confirm that libreoffice will compile with clang-10 & libcxxabi-10 and run correctly after applying this patch
Comment 18 Perfect Gentleman 2020-06-06 13:08:10 UTC
(In reply to 12101111 from comment #17)
> Created attachment 632028 [details, diff] [details, diff]
> fix gengal.bin SIGSEGV with libcxxabi-10
> 
> I can confirm that libreoffice will compile with clang-10 & libcxxabi-10 and
> run correctly after applying this patch

Confirm.
Comment 19 Andreas Sturmlechner gentoo-dev 2020-08-06 21:05:24 UTC
Looks like a patch is also upstream now:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=986bd28388df745dd969e7be7c3bda36b2b2cb0e
Comment 20 Larry the Git Cow gentoo-dev 2020-08-07 23:24:20 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=947faddaa0c012fe78adaf3fb3d0d1f1fde2be4e

commit 947faddaa0c012fe78adaf3fb3d0d1f1fde2be4e
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2020-08-06 21:08:45 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2020-08-07 23:23:19 +0000

    app-office/libreoffice: Fix build with LLVM-10
    
    Closes: https://bugs.gentoo.org/713574
    Package-Manager: Portage-3.0.1, Repoman-2.3.23
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 .../files/libreoffice-6.4.6.2-llvm-10.patch        | 102 +++++++++++++++++++++
 app-office/libreoffice/libreoffice-6.4.9999.ebuild |   1 +
 2 files changed, 103 insertions(+)