RESOLVED FIXED 228876
Fix ODR violations in JSC
https://bugs.webkit.org/show_bug.cgi?id=228876
Summary Fix ODR violations in JSC
Michael Catanzaro
Reported 2021-08-06 14:33:20 PDT
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.
Attachments
Patch (3.77 KB, patch)
2021-08-06 14:36 PDT, Michael Catanzaro
no flags
Michael Catanzaro
Comment 1 2021-08-06 14:36:54 PDT
Yusuke Suzuki
Comment 2 2021-08-07 15:13:23 PDT
Comment on attachment 435090 [details] Patch r=me
EWS
Comment 3 2021-08-07 15:40:32 PDT
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].
Radar WebKit Bug Importer
Comment 4 2021-08-07 15:41:17 PDT
Note You need to log in before you can comment on or make changes to this bug.