Skip to content
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

--set-rpath fails with “no version information available”, while exporting LD_LIBRARY_PATH works #99

Closed
michalrus opened this issue Jun 3, 2016 · 3 comments

Comments

@michalrus
Copy link
Member

michalrus commented Jun 3, 2016

So I’ve got this expression to install Transcribe!, that is distributed in binary form:

super: self:

let

  libpath = super.lib.makeLibraryPath (with super; [
    stdenv.cc.cc glib gtk2 atk pango cairo gdk_pixbuf alsaLib
    xorg.libX11 xorg.libSM libpng12 gstreamer gst_plugins_base zlib
  ]);

in

super.stdenv.mkDerivation {
  name = "transcribe-8.40";

  src = super.fetchurl {
    url = "http://www.seventhstring.com/xscribe/downlinux64/xsc64setup.tar.gz";
    sha256 = "0fqs0f2p9kbp1skgqm5sgcq9xxf6rccbm22fvka8qmpvxpsxpcbs";
  };

  buildInputs = [ super.makeWrapper ];

  dontPatchELF = true;

  installPhase = ''
    mkdir -p $out/bin
    cp transcribe $out/bin

    patchelf \
      --set-interpreter "$(cat ${super.stdenv.cc}/nix-support/dynamic-linker)" \
      --set-rpath "${libpath}" \
      $out/bin/transcribe

    #wrapProgram $out/bin/transcribe \
    #  --set LD_LIBRARY_PATH "${libpath}"
  '';
}

When I run this, I’m getting:

% transcribe
transcribe: transcribe: no version information available (required by transcribe)
[…]
transcribe: transcribe: no version information available (required by transcribe)
transcribe: symbol lookup error: transcribe: undefined symbol:
(127)%

However, after removing --set-rpath and wrapping the program in a wrapper that exports LD_LIBRARY_PATH with what was previously passed to --set-rpath, the program launches.

Also, with --set-rpath, ldd $(which transcribe) returns lots of the exact error, no version information available. After setting a proper LD_LIBRARY_PATH, it shows correct paths.

The RPATH in original binary is empty.

How can I get this to work using --set-rpath only?

@probonopd
Copy link

I might be running into the same issue, probonopd/linuxdeployqt#44

@domenkozar
Copy link
Member

domenkozar commented Jan 5, 2018

To solve this, don't run strip on resulting binary. dontStrip = true; in Nixpkgs.

I've tried using #127 and it didn't solve the issue.

@domenkozar
Copy link
Member

Sadly this expression doesn't build anymore, but all the references issues have been fixed.

Make sure to come up with a way to reproduce this if the problem still exists.

samhh added a commit to samhh/dotfiles that referenced this issue Apr 2, 2022
Stripping breaks the binary like so:
  NixOS/patchelf#99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants