Repository navigation
Commit 3c41f3f
committed
[GCC][WPE] Building with LTO fails
https://bugs.webkit.org/show_bug.cgi?id=329015
Reviewed by Yusuke Suzuki.
Building WPE with GCC and link-time optimization (LTO) fails in three places.
I tested the fixes cross-building for ARM64 with GCC 13.4 and building natively
for x86_64 with GCC 15.2.
The first one is when linking JavaScriptCore:
undefined reference to `slow_path_wasm_unwind_exception'
undefined reference to `pinballHandlerImplantSlice'
These functions, and the g_restoreFrameCalleeBoxed variable, are only used from
the assembly that offlineasm generates, which GCC doesn't look at during LTO, so
it drops them. They were just missing the REFERENCED_FROM_ASM (and WTF_INTERNAL)
that the other functions called from offlineasm already have.
The second one is when linking the WebKit library:
lto1: fatal error: missing resolution data for _ZTVN7WebCore14VisualViewportE
To check the vtable of the objects they wrap, the generated bindings declare the
vtable of each class by its mangled name as an extern "C" array. That's
undefined behaviour in C++, and GCC's LTO fails with it when the same file also
has an inline constructor or destructor of the class, while the vtable is
emitted in another file. See https://gcc.gnu.org/PR128194
Like 290697@main did for RTCDataChannel, move the constructors and destructor
of the 13 classes that hit this to their .cpp files. The constructors
of SVGNumberList, SVGPointList and SVGTransformList stay private, as the
inherited ones were, because those classes are only created through create().
The third one is a crash of GCC 13.4:
during GIMPLE pass: ccp
Source/webrtc/call/call.cc: internal compiler error: Segmentation fault
It's https://gcc.gnu.org/PR122620, fixed in GCC 13.5, 14.4 and 15.3, and it's
triggered by the constructor of JitterEstimator once LTO inlines it into its
callers. So for the GCC versions with that bug, the constructor is now marked
noipa. It only runs when a video receive stream is created, so the cost is
one extra function call per stream.
* Source/JavaScriptCore/runtime/PinballCompletion.cpp:
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
* Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.h:
* Source/JavaScriptCore/wasm/js/WebAssemblySuspending.cpp:
* Source/ThirdParty/libwebrtc/Source/webrtc/video/timing/jitter_estimator.h:
* Source/WebCore/Modules/WebGPU/GPUInternalError.cpp:
(WebCore::GPUInternalError::GPUInternalError):
* Source/WebCore/Modules/WebGPU/GPUInternalError.h:
* Source/WebCore/Modules/WebGPU/GPUValidationError.cpp:
(WebCore::GPUValidationError::GPUValidationError):
* Source/WebCore/Modules/WebGPU/GPUValidationError.h:
* Source/WebCore/Modules/screen-wake-lock/WakeLockSentinel.cpp:
* Source/WebCore/Modules/screen-wake-lock/WakeLockSentinel.h:
* Source/WebCore/Modules/webaudio/AudioParam.cpp:
* Source/WebCore/Modules/webaudio/AudioParam.h:
* Source/WebCore/animation/CSSAnimation.cpp:
* Source/WebCore/animation/CSSAnimation.h:
* Source/WebCore/animation/CustomEffect.cpp:
* Source/WebCore/animation/CustomEffect.h:
* Source/WebCore/html/canvas/Path2D.cpp:
(WebCore::Path2D::Path2D):
* Source/WebCore/html/canvas/Path2D.h:
* Source/WebCore/html/closewatcher/CloseWatcher.cpp:
* Source/WebCore/html/closewatcher/CloseWatcher.h:
* Source/WebCore/html/track/TextTrackCueGeneric.cpp:
* Source/WebCore/html/track/TextTrackCueGeneric.h:
* Source/WebCore/page/VisualViewport.cpp:
* Source/WebCore/page/VisualViewport.h:
* Source/WebCore/svg/SVGNumberList.cpp:
(WebCore::SVGNumberList::SVGNumberList):
* Source/WebCore/svg/SVGNumberList.h:
* Source/WebCore/svg/SVGPointList.cpp:
(WebCore::SVGPointList::SVGPointList):
* Source/WebCore/svg/SVGPointList.h:
* Source/WebCore/svg/SVGTransformList.cpp:
(WebCore::SVGTransformList::SVGTransformList):
* Source/WebCore/svg/SVGTransformList.h:
Canonical link: https://commits.webkit.org/324835@main1 parent 88886f0 commit 3c41f3f
31 files changed
Lines changed: 141 additions & 38 deletions
File tree
- Source
- JavaScriptCore
- runtime
- wasm
- js
- ThirdParty/libwebrtc/Source/webrtc/video/timing
- WebCore
- Modules
- WebGPU
- screen-wake-lock
- webaudio
- animation
- html
- canvas
- closewatcher
- track
- page
- svg
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 58 | + | |
| 59 | + | |
65 | 60 | | |
66 | 61 | | |
67 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 58 | + | |
| 59 | + | |
65 | 60 | | |
66 | 61 | | |
67 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
0 commit comments