-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly handle RPATH $ORIGIN #75
Conversation
Note: I still need to test this on PyInstaller applications, like #61 referred to. I'm pretty sure it won't work because |
@JonathonReinhart I just tested this branch with application built with pyinstaller. I can confirm that this fix won't work for pyinstaller bundles. |
I can confirm that too. What is the status here? Unfortunately I am not really in the topic in python. btw: Thank you for this project ;) Adding
... results in
Example |
a996976
to
3901078
Compare
This should hopefully shake out bugs related to Pyinstaller + RPATH
Libraries and applications can use RPATH $ORIGIN to indicate that their dependencies are in a path relative to them. If staticx moves/copies the application, then ld.so won't be able to find the dependencies. Fixes #61
Some of the dependencies may not have been extracted yet.
3901078
to
ed5ccaa
Compare
This emulates the behavior of the PyInstaller bootloader: https://github.com/pyinstaller/pyinstaller/blob/v3.4/bootloader/src/pyi_utils.c#L808-L811 This is necessary because some shared objects may depend on other shared objects in the PyInstaller archive. Without this change, Staticx would still build a valid program (because there are no additional dependencies in this case), but ldd would report a missing library. Fixes additional cases reported in #61.
ed5ccaa
to
a0b377b
Compare
This makes a number of fixes which all revolve around using
ldd
to discover dependencies:ldd
on executables in their original locations, rather than after they're copied temp directory. This is important if they useRPATH
which includes$ORIGIN
LD_LIBRARY_PATH
to the temporary directory where we extract files from the PyInstaller archiveFixes #61