Skip to content

Guidance for unsupported DT_RPATH / DT_RUNPATH #188

@JonathonReinhart

Description

@JonathonReinhart

(Moved to https://staticx.readthedocs.io/en/latest/rpath.html)


This issue exists as a permalink to provide guidance for errors related to an unsupported use of DT_RPATH or DT_RUNPATH.

You might be here because you encountered the following error:

staticx: /path/to/libfoo.so uses unsupported DT_RUNPATH ('/usr/local/lib').
See https://github.com/JonathonReinhart/staticx/issues/188

The underlying issue is described in detail in #169. The auditing check which emits this error was added in #173.

You're receiving this error because one of the libraries that would be included in your staticx archive (either directly, or perhaps via your PyInstaller application bundle) uses a feature of the GNU dynamic linker/loader called RPATH or RUNPATH. This dynamic section entry allows a dynamic executable/library to augment/override the preconfigured library path list of the dynamic loader (ld.so). The problem is that RPATH and RUNPATH can circumvent staticx's ability to control the library path and can allow target-system libraries to be unexpectedly loaded, causing symbol errors or runtime crashes.

RPATH

RPATH is allowed as long as the path is relative to $ORIGIN (the directory where the dynamic executable lives).

If staticx is complaining about your RPATH, it's probably because your library is referencing an absolute path like /usr/local/lib. If staticx were to allow this, then the application, when run on a foreign system, would try to load some dependent libraries from the target path, and not the staticx bundle.

RUNPATH

RUNPATH is always forbidden. This is because RUNPATH causes ld.so to completely disregard not only the RPATH set by staticx at program launch, for loading child dependencies of that library.

What to do

staticx tries as hard as it can to handle this, by removing RPATH and RUNPATH that it is bundling. staticx cannot, however, modify libraries the archive of an application bundled with PyInstaller. You can try to use a different build of Python or the problematic library, one which does not use RPATH or RUNPATH.

Feel free to open an issue detailing your problems, but please understand that this is not something that staticx can readily fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy