| Summary: | Fix ODR violations in JSC | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> | ||||
| Component: | JavaScriptCore | Assignee: | Michael Catanzaro <mcatanzaro> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ews-watchlist, keith_miller, mark.lam, mcatanzaro, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=229867 | ||||||
| Attachments: |
|
||||||
Created attachment 435090 [details]
Patch
Comment on attachment 435090 [details]
Patch
r=me
Committed r280761 (240346@main): <https://commits.webkit.org/240346@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 435090 [details]. |
When built with LTO enabled, GCC will warn about violations of C++'s one-definition rule. JSC currently has two violations. The first is JSC::SpeciesConstructResult, which has two different declarations: runtime/ArrayPrototype.cpp:enum class SpeciesConstructResult { runtime/JSArrayBufferPrototype.cpp:enum class SpeciesConstructResult : uint8_t { There are usually several different ways to fix any particular ODR violation, starting with renaming one or the other use. I decided to add : uint8_t to the version in ArrayPrototype.cpp to make the declarations match. I could alternatively have placed them in anonymous namespaces to restrict them to file scope. The next problem is JSC::SignalContext. We have two different versions of this struct, one in VMTraps.cpp and the other in SigillCrashAnalyzer.cpp. In this case, I decided the simplest approach would be to change the one in VMTraps.cpp from JSC::SignalContext to JSC::VMTraps::SignalContext.