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

elf-header: Init at <libc version> #46574

Merged
merged 3 commits into from Sep 15, 2018
Merged

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Sep 12, 2018

Motivation for this change

This is used to build software working with ELF on platforms that don't provide that header as part of their libc. This is used for Darwin->Linux cross compilation.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Sep 12, 2018

@GrahamcOfBorg eval

@Ericson2314
Copy link
Member Author

Any way to tell how to reproduce that eval failure? It looks like a darwin eval error, but it's in a package that isn't buildable on Darwin anyways. I suppose to work around that is why I put in the asserts I removed in the first place, but I now need a better solution.

@Ericson2314
Copy link
Member Author

@grahamc ^ you know that answer?

Need to get the source to get elf.h
A little shim derivation to get this header for Darwin, where it is
needed for cross compilation.

There's no real reason to do glibc and musl like that, but as I'm
maintaining it I suppose I can go overboard like that.
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: glibc

Partial log (click to expand)

/nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: glibc

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: glibc

Partial log (click to expand)

/nix/store/17b1xcgg2l2hyxh39inx6k83c3fzkxfd-glibc-2.27

@@ -13,7 +11,7 @@ let
inherit sha256;
};

ARCH = stdenvNoCC.hostPlatform.platform.kernelArch;
ARCH = stdenvNoCC.hostPlatform.platform.kernelArch or (throw "missing kernelArch");
Copy link
Member Author

Choose a reason for hiding this comment

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

Without this, there's tons of eval failures in pkgs in release.nix. This is from downstream portable packages depending on transitive glibc, since meta platform throwing is disabled.

@Ericson2314 Ericson2314 merged commit 0bfdab2 into NixOS:master Sep 15, 2018
@Ericson2314 Ericson2314 deleted the elf-header branch September 15, 2018 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants