Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915230 - net-libs/webkit-gtk-2.40.5-r410 fails to compile (lto): XPathGrammar.y:72: error: type ‘union YYSTYPE’ violates the C++ One Definition Rule [-Werror=odr]
Summary: net-libs/webkit-gtk-2.40.5-r410 fails to compile (lto): XPathGrammar.y:72: er...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-10-06 05:42 UTC by ppw0
Modified: 2024-01-10 12:20 UTC (History)
0 users

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


Attachments
build log (net-libs:webkit-gtk-2.40.5-r410:20231006-002026.log.gz,611.58 KB, application/gzip)
2023-10-06 05:42 UTC, ppw0
Details
emerge --info (emerge_info.log,7.40 KB, text/x-log)
2023-10-06 05:43 UTC, ppw0
Details
build log (2.42.1) (net-libs:webkit-gtk-2.42.1-r410:20231014-135829.log.gz,630.11 KB, application/gzip)
2023-10-14 15:45 UTC, ppw0
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ppw0 2023-10-06 05:42:29 UTC
Created attachment 872214 [details]
build log

In a stricter lto environment, trying to emerge net-libs/webkit-gtk-2.40.5-r410 will generate the following errors:
```
XPathGrammar.y:72: error: type ‘union YYSTYPE’ violates the C++ One Definition Rule [-Werror=odr]
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.h:253: note: a different type is defined in another translation unit
  253 | union YYSTYPE
      | 
XPathGrammar.y:58: note: the first difference of corresponding definitions is field ‘numericOpcode’
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.h:267: note: a field with different name is defined in another translation unit
  267 |     } lex;
      | 
XPathGrammar.cpp:366: error: type ‘union yyalloc’ violates the C++ One Definition Rule [-Werror=odr]
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.cpp:742: note: a different type is defined in another translation unit
  742 | union yyalloc
      | 
XPathGrammar.cpp:368: note: the first difference of corresponding definitions is field ‘yyss’
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.cpp:744: note: a field with different name is defined in another translation unit
  744 |     yy_state_t yyss_alloc;
      | 
glslang.l:1005: error: type ‘struct yyguts_t’ violates the C++ One Definition Rule [-Werror=odr]
preprocessor.l:777: note: a different type is defined in another translation unit
glslang.l:1009: note: the first difference of corresponding definitions is field ‘yyextra_r’
preprocessor.l:781: note: a field of same name but different type is defined in another translation unit
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/translator/ParseContext.h:33: note: type name ‘sh::TParseContext’ should match type name ‘angle::pp::Tokenizer::Context’
   33 | class TParseContext : angle::NonCopyable
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/preprocessor/Tokenizer.h:25: note: the incompatible type is defined here
   25 |     struct Context
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/xml/XPathParser.h:45: error: ‘lex’ violates the C++ One Definition Rule [-Werror=odr]
   45 |     int lex(YYSTYPE&);
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/xml/XPathParser.cpp:404: note: type mismatch in parameter 1
  404 | int Parser::lex(YYSTYPE& yylval)
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/xml/XPathParser.cpp:404: note: ‘lex’ was previously declared here
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebKit/UIProcess/API/glib/WebKitWebsitePoliciesPrivate.h:26: error: ‘webkitWebsitePoliciesGetWebsitePolicies’ violates the C++ One Definition Rule [-Werror=odr]
   26 | API::WebsitePolicies* webkitWebsitePoliciesGetWebsitePolicies(WebKitWebsitePolicies*);
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebKit/UIProcess/API/glib/WebKitWebsitePolicies.cpp:61: note: return value type mismatch
   61 | API::WebsitePolicies& webkitWebsitePoliciesGetWebsitePolicies(WebKitWebsitePolicies* policies)
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebKit/UIProcess/API/glib/WebKitWebsitePolicies.cpp:61: note: ‘webkitWebsitePoliciesGetWebsitePolicies’ was previously declared here
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.cpp:132: error: type ‘yysymbol_kind_t’ violates the C++ One Definition Rule [-Werror=odr]
  132 | enum yysymbol_kind_t
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/preprocessor/preprocessor_tab_autogen.cpp:226: note: an enum with different value name is defined in another translation unit
  226 | enum yysymbol_kind_t
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab_autogen.cpp:138: note: name ‘YYSYMBOL_INVARIANT’ differs from name ‘YYSYMBOL_TOK_CONST_INT’ defined in another translation unit
  138 |     YYSYMBOL_INVARIANT                            = 3,   /* INVARIANT  */
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/ThirdParty/ANGLE/src/compiler/preprocessor/preprocessor_tab_autogen.cpp:232: note: mismatching definition
  232 |     YYSYMBOL_TOK_CONST_INT  = 3,  /* TOK_CONST_INT  */
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/xml/XMLHttpRequest.h:55: error: virtual table of type ‘struct XMLHttpRequest’ violates one definition rule [-Werror=odr]
   55 | class XMLHttpRequest final : public ActiveDOMObject, public RefCounted<XMLHttpRequest>, private ThreadableLoaderClient, public XMLHttpRequestEventTarget {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSXMLHttpRequest.cpp:816: note: variable of same assembler name as the virtual table is defined in another translation unit
  816 | extern "C" { extern void* _ZTVN7WebCore14XMLHttpRequestE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/xml/XMLHttpRequestUpload.h:35: error: virtual table of type ‘struct XMLHttpRequestUpload’ violates one definition rule [-Werror=odr]
   35 | class XMLHttpRequestUpload final : public XMLHttpRequestEventTarget {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSXMLHttpRequestUpload.cpp:199: note: variable of same assembler name as the virtual table is defined in another translation unit
  199 | extern "C" { extern void* _ZTVN7WebCore20XMLHttpRequestUploadE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/workers/shared/SharedWorker.h:42: error: virtual table of type ‘struct SharedWorker’ violates one definition rule [-Werror=odr]
   42 | class SharedWorker final : public AbstractWorker, public ActiveDOMObject {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSSharedWorker.cpp:292: note: variable of same assembler name as the virtual table is defined in another translation unit
  292 | extern "C" { extern void* _ZTVN7WebCore12SharedWorkerE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/workers/service/ServiceWorkerRegistration.h:54: error: virtual table of type ‘struct ServiceWorkerRegistration’ violates one definition rule [-Werror=odr]
   54 | class ServiceWorkerRegistration final : public RefCounted<ServiceWorkerRegistration>, public Supplementable<ServiceWorkerRegistration>, public EventTarget, public ActiveDOMObject {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSServiceWorkerRegistration.cpp:552: note: variable of same assembler name as the virtual table is defined in another translation unit
  552 | extern "C" { extern void* _ZTVN7WebCore25ServiceWorkerRegistrationE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/workers/service/ServiceWorker.h:50: error: virtual table of type ‘struct ServiceWorker’ violates one definition rule [-Werror=odr]
   50 | class ServiceWorker final : public RefCounted<ServiceWorker>, public EventTarget, public ActiveDOMObject {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSServiceWorker.cpp:433: note: variable of same assembler name as the virtual table is defined in another translation unit
  433 | extern "C" { extern void* _ZTVN7WebCore13ServiceWorkerE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/workers/service/ServiceWorkerContainer.h:56: error: virtual table of type ‘struct ServiceWorkerContainer’ violates one definition rule [-Werror=odr]
   56 | class ServiceWorkerContainer final : public EventTarget, public ActiveDOMObject, public ServiceWorkerJobClient {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSServiceWorkerContainer.cpp:484: note: variable of same assembler name as the virtual table is defined in another translation unit
  484 | extern "C" { extern void* _ZTVN7WebCore22ServiceWorkerContainerE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/workers/service/ExtendableMessageEvent.h:50: error: virtual table of type ‘struct ExtendableMessageEvent’ violates one definition rule [-Werror=odr]
   50 | class ExtendableMessageEvent final : public ExtendableEvent {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSExtendableMessageEvent.cpp:400: note: variable of same assembler name as the virtual table is defined in another translation unit
  400 | extern "C" { extern void* _ZTVN7WebCore22ExtendableMessageEventE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/workers/service/FetchEvent.h:48: error: virtual table of type ‘struct FetchEvent’ violates one definition rule [-Werror=odr]
   48 | class FetchEvent final : public ExtendableEvent {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSFetchEvent.cpp:459: note: variable of same assembler name as the virtual table is defined in another translation unit
  459 | extern "C" { extern void* _ZTVN7WebCore10FetchEventE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/workers/service/ExtendableEvent.h:38: error: virtual table of type ‘struct ExtendableEvent’ violates one definition rule [-Werror=odr]
   38 | class ExtendableEvent : public Event, public CanMakeWeakPtr<ExtendableEvent> {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSExtendableEvent.cpp:247: note: variable of same assembler name as the virtual table is defined in another translation unit
  247 | extern "C" { extern void* _ZTVN7WebCore15ExtendableEventE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/workers/Worker.h:59: error: virtual table of type ‘struct Worker’ violates one definition rule [-Werror=odr]
   59 | class Worker final : public AbstractWorker, public ActiveDOMObject, private WorkerScriptLoaderClient {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSWorker.cpp:426: note: variable of same assembler name as the virtual table is defined in another translation unit
  426 | extern "C" { extern void* _ZTVN7WebCore6WorkerE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/svg/SVGTransformList.h:31: error: virtual table of type ‘struct SVGTransformList’ violates one definition rule [-Werror=odr]
   31 | class SVGTransformList final : public SVGValuePropertyList<SVGTransform> {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSSVGTransformList.cpp:548: note: variable of same assembler name as the virtual table is defined in another translation unit
  548 | extern "C" { extern void* _ZTVN7WebCore16SVGTransformListE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/svg/SVGStringList.h:34: error: virtual table of type ‘struct SVGStringList’ violates one definition rule [-Werror=odr]
   34 | class SVGStringList final : public SVGPrimitiveList<String> {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSSVGStringList.cpp:507: note: variable of same assembler name as the virtual table is defined in another translation unit
  507 | extern "C" { extern void* _ZTVN7WebCore13SVGStringListE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/svg/SVGPointList.h:33: error: virtual table of type ‘struct SVGPointList’ violates one definition rule [-Werror=odr]
   33 | class SVGPointList final : public SVGValuePropertyList<SVGPoint> {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSSVGPointList.cpp:509: note: variable of same assembler name as the virtual table is defined in another translation unit
  509 | extern "C" { extern void* _ZTVN7WebCore12SVGPointListE[]; }
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5/Source/WebCore/svg/SVGNumberList.h:33: error: virtual table of type ‘struct SVGNumberList’ violates one definition rule [-Werror=odr]
   33 | class SVGNumberList final : public SVGValuePropertyList<SVGNumber> {
      | 
/var/tmp/portage/net-libs/webkit-gtk-2.40.5-r410/work/webkitgtk-2.40.5_build/WebCore/DerivedSources/JSSVGNumberList.cpp:509: note: variable of same assembler name as the virtual table is defined in another translation unit
  509 | extern "C" { extern void* _ZTVN7WebCore13SVGNumberListE[]; }
      | 
compilation terminated due to -fmax-errors=20.
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
```

Attaching logs.
Comment 1 ppw0 2023-10-06 05:43:06 UTC
Created attachment 872215 [details]
emerge --info
Comment 2 Mart Raudsepp gentoo-dev 2023-10-14 11:14:05 UTC
2.42 seems to compile fine with at least ThinLTO, but exhibits crashes at runtime for usage within evolution. But when it doesn't crash outside evolution, it renders at wrong scale, so it might be triggered by that for me specifically. Without LTO the crashes don't happen anymore, but the wrong scale (outside evolution) remains. Though that might be related to simpledrm framebuffer with llvmpipe, no proper graphics (e.g. screencast portal says my 27" monitor is 46" too)

Do you have trouble with 2.42.1 as well with LTO or in general?
We need to stabilize 2.42 very soon for security issues anyhow, independent of any webkit-gtk consumers, so it'd be a good additional tests if you're otherwise on stable.
Comment 3 ppw0 2023-10-14 15:39:38 UTC
(In reply to Mart Raudsepp from comment #2)
> 2.42 seems to compile fine with at least ThinLTO, but exhibits crashes at
> runtime for usage within evolution. But when it doesn't crash outside
> evolution, it renders at wrong scale, so it might be triggered by that for
> me specifically. Without LTO the crashes don't happen anymore, but the wrong
> scale (outside evolution) remains. Though that might be related to simpledrm
> framebuffer with llvmpipe, no proper graphics (e.g. screencast portal says
> my 27" monitor is 46" too)
> 
> Do you have trouble with 2.42.1 as well with LTO or in general?
> We need to stabilize 2.42 very soon for security issues anyhow, independent
> of any webkit-gtk consumers, so it'd be a good additional tests if you're
> otherwise on stable.

net-libs/webkit-gtk-2.40.5-r410 (this package) builds successfully with clang, full LTO, libstdc++, -Werror=odr and -Werror=strict-aliasing. I haven't noticed any runtime issues (yet).

In this build environment, however, net-libs/webkit-gtk-2.42.1-r410 fails with the exact same errors.
Comment 4 ppw0 2023-10-14 15:45:35 UTC
Created attachment 872798 [details]
build log (2.42.1)
Comment 5 Mart Raudsepp gentoo-dev 2023-10-18 20:23:50 UTC
The compiler error seems self-inflicted from CXXFLAGS=-Werror=odr, so I'm afraid you'll need to get your hands dirty here to figure out the cause. Maybe a difference in flex, bison or whatever tool version?

For me 2.42.1-r410 crashes at runtime on half my e-mails within mail-client/evolution (at least all gitlab and github mails) when built with ThinLTO and works fine without LTO. This is on ARM64 though, but backtraces are not inside ARM64 specific JavaScriptCore JIT or anything like that, but some rendering stuff.
Comment 6 Kostadin Shishmanov 2023-10-19 15:41:14 UTC
See also:

https://bugs.gentoo.org/866896

https://bugs.webkit.org/show_bug.cgi?id=233007
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-19 15:41:57 UTC
(In reply to Mart Raudsepp from comment #5)
> The compiler error seems self-inflicted from CXXFLAGS=-Werror=odr, so I'm
> afraid you'll need to get your hands dirty here to figure out the cause.
> Maybe a difference in flex, bison or whatever tool version?
> 

Right, self-inflicted, but the point is this isn't safe to use with LTO until it's fixed.

See https://wiki.gentoo.org/wiki/Project:Toolchain/LTO.
Comment 8 Tommy Pettersson 2023-12-17 11:43:38 UTC
Glad I found this. I got problems with www-client/surf when upgrading to webkit-gtk-2.42.3-r410.  Web pages do not render correctly to the point that the browser is useless. I could now fix it with an /etc/portage/env/nolto.conf that appends -fno-lto to CFLAGS et al for webkit-gtk:4.1.
Comment 9 Larry the Git Cow gentoo-dev 2024-01-05 12:37:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21109fa861f07a6ae06cfbed1ef2c721bfae9afd

commit 21109fa861f07a6ae06cfbed1ef2c721bfae9afd
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-01-05 12:35:53 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-05 12:35:53 +0000

    net-libs/webkit-gtk: filter LTO
    
    ODR violations thanks to Bison. Fortunately, upstream are open to fixing it,
    it just needs a hack like GDB did, or could even maybe just do --name-prefix
    or something if Bison-only is OK.
    
    Closes: https://bugs.gentoo.org/866896
    Closes: https://bugs.gentoo.org/915230
    Signed-off-by: Sam James <sam@gentoo.org>

 net-libs/webkit-gtk/webkit-gtk-2.42.3-r410.ebuild | 5 ++++-
 net-libs/webkit-gtk/webkit-gtk-2.42.3-r600.ebuild | 5 ++++-
 net-libs/webkit-gtk/webkit-gtk-2.42.3.ebuild      | 5 ++++-
 net-libs/webkit-gtk/webkit-gtk-2.42.4-r410.ebuild | 3 +++
 net-libs/webkit-gtk/webkit-gtk-2.42.4-r600.ebuild | 3 +++
 net-libs/webkit-gtk/webkit-gtk-2.42.4.ebuild      | 3 +++
 6 files changed, 21 insertions(+), 3 deletions(-)