Problem with Qt6 Xdg plugin's RPATH in deployment
-
Hello,
UsingArch Linux ARM aarch64, Kernel: Linux 6.17.0, Qt: 6.10.2, Desktop: LXQt 2.3.0.
When I had tried to use Qt CMake deployment functions to deploy my application, like this:qt_add_executable(FreePictureSplitter xxx.cpp) qt_generate_deploy_app_script( TARGET FreePictureSplitter OUTPUT_SCRIPT deploy_script NO_UNSUPPORTED_PLATFORM_ERROR ) install(SCRIPT ${deploy_script})I encountered an error which halted the deployment process:
-- Installing: /opt/FreePictureSplitter/lib/qt6/plugins/iconengines/libQt6XdgIconPlugin.so CMake Error at /usr/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:139 (file): file RPATH_SET could not write new RPATH: $ORIGIN/../../../ to the file: /opt/FreePictureSplitter/lib/qt6/plugins/iconengines/libQt6XdgIconPlugin.so No valid ELF RPATH or RUNPATH entry exists in the file; Call Stack (most recent call first): /usr/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:597 (_qt_internal_set_rpath) /usr/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:852 (_qt_internal_generic_deployqt) .qt/deploy_FreePictureSplitter_843d65e738.cmake:5 (qt6_deploy_runtime_dependencies) src/cmake_install.cmake:105 (include) cmake_install.cmake:47 (include)The command
readelf -d /usr/lib/qt6/plugins/iconengines/libQt6XdgIconPlugin.soprinted
Dynamic section at offset 0xfcd8 contains 30 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library:[libQt6XdgIconLoader.so.4] 0x0000000000000001 (NEEDED) Shared library:[libQt6Gui.so.6] 0x0000000000000001 (NEEDED) Shared library:[libQt6Core.so.6] 0x0000000000000001 (NEEDED) Shared library:[libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library:[libc.so.6] 0x000000000000000c (INIT) 0x10e8 0x000000000000000d (FINI) 0x16ac 0x0000000000000019 (INIT_ARRAY) 0x1fbf0 0x000000000000001b (INIT_ARRAYSZ) 16 (bytes) 0x000000000000001a (FINI_ARRAY) 0x1fc00 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x2a8 0x0000000000000005 (STRTAB) 0x618 0x0000000000000006 (SYMTAB) 0x2d0 0x000000000000000a (STRSZ) 1102 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000003 (PLTGOT) 0x1ff08 0x0000000000000002 (PLTRELSZ) 192 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x1028 0x0000000000000007 (RELA) 0xb60 0x0000000000000008 (RELASZ) 1224 (bytes) 0x0000000000000009 (RELAENT) 24 (bytes) 0x000000000000001e (FLAGS) BIND_NOW 0x000000006ffffffb (FLAGS_1) Flags: NOW 0x000000006ffffffe (VERNEED) 0xab0 0x000000006fffffff (VERNEEDNUM) 4 0x000000006ffffff0 (VERSYM) 0xa66 0x000000006ffffff9 (RELACOUNT) 21 0x0000000000000000 (NULL) 0x0There's no rpath info. What should I do?
-
You should it report to your distro packager or the author: https://github.com/lxqt/libqtxdg
This is not a plugin shipped directly with Qt. -
However I continuously received that error on libraries not belonging to Qt itself. For example,
/usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.sodoesn't have RPATH information, either. I'd like to ask if there's a way to limit the generic Qt deploy tool to certain Qt libraries? -
Hi, LXQt co-maintainer here. I suspect there is something wrong in Qt's CMake files. As discussed at https://github.com/lxqt/libqtxdg/issues/329,
RPATH_SETis an undocumented CMake command as mentioned at https://code.qt.io/cgit/qt/qtbase.git/commit/?id=5430fb22439db9fc1ad1df4cbf0319b63346b0a5. Moreover, the fallback patchelf approach (-DQT_DEPLOY_USE_PATCHELF=ON), works without an error. Maybe Qt should always use patchelf.