Open jtojnar opened 5 years ago
Likely the same issue as https://github.com/NixOS/patchelf/issues/45
It does indeed look like #45, which arises for example in several Rpackages like Seurat. It'd be good to see if there are any similarities to narrow down what causes patchelf to output wrong binaries.
@jtojnar could you try again with master (or patchelfUnstable in nixpkgs)?
Can still reproduce with /nix/store/xlkfqvahjpd2cm7kysy1g43gcw9pjgja-patchelf-2020-06-03
on NixOS/nixpkgs@fd9d37e271e9d98189ffa7e52abf163384eb67b5:
with import ./. { };
with pkgs;
let
deadbeef = fetchFromGitHub {
owner = "DeaDBeeF-Player";
repo = "deadbeef";
rev = "1.8.0";
sha256 = "126i5qlkpv7pvi1mmc9y0jhqs6jjspsj7j615n2ddvsb2jsps81c";
};
in runCommand "patchelf" {
buildInputs = [ patchelfUnstable gcc ];
} ''
cp -r ${deadbeef} source
chmod -R u+w -- source
cd source/plugins/wildmidi
gcc -ggdb -shared -Iinclude -DWILDMIDI_VERSION=\"0.2.2\" -DWILDMIDILIB_VERSION=\"0.2.2\" -DTIMIDITY_CFG=\"/etc/timidity.conf\" -fPIC wildmidiplug.c src/wildmidi_lib.c include/wildmidi_lib.h -o wildmidi.so -lm
mkdir $out
cp wildmidi.so $out/wildmidi-patched.so
cp wildmidi.so $out/wildmidi.so
patchelf --shrink-rpath $out/wildmidi-patched.so
echo "These should be the same:"
nm -A -D -l $out/wildmidi.so | grep wildmidi_lib.c:399
nm -A -D -l $out/wildmidi-patched.so | grep wildmidi_lib.c:399
echo "^ The symbol should not have been renamed to X."
''
It would be helpful if you can also try 0.9 as the linked issue says it used to work.
I originally reproduced this with 0.9. Just tried it again to be sure and replacing patchelfUnstable
by patchelf
in the example above indeed does not fix the issue.
patchelf --shrink-rpath
renames global variable symbol breaking DeaDBeeF’s wildmidi plug-in.This is the variable in question:
https://github.com/DeaDBeeF-Player/deadbeef/blob/7ac83fb204fc3c8a35486ef8f9550cd98cec674e/plugins/wildmidi/src/wildmidi_lib.c#L399
Compare the patched and unpatched libraries:
Here is the reproducible: