RESOLVED FIXED326282
[WPE][CMake] Link failure with ENABLE_LLVM_PROFILE_GENERATION and GNU ld: undefined ViewGestureController symbols
https://bugs.webkit.org/show_bug.cgi?id=326282
Summary [WPE][CMake] Link failure with ENABLE_LLVM_PROFILE_GENERATION and GNU ld: und...
Lauro Moura
Reported 2026-10-04 14:37:49 PDT
Building WPE with `-DENABLE_LLVM_PROFILE_GENERATION=ON` and GNU ld (bfd) fails with: UnifiedSource-UIProcess-13.cpp: undefined reference to `WebKit::ViewGestureController::didCollectGeometryForMagnificationGesture(WebCore::FloatRect, bool)' UnifiedSource-UIProcess-13.cpp: undefined reference to `WebKit::ViewGestureController::didHitRenderTreeSizeThreshold()' UnifiedSource-WebProcess-39.cpp: undefined reference to `WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture()' UnifiedSource-WebProcess-39.cpp: undefined reference to `WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold(unsigned long)' Since 314180@main, WPE is generating and compiling the message receivers for ViewGestureController and ViewGestureGeometryCollector classes. Although their headers are currently required through WebKit_SWIFT_INTEROP_SOURCES pulling UIProcess/ViewGesture.cpp, WPE generates them unconditionally in PlatformWPE.cmake. And, as WPE does not actually builds these classes, the message receivers end up having a number of real undefined references. While this generally has not been a problem in regular builds with the linkers eliminating the unused sections through `-Wl,--gc-sections`, in some scenarios, like the instrumented PGO builds, the added data (e.g. `__llvm_prf_data` records) makes bfd consider these sections reachable, keeping those undefined references (that would be dropped in regular builds). This likely flew under the radar as we tested PGO in tandem with LTO, with the latter making WebKit prefer LLD.
Attachments
Lauro Moura
Comment 1 2026-10-04 17:53:20 PDT
EWS
Comment 2 2026-10-05 04:13:47 PDT
Committed 322694@main (9fd8b013bb76): <https://commits.webkit.org/322694@main> Reviewed commits have been landed. Closing PR #75850 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.