-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
--replace-needed calls corrupt these executables #158
Comments
It seems that the released version (https://github.com/NixOS/patchelf/releases/tag/0.9) doesn't reproduce this issue. That should help with the troubleshooting, it's probably possible to bisect the offending commit. We upgraded because we were experiencing other issues:
(I don't have the full build output now, unfortunately). This latter problem doesn't happen with the latest commit. |
It also works (with 27ffe8a) if I invoke patchelf multiple times with single |
Tried to patch a weird .node elf library whatever and got a similiar error |
@Jikstra try the commit I mentioned, maybe it will work in your case. Unfortunately it seems it has other issues in some cases (as in this very bug report). I don't know how active patchelf is, it seems there are no responses to the issues unfortunately. I recommend checking out the LIEF framework, it has an easy Python interface and can accomplish all of what patchelf does. I did run into a couple issues with that as well. It seems like this is just a really hard problem to get right. We steered away from binary patching as much as we could and instead we patch build systems to emit the right thing (when needed). |
@sztomi thanks for your reply (it has been some days, came back to the exact same problem 2 weeks ago ^^) but sadly this commit also doesn't help. |
It would be great if someone can try with latest master and report back what is left to fix here. |
@domenkozar the binaries I shared are still downloadable through the links in my first post. Happy to check for you, but it's probably more effective if you try those yourself (especially if the bug is still present). |
Can still reproduce. |
@domenkozar in that case I suggest bisecting from the 0.9 tag (because that one didn't have this issue). |
Does #335 effectively fixes this (PR that replaced #237) ? It seems to resolve a similar issue in pypa/auditwheel#401 |
patchelf version: Built from 27ffe8a
In our build process, we try to remove all version numbers from the shared objects names of our various dependencies. We use patchelf to fix the referenced sonames everywhere. This seems to work well for the most part, but we noticed one particular example where it corrupts the executable.
In the first case, there were no version numbers in the sonames, so the rewriting is redundant (i.e. we can avoid it). Download the binary here
Notice how
libavcodec.so
becamebavcodec.so
etc.In the second case, there are numbers to strip. Download the binary here
As you can see, the replacements are all over the place in this case. The issue is 100% reproducible with the binaries I posted. Let me know if I can provide more information.
The text was updated successfully, but these errors were encountered: