Bug 312154

Summary: qtwpe link failure: undefined reference to `WTF::CString::CString(char const*)'
Product: WebKit Reporter: tusooa
Component: WPE WebKitAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, philn
Priority: P2    
Version: WebKit Local Build   
Hardware: PC   
OS: Linux   

tusooa
Reported 2026-04-13 06:25:44 PDT
Configure with: CC=/usr/lib/ccache/bin/gcc CXX=/usr/lib/ccache/bin/g++ cmake -DPORT=WPE -DCMAKE_INSTALL_PREFIX=/home/user/Install/packages/wpewebkit -DENABLE_WPE_QT_API=ON -DENABLE_JOURNALD_LOG=OFF .. -GNinja -DCMAKE_BUILD_TYPE=Release -DUSE_LIBBACKTRACE=OFF -DENABLE_WPE_PLATFORM=ON -DENABLE_WPE_1_1_API=OFF (Gentoo GNU/Linux, GCC 15.2.1, cmake 4.2.4) It gives the following link-time error: [0/2] Re-checking globbed directories... [10/26] Linking CXX shared library lib/libqtwpe.so FAILED: [code=1] lib/libqtwpe.so : && /usr/lib/ccache/bin/g++ -fPIC -fdiagnostics-color=always -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-subobject-linkage -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare -fasynchronous-unwind-tables -fno-strict-aliasing -fno-exceptions -fno-rtti -fcoroutines -ffunction-sections -fdata-sections -O3 -DNDEBUG -shared -Wl,--no-undefined -Wl,--gc-sections -Wl,--disable-new-dtags -Wl,--dependency-file=Source/WebKit/CMakeFiles/qtwpe.dir/link.d -Wl,-soname,libqtwpe.so -o lib/libqtwpe.so Source/WebKit/CMakeFiles/qtwpe.dir/qtwpe_autogen/mocs_compilation.cpp.o Source/WebKit/CMakeFiles/qtwpe.dir/UIProcess/API/wpe/qt6/WPEDisplayQtQuick.cpp.o Source/WebKit/CMakeFiles/qtwpe.dir/UIProcess/API/wpe/qt6/WPEToplevelQtQuick.cpp.o Source/WebKit/CMakeFiles/qtwpe.dir/UIProcess/API/wpe/qt6/WPEViewQtQuick.cpp.o Source/WebKit/CMakeFiles/qtwpe.dir/UIProcess/API/wpe/qt6/WPEQmlExtensionPlugin.cpp.o Source/WebKit/CMakeFiles/qtwpe.dir/UIProcess/API/wpe/qt6/WPEQtView.cpp.o Source/WebKit/CMakeFiles/qtwpe.dir/UIProcess/API/wpe/qt6/WPEQtViewLoadRequest.cpp.o -Wl,-rpath,/home/user/Code/WebKit/build-rel/lib: /usr/lib64/libepoxy.so /usr/lib64/libglib-2.0.so /usr/lib64/libgobject-2.0.so lib/libWPEWebKit-2.0.so.1.10.0 lib/libSkia.a /usr/lib64/libfreetype.so /usr/lib64/libfontconfig.so /usr/lib64/libwebpmux.so /usr/lib64/libwebp.so /usr/lib64/libexpat.so /usr/lib64/libharfbuzz.so /usr/lib64/libjpeg.so /usr/lib64/libpng.so /usr/lib64/libz.so /usr/lib64/libgmodule-2.0.so /usr/lib64/libglib-2.0.so /usr/lib64/libsoup-3.0.so /usr/lib64/libwpe-1.0.so /usr/lib64/libseccomp.so /usr/lib64/libgstreamer-1.0.so /usr/lib64/libQt6Quick.so.6.10.2 /usr/lib64/libQt6OpenGL.so.6.10.2 /usr/lib64/libQt6Gui.so.6.10.2 /usr/lib64/libepoxy.so /usr/lib64/libxkbcommon.so /usr/lib64/libQt6QmlMeta.so.6.10.2 /usr/lib64/libQt6QmlModels.so.6.10.2 /usr/lib64/libQt6QmlWorkerScript.so.6.10.2 /usr/lib64/libQt6Qml.so.6.10.2 /usr/lib64/libQt6Network.so.6.10.2 /usr/lib64/libQt6Core.so.6.10.2 && cd /home/user/Code/WebKit/build-rel/Source/WebKit && /usr/bin/cmake -E copy /home/user/Code/WebKit/build-rel/lib/libqtwpe.so /home/user/Code/WebKit/build-rel/lib/qt6/qml/org/wpewebkit/qtwpe && cd /home/user/Code/WebKit/build-rel/Source/WebKit && /usr/bin/cmake -E copy /home/user/Code/WebKit/Source/WebKit/UIProcess/API/wpe/qt6/qmldir /home/user/Code/WebKit/build-rel/lib/qt6/qml/org/wpewebkit/qtwpe /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: Source/WebKit/CMakeFiles/qtwpe.dir/UIProcess/API/wpe/qt6/WPEDisplayQtQuick.cpp.o: in function `wpeDisplayQtQuickConnect(_WPEDisplay*, _GError**)': WPEDisplayQtQuick.cpp:(.text._ZL24wpeDisplayQtQuickConnectP11_WPEDisplayPP7_GError+0xf8): undefined reference to `WTF::CString::CString(char const*)' /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: WPEDisplayQtQuick.cpp:(.text._ZL24wpeDisplayQtQuickConnectP11_WPEDisplayPP7_GError+0x132): undefined reference to `WTF::CString::CString(char const*)' /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: WPEDisplayQtQuick.cpp:(.text._ZL24wpeDisplayQtQuickConnectP11_WPEDisplayPP7_GError+0x234): undefined reference to `WTF::fastFree(void*)' /usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: WPEDisplayQtQuick.cpp:(.text._ZL24wpeDisplayQtQuickConnectP11_WPEDisplayPP7_GError+0x264): undefined reference to `WTF::fastFree(void*)' collect2: error: ld returned 1 exit status [13/26] Generating documentation: WPEJavaScriptCore ninja: build stopped: subcommand failed.
Attachments
Philippe Normand
Comment 1 2026-04-14 11:58:53 PDT
Maybe that code should be migrated to CStringView.
tusooa
Comment 2 2026-04-14 14:28:46 PDT
https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_device_query.txt says that the pointer returned from eglQueryDeviceStringEXT points to static data. Is there any reason to use CString to make the wpeDisplayQtQuickConnect function own the data (for just a little bit)? For example, will a subsequent eglQueryDeviceStringEXT overwrite the pointed-to data returned from the first query? If it is the case, I feel that we can replace CString with std::string or similar. Otherwise, CStringView should be usable because relevant functions are all header-only. The two variables are very soon passed to wpe_drm_device_new, which then uses CString to copy and own the data.
tusooa
Comment 3 2026-04-15 10:49:09 PDT
tusooa
Comment 4 2026-04-15 10:52:05 PDT
(In reply to Philippe Normand from comment #1) > Maybe that code should be migrated to CStringView. I submitted a patch, please let me know if my reasoning in it is sound, thanks
EWS
Comment 5 2026-04-15 12:59:49 PDT
Committed 311311@main (ea9518d268c2): <https://commits.webkit.org/311311@main> Reviewed commits have been landed. Closing PR #62829 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.