Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Problem with Qt6 Xdg plugin's RPATH in deployment
Qt 6.11 is out! See what's new in the release blog

Problem with Qt6 Xdg plugin's RPATH in deployment

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
6 Posts 4 Posters 361 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Grit ClefG Offline
    Grit ClefG Offline
    Grit Clef
    wrote on last edited by Grit Clef
    #1

    Hello,
    Using Arch 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.so
    

    printed

    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)               0x0
    

    There's no rpath info. What should I do?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • Grit ClefG Offline
        Grit ClefG Offline
        Grit Clef
        wrote on last edited by
        #3

        Reported, thanks.

        1 Reply Last reply
        0
        • Grit ClefG Offline
          Grit ClefG Offline
          Grit Clef
          wrote on last edited by
          #4

          However I continuously received that error on libraries not belonging to Qt itself. For example, /usr/lib/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so doesn'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?

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            yan12125
            wrote on last edited by
            #5

            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_SET is 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.

            1 Reply Last reply
            1
            • K Offline
              K Offline
              kevin009
              wrote last edited by
              #6

              The problem is that RPATH_SET can't set a RUNPATH if it doesn't already exist. It will only overwrite an existing value.

              patchelf, however, will do this. So, as @yan12125 says, QT_DEPLOY_USE_PATCHELF=ON should work.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved