XMLWordPrintable

Details

    • Sub-task
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • Documentation
    • None
    • X11 documentation rpath LD_LIBRARY_PATH deployment

    Description

      The doc related to deploying qt apps on X11 http://doc.qt.nokia.com/4.6/deployment-x11.html is very helpful but could be improved.

      I have two issues with it.

      First, the paragraph related « hard coded search path » (use of gcc's -rpath option) may be udpated.
      Indeed, the dynamic loader accepts (AFAIK most of them...) the cookie $ORIGIN in rpath, allowing to give a path that is related to the app's executable file path.
      This is similar to Mac's "@executable_path" for install_name_tool.
      Indeed, this could be use to tell the loader where dynamic libraries shipped with the app's distribution are.
      The doc should say something about this rpath's $ORIGIN cookie, and, if this solution is not appropriate, indicate why.

      Second, the doc recommends using a startup script that modifies LD_LIBRARY_PATH.
      OK.
      However, when Qt's building system uses « hard coded search path » for Qt dynamic libraries, with the gcc's -rpath option, then this search path will override LD_LIBRARY_PATH at run time.
      Indeed, when using the precompiled Qt's SDK, qmake automatically uses rpath to tell the loader where the qt library is.
      In this case, even using a startup scrip and LD_LIBRARY_PATH will not override the rpath.
      This is a problem, since it makes it impossible to eg test the correctness of the "distribution" on the machine on which it has been compiled, since the library the loader will use are the SDK's libraries and not those that should have been copied into the app's distribution.
      I have spent one full day on this issue. Perhaps it is worth:

      • reporting this problem, eg indicate that if rpath is used at build time, then the start up script would not work appropriately
      • indicating that the hard coded paths can be removed by using tools such as chrpath, and should be remove when making the app's distribution from the compiled app.

      I hope this is clear enough and may help.
      Best-

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            docteam Qt Documentation Team
            castagne Nicolas Castagne
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes