Bug 244850

Summary: editors/libreoffice fails to build on 13-CURRENT
Product: Ports & Packages Reporter: Cy Schubert <cy>
Component: Individual Port(s)Assignee: FreeBSD Office Team <office>
Status: Closed FIXED    
Severity: Affects Only Me CC: Trond.Endrestol, emaste, lwhsu
Priority: --- Flags: bugzilla: maintainer-feedback? (office)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 244251    
Attachments:
Description Flags
Patch for vcl/inc/unx/saltype.h
none
Patch for sd/source/ui/framework/factories/BasicPaneFactory.cxx
none
Patch for sd/inc/OutlinerIterator.hxx
none
Patch for sd/source/ui/view/OutlinerIterator.cxx
none
Patch for compilerplugins/clang/simplifybool.cxx
none
Patch for cui/source/tabpages/tpline.cxx
none
Patch for sc/source/ui/view/viewfunc.cxx
none
Patch for sc/source/core/opencl/formulagroupcl.cxx none

Description Cy Schubert freebsd_committer freebsd_triage 2020-03-16 19:09:43 UTC
Related to clang version 10.0.0.

/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/unx/generic/gdi/salgdi.cxx:161:18: error: use of overloaded operator '!=' is ambiguous (with operand types 'SalX11Screen' and 'S
alX11Screen')
    if( nXScreen != m_nXScreen )
        ~~~~~~~~ ^  ~~~~~~~~~~
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/unx/saltype.h:22:10: note: candidate function
    bool operator!=(const SalX11Screen &rOther) { return rOther.mnXScreen != mnXScreen; }
         ^
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/unx/saltype.h:21:10: note: candidate function
    bool operator==(const SalX11Screen &rOther) { return rOther.mnXScreen == mnXScreen; }
         ^
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/unx/saltype.h:21:10: note: candidate function (with reversed parameter order)
1 error generated.
gmake[2]: *** [/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/solenv/gbuild/LinkTarget.mk:293: /wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/workdir/CxxObject/vc
l/unx/generic/gdi/salgdi.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/unx/generic/window/salframe.cxx:59:
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/opengl/zone.hxx:37:33: warning: increment of object of volatile-qualified type 'volatile sal_uInt64' (aka 'volatile unsigned
 long long') is deprecated [-Wdeprecated-volatile]
     OpenGLZone() { gnEnterCount++; }
                                ^
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/opengl/zone.hxx:38:33: warning: increment of object of volatile-qualified type 'volatile sal_uInt64' (aka 'volatile unsigned
 long long') is deprecated [-Wdeprecated-volatile]
    ~OpenGLZone() { gnLeaveCount++; }
                                ^
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/unx/generic/window/salframe.cxx:2410:34: error: use of overloaded operator '!=' is ambiguous (with operand types 'SalX11Screen'
and 'SalX11Screen')
        if( mpParent->m_nXScreen != m_nXScreen )
            ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/unx/saltype.h:22:10: note: candidate function
    bool operator!=(const SalX11Screen &rOther) { return rOther.mnXScreen != mnXScreen; }
         ^
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/unx/saltype.h:21:10: note: candidate function
    bool operator==(const SalX11Screen &rOther) { return rOther.mnXScreen == mnXScreen; }
         ^
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/unx/saltype.h:21:10: note: candidate function (with reversed parameter order)
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/unx/generic/window/salframe.cxx:2485:34: error: use of overloaded operator '!=' is ambiguous (with operand types 'SalX11Screen'
and 'SalX11Screen')
        if( mpParent->m_nXScreen != m_nXScreen )
            ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/unx/saltype.h:22:10: note: candidate function
    bool operator!=(const SalX11Screen &rOther) { return rOther.mnXScreen != mnXScreen; }
         ^
/wrkdirs/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/vcl/inc/unx/saltype.h:21:10: note: candidate function
Comment 1 Trond Endrestøl 2020-03-17 15:41:15 UTC
I think the declarations and definitions of the overloaded operators lack const before the open curly bracket.
Comment 2 Li-Wen Hsu freebsd_committer freebsd_triage 2020-03-17 15:42:58 UTC
(In reply to Trond.Endrestol from comment #1)
Thanks for the analysis, do you think it is possible to have a patch for this?
Comment 3 Trond Endrestøl 2020-03-17 17:34:33 UTC
Created attachment 212463 [details]
Patch for vcl/inc/unx/saltype.h

It's just a hunch. I will try the patch myself as soon the current build queue is done on my laptop.
Comment 4 Trond Endrestøl 2020-03-17 18:40:59 UTC
(In reply to Trond.Endrestol from comment #3)
I've started a build of editors/libreoffice on base/head r359017, using ports-mgmt/synth. It's not done yet, but I'm well past compiling the problematic vcl/unx/generic/gdi/salgdi.cxx.
Comment 5 Trond Endrestøl 2020-03-17 18:45:00 UTC
(In reply to Trond.Endrestol from comment #4)
vcl/unx/generic/window/salframe.cxx passed with flying colours.
Comment 6 Li-Wen Hsu freebsd_committer freebsd_triage 2020-03-17 18:46:26 UTC
(In reply to Trond.Endrestol from comment #5)

Thanks, upstream also has the same patch: https://github.com/LibreOffice/core/commit/437dc68285dab0f08a1ded2193d86d64f560cd9b

Please let me know if this is sufficient to fix all the compilation issues.
Comment 7 Trond Endrestøl 2020-03-17 19:55:01 UTC
Created attachment 212467 [details]
Patch for sd/source/ui/framework/factories/BasicPaneFactory.cxx

From https://github.com/LibreOffice/core/commit/0c3e90d95c2c952265625bcff590599627114ec1 and not a work of my own.
Comment 8 Trond Endrestøl 2020-03-17 20:27:21 UTC
Created attachment 212469 [details]
Patch for sd/inc/OutlinerIterator.hxx

From https://github.com/LibreOffice/core/commit/41147e20029c80c4941ca81bc5dca3782bef5d94?diff=unified
Comment 9 Trond Endrestøl 2020-03-17 20:28:17 UTC
Created attachment 212470 [details]
Patch for sd/source/ui/view/OutlinerIterator.cxx

From https://github.com/LibreOffice/core/commit/41147e20029c80c4941ca81bc5dca3782bef5d94?diff=unified
Comment 10 Trond Endrestøl 2020-03-17 21:30:48 UTC
Created attachment 212473 [details]
Patch for compilerplugins/clang/simplifybool.cxx

From https://github.com/LibreOffice/core/commit/54f292d1d199dae36257a1ceb0ff30f32a7e0824
I didn't bother about the documentation changes to compilerplugins/clang/test/simplifybool.cxx.
Comment 11 Trond Endrestøl 2020-03-17 21:32:23 UTC
Created attachment 212474 [details]
Patch for cui/source/tabpages/tpline.cxx

From https://github.com/LibreOffice/core/commit/54f292d1d199dae36257a1ceb0ff30f32a7e0824
Comment 12 Trond Endrestøl 2020-03-17 23:16:46 UTC
Created attachment 212479 [details]
Patch for sc/source/ui/view/viewfunc.cxx

Inspired by the if-expression a few lines above. Maybe this patch is wrong, but the compiler stopped complaning.
Comment 13 Trond Endrestøl 2020-03-18 00:00:24 UTC
Created attachment 212481 [details]
Patch for sc/source/core/opencl/formulagroupcl.cxx

An adaptation of https://github.com/LibreOffice/core/commit/7db6a64e40f172894e08ecec483f214f7f1d7e10#diff-e5629822afa8a035c2838f1c8d1eff77
Comment 14 Trond Endrestøl 2020-03-18 06:00:04 UTC
(In reply to Trond.Endrestol from comment #13)
That makes eight patches. The build succeeded. I installed the package, and LibreOffice seem to be functional. I opened a document and a spreadsheet, and I did some editing. No crash. Someone, please verify my claims.
Comment 15 Li-Wen Hsu freebsd_committer freebsd_triage 2020-03-18 12:55:32 UTC
(In reply to Trond.Endrestol from comment #14)
Thanks, I'm testing them.
Comment 16 commit-hook freebsd_committer freebsd_triage 2020-03-18 18:35:22 UTC
A commit references this bug:

Author: lwhsu
Date: Wed Mar 18 18:35:00 UTC 2020
New revision: 528660
URL: https://svnweb.freebsd.org/changeset/ports/528660

Log:
  Fix build with clang10

  PR:		244850
  Reported by:	cy
  Submitted by:	Trond.Endrestol@ximalas.info
  Obtained from:	https://github.com/LibreOffice/core (partially)

Changes:
  head/editors/libreoffice/Makefile
  head/editors/libreoffice/files/patch-clang10