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

Show how to get the interpreter from the gcc wrapper for patchelf #324

Merged
merged 2 commits into from Dec 28, 2019

Conversation

raboof
Copy link
Member

@raboof raboof commented Dec 28, 2019

No description provided.

Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see how this snippet can be useful to have. I don't know if it's the best place to document this.

For this to work the command would have to be executed inside of a nix-shell or a stdenv.mkDerivation. Otherwise the NIX_CC is not populated.

@zimbatm zimbatm merged commit 72a202b into NixOS:master Dec 28, 2019
@grahamc
Copy link
Member

grahamc commented Dec 28, 2019

Since this is documentation specific to Nixpkgs, maybe it should be documented in Nixpkgs? patchelf is used a lot outside of the Nix ecosystem, too.

@zimbatm
Copy link
Member

zimbatm commented Dec 28, 2019

Actually if you read the whole page it makes sense to have that example there. The page start with:

And in the Nix Packages collection we build our own Glibc, which we obviously want to use. Building programs with a different interpreter is a matter of using the linker flag -dynamic-linker:
and then

However, this doesn’t work with third-party binaries (such as Adobe Reader in Nixpkgs). This is where PatchELF comes in. You can simply rewrite the executable:

But there is no actual example of how we would do it for nixpkgs.

The wording could be a bit better but at least it ties up these references to nixpkgs.

@edolstra
Copy link
Member

I think we should remove this page and put any docs in the README.md of the patchelf repo.

@zimbatm
Copy link
Member

zimbatm commented Jan 1, 2020

Probably. The patchelf project needs some more love overall.

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

Successfully merging this pull request may close these issues.

None yet

4 participants