Bug 135555 - type 'struct Document' violates the C++ One Definition Rule
Summary: type 'struct Document' violates the C++ One Definition Rule
Status: RESOLVED MOVED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-08 12:53 UTC by Hillwood Yang
Modified: 2022-11-06 05:05 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
libreoffice online 7.0.0.2 build log (157.47 KB, text/x-log)
2020-08-08 12:53 UTC, Hillwood Yang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hillwood Yang 2020-08-08 12:53:13 UTC
Created attachment 164047 [details]
libreoffice online 7.0.0.2 build log

I tried to build libreoffice online 7.0.0.2 on openSUSE Tumbleweed, but got a fatal error:

  164s] kit/Kit.cpp:756:7: error: type 'struct Document' violates the C++ One Definition Rule [-Werror=odr]
[  164s]   756 | class Document final : public DocumentManagerInterface
[  164s]       |       ^
[  164s] wsd/AdminModel.hpp:127:7: note: a type with different bases is defined in another translation unit
[  164s]   127 | class Document
[  164s]       |       ^
[  164s] kit/Kit.cpp:796:13: error: type of '__dt_comp ' does not match original declaration [-Werror=lto-type-mismatch]
[  164s]   796 |     virtual ~Document()
[  164s]       |             ^
[  164s] wsd/AdminModel.hpp:160:5: note: '__dt_comp ' was previously declared here
[  164s]   160 |     ~Document()
[  164s]       |     ^
[  164s] lto1: all warnings being treated as errors
[  164s] lto-wrapper: fatal error: g++ returned 1 exit status
[  164s] compilation terminated.
[  164s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: error: lto-wrapper failed
[  164s] collect2: error: ld returned 1 exit status
[  164s] make[2]: *** [Makefile:1672: loolwsd_fuzzer] Error 1
[  164s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/online-libreoffice-7.0.0.2'
[  164s] make[2]: *** Waiting for unfinished jobs....
[  165s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/online-libreoffice-7.0.0.2'
Comment 1 Aron Budea 2020-08-08 20:31:46 UTC
Does that mean you're trying to build with LTO?
Comment 2 Hillwood Yang 2020-08-09 08:44:59 UTC
(In reply to Aron Budea from comment #1)
> Does that mean you're trying to build with LTO?

Yes, i got the source package from https://github.com/LibreOffice/online/archive/libreoffice-7.0.0.2.tar.gz
Comment 3 Aron Budea 2020-08-09 17:19:14 UTC
Right, I don't think the code is prepared to be built with LTO.
Comment 4 Hillwood Yang 2020-08-12 07:57:41 UTC
(In reply to Aron Budea from comment #3)
> Right, I don't think the code is prepared to be built with LTO.

No, the code is valid. This issue can be workarounded by '-Wno-error' option.
Comment 5 Aron Budea 2020-08-14 06:39:31 UTC
Have you tried building without LTO?
Comment 6 Xisco Faulí 2021-11-23 10:48:53 UTC
Hello Hillwood,
is this issue still reproducible with a master build ?
Comment 7 QA Administrators 2022-05-23 03:39:15 UTC Comment hidden (obsolete)
Comment 8 Hillwood Yang 2022-05-23 12:41:24 UTC
The upstream of libreoffice online have been moved to Collabora (https://github.com/CollaboraOnline/online). I don't know whether still trace this issue on TDF.
Comment 9 QA Administrators 2022-05-24 03:34:32 UTC Comment hidden (obsolete)
Comment 10 Aron Budea 2022-11-06 05:05:25 UTC
Okay, if this still occurs with the latest Collabora Online, please open a GH issue: https://github.com/CollaboraOnline/online/issues