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

Workaround for when PatchELF fails? #68

Open
chris-martin opened this issue Sep 30, 2015 · 4 comments
Open

Workaround for when PatchELF fails? #68

chris-martin opened this issue Sep 30, 2015 · 4 comments

Comments

@chris-martin
Copy link

Sorry if this question is off-topic, but I figure anyone working on this project would know the answer (and anyone using this project probably could benefit from the answer).

I'm trying to run Otto on NixOS and I'm blocked by issues #38 and/or #66. So I'm wondering what are the alternatives to PatchELF in cases where it doesn't work?

The only workaround I've come up with so far is to symlink ld-linux-x86-64.so.2 from /nix/store/... to /lib64/, which is pretty ugly.

@darealshinji
Copy link
Contributor

It should be possible to run a binary directly with /nix/store/<...>/ld-linux-x86-64.so.2 /nix/store/<...>/<program>. You might have to overwrite the LD_LIBRARY_PATH variable too.

@chris-martin
Copy link
Author

When I run nix/store/.../ld-linux-x86-64.so.2 ./otto, it halts immediately with no output.

@chris-martin
Copy link
Author

In case this is of any help:

> /nix/store/.../ld-linux-x86-64.so.2 --list ./otto
        linux-vdso.so.1 (0x00007ffc9c7c3000)
        libpthread.so.0 => /nix/store/.../libpthread.so.0 (0x00007febb77c9000)
        libc.so.6 => /nix/store/.../libc.so.6 (0x00007febb7429000)
        /lib64/ld-linux-x86-64.so.2 => /nix/store/.../ld-linux-x86-64.so.2 (0x00007febb79e6000)

@phunehehe
Copy link

Very anecdotal, but what @darealshinji said in #68 (comment) worked for me. I ended up using a wrapper to the effect of exec $(cat $NIX_CC/nix-support/dynamic-linker) $orig $@.

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