Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to compile qt with relative RUNPATH paths?
QtWS25 Last Chance

How to compile qt with relative RUNPATH paths?

Scheduled Pinned Locked Moved General and Desktop
runpathoriginconfigure
8 Posts 2 Posters 7.2k Views
  • 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.
  • M Offline
    M Offline
    Mike_Blackman
    wrote on last edited by
    #1

    Hello.

    Prebuilt Qt 5.5.0 Linux libraries have RUNPATH set to $ORIGIN.
    What configure options are used in prebuilt version?
    What configure options should i use to achieve same thing in my own Qt builds?

    chrpath libQt5Widgets.so.5.5.0
    libQt5Widgets.so.5.5.0: RUNPATH=$ORIGIN

    chrpath libqxcb.so
    libqxcb.so: RUNPATH=$ORIGIN/../../lib

    JKSHJ 1 Reply Last reply
    0
    • M Mike_Blackman

      Hello.

      Prebuilt Qt 5.5.0 Linux libraries have RUNPATH set to $ORIGIN.
      What configure options are used in prebuilt version?
      What configure options should i use to achieve same thing in my own Qt builds?

      chrpath libQt5Widgets.so.5.5.0
      libQt5Widgets.so.5.5.0: RUNPATH=$ORIGIN

      chrpath libqxcb.so
      libqxcb.so: RUNPATH=$ORIGIN/../../lib

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi @Mike_Blackman, and welcome to the Qt Dev Net!

      What configure options are used in prebuilt version?

      See http://code.qt.io/cgit/qtsdk/qtsdk.git/tree/packaging-tools/bld_config/configure_linux_opensource

      You might also be interested in this article, which talks about RPATH in built apps: http://www.tripleboot.org/?p=138

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      M 1 Reply Last reply
      0
      • JKSHJ JKSH

        Hi @Mike_Blackman, and welcome to the Qt Dev Net!

        What configure options are used in prebuilt version?

        See http://code.qt.io/cgit/qtsdk/qtsdk.git/tree/packaging-tools/bld_config/configure_linux_opensource

        You might also be interested in this article, which talks about RPATH in built apps: http://www.tripleboot.org/?p=138

        M Offline
        M Offline
        Mike_Blackman
        wrote on last edited by
        #3

        Thanks for your reply.

        @JKSH said:

        See http://code.qt.io/cgit/qtsdk/qtsdk.git/tree/packaging-tools/bld_config/configure_linux_opensource

        -opensource -confirm-license -debug-and-release -release -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -sysconfdir /etc/xdg -plugin-sql-mysql -plugin-sql-psql -plugin-sql-sqlite -openssl -dbus -no-libudev

        These configure options will produce libraries with default RUNPATH=/usr/local/Qt-5.5.0/lib.
        How to do i make RUNPATH relative?

        JKSHJ 1 Reply Last reply
        0
        • M Mike_Blackman

          Thanks for your reply.

          @JKSH said:

          See http://code.qt.io/cgit/qtsdk/qtsdk.git/tree/packaging-tools/bld_config/configure_linux_opensource

          -opensource -confirm-license -debug-and-release -release -nomake tests -nomake examples -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -sysconfdir /etc/xdg -plugin-sql-mysql -plugin-sql-psql -plugin-sql-sqlite -openssl -dbus -no-libudev

          These configure options will produce libraries with default RUNPATH=/usr/local/Qt-5.5.0/lib.
          How to do i make RUNPATH relative?

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @Mike_Blackman said:

          These configure options will produce libraries with default RUNPATH=/usr/local/Qt-5.5.0/lib.
          How to do i make RUNPATH relative?

          AFAIK, there are no configure options to set RUNPATH. Here are some ideas:

          • After building is complete, use chrpath to modify your libraries' RUNPATH
          • Modify the source code's *.pro files to pass the linker flag. Follow the tutorial I linked above -- it shows you how to make RPATH relative. Add --enable-new-dtags to set RUNPATH as well as RPATH
            • Note: I've never tried this myself on the Qt libraries, so I can't guarantee that this works. You might need to modify lots of different *.pro files in the source tree.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          M 1 Reply Last reply
          0
          • JKSHJ JKSH

            @Mike_Blackman said:

            These configure options will produce libraries with default RUNPATH=/usr/local/Qt-5.5.0/lib.
            How to do i make RUNPATH relative?

            AFAIK, there are no configure options to set RUNPATH. Here are some ideas:

            • After building is complete, use chrpath to modify your libraries' RUNPATH
            • Modify the source code's *.pro files to pass the linker flag. Follow the tutorial I linked above -- it shows you how to make RPATH relative. Add --enable-new-dtags to set RUNPATH as well as RPATH
              • Note: I've never tried this myself on the Qt libraries, so I can't guarantee that this works. You might need to modify lots of different *.pro files in the source tree.
            M Offline
            M Offline
            Mike_Blackman
            wrote on last edited by
            #5

            @JKSH said:

            AFAIK, there are no configure options to set RUNPATH.

            From configure help, additional options section:
            -R <string> ........ Add an explicit runtime library path to the Qt libraries.
            -l <string> ........ Add an explicit library.
            -no-rpath .......... Do not use the library install path as a runtime library path.
            -rpath ............. Link Qt libraries and executables using the library install path as a runtime library path. Equivalent to -R install_libpath.

            @JKSH said:

            Here are some ideas:

            • After building is complete, use chrpath to modify your libraries' RUNPATH

            There are many libraries with different relative paths to set. No way this is done manually.
            Are we missing any build steps?
            How Qt itself does it?

            How to compile "prebuilt Qt version" by yourself?

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by JKSH
              #6

              @Mike_Blackman said:

              From configure help, additional options section:
              -R <string> ........ Add an explicit runtime library path to the Qt libraries.
              -l <string> ........ Add an explicit library.
              -no-rpath .......... Do not use the library install path as a runtime library path.
              -rpath ............. Link Qt libraries and executables using the library install path as a runtime library path. Equivalent to -R install_libpath.

              These options are for RPATH. Do you want to set RPATH or RUNPATH?

              Also, could you describe why you want to set it? (If I'm not mistaken, these settings are important for the executable, but not the libraries).

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              M 1 Reply Last reply
              0
              • JKSHJ JKSH

                @Mike_Blackman said:

                From configure help, additional options section:
                -R <string> ........ Add an explicit runtime library path to the Qt libraries.
                -l <string> ........ Add an explicit library.
                -no-rpath .......... Do not use the library install path as a runtime library path.
                -rpath ............. Link Qt libraries and executables using the library install path as a runtime library path. Equivalent to -R install_libpath.

                These options are for RPATH. Do you want to set RPATH or RUNPATH?

                Also, could you describe why you want to set it? (If I'm not mistaken, these settings are important for the executable, but not the libraries).

                M Offline
                M Offline
                Mike_Blackman
                wrote on last edited by Mike_Blackman
                #7

                @JKSH said:

                These options are for RPATH.

                I have tested these options. RUNPATH value were changing.

                @JKSH said:

                Do you want to set RPATH or RUNPATH?

                It's irrelevant in my case. But, if there is a way to set both of them, i want to know it.

                @JKSH said:

                Also, could you describe why you want to set it? (If I'm not mistaken, these settings are important for the executable, but not the libraries).

                Deployment problems. My application fails to load libqxcb.so plugin, because libqxcb.so plugin fails to locate Qt libraries. Prebuilt Qt solves this problem by using relative RUNPATH value within libqxcb.so.

                Best solution i've got so far:

                1. chrpath -r '$ORIGIN' ./*.so command within Qt lib directory
                2. chrpath -r '$ORIGIN/../../lib' ./* /*.so command within Qt plugins directory

                ./* /*.so - post bug, no space here

                Sorry, i am writing this away from my Ubuntu machine and English is not my native language.

                JKSHJ 1 Reply Last reply
                0
                • M Mike_Blackman

                  @JKSH said:

                  These options are for RPATH.

                  I have tested these options. RUNPATH value were changing.

                  @JKSH said:

                  Do you want to set RPATH or RUNPATH?

                  It's irrelevant in my case. But, if there is a way to set both of them, i want to know it.

                  @JKSH said:

                  Also, could you describe why you want to set it? (If I'm not mistaken, these settings are important for the executable, but not the libraries).

                  Deployment problems. My application fails to load libqxcb.so plugin, because libqxcb.so plugin fails to locate Qt libraries. Prebuilt Qt solves this problem by using relative RUNPATH value within libqxcb.so.

                  Best solution i've got so far:

                  1. chrpath -r '$ORIGIN' ./*.so command within Qt lib directory
                  2. chrpath -r '$ORIGIN/../../lib' ./* /*.so command within Qt plugins directory

                  ./* /*.so - post bug, no space here

                  Sorry, i am writing this away from my Ubuntu machine and English is not my native language.

                  JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #8

                  @Mike_Blackman said:

                  My application fails to load libqxcb.so plugin, because libqxcb.so plugin fails to locate Qt libraries. Prebuilt Qt solves this problem by using relative RUNPATH value within libqxcb.so.

                  Sorry, I don't know what the prebuilt libraries did to the RPATH/RUNPATH. You can ask the Qt engineers in the Interest mailing list: http://lists.qt-project.org/mailman/listinfo/interest (Subscribe to the list first, then post there)

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  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