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

gnu-efi: Use their crosscompilation support correctly #72694

Merged
merged 1 commit into from Nov 3, 2019

Conversation

kirelagin
Copy link
Member

@kirelagin kirelagin commented Nov 3, 2019

IIUC, previously, the cross-compilation support was done in a somewhat
hacky way and was, basically, special-cased for ARM.

Now we use the cross-compilation support intergrated into their own
build system.

Test:

  • nix-build --arg crossSystem '(import <nixpkgs/lib>).systems.examples.musl64' '' -A gnu-efi
Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

IIUC, previously, the cross-compilation support was done in a somewhat
hacky way and was, basically, special-cased for ARM.

Now we use the cross-compilation support intergrated into their own
build system.

Test:

* nix-build --arg crossSystem '(import <nixpkgs/lib>).systems.examples.musl64' '<nixpkgs>' -A gnu-efi
@kirelagin
Copy link
Member Author

cc @shlevy @Ericson2314

@kirelagin
Copy link
Member Author

(FTR it is also possible to set CROSS_COMPILE only when we are actually cross-compiling, but that would just result in a bunch of ifs and I don’t think is worth it.)

Copy link
Member

@shlevy shlevy left a comment

Choose a reason for hiding this comment

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

Nice!

@FRidh FRidh added this to WIP in Staging via automation Nov 3, 2019
@FRidh FRidh moved this from WIP to Needs review in Staging Nov 3, 2019
@FRidh FRidh moved this from Needs review to Ready in Staging Nov 3, 2019
"OBJCOPY=${stdenv.cc.targetPrefix}objcopy"
] ++ stdenv.lib.optional stdenv.isAarch32 "ARCH=arm"
++ stdenv.lib.optional stdenv.isAarch64 "ARCH=aarch64";
"HOSTCC=${buildPackages.stdenv.cc.targetPrefix}cc"
Copy link
Member

Choose a reason for hiding this comment

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

We mostly assume that the "build" machine's compiler (HOSTCC to gnu-efi) is just "cc", but perhaps we shouldn't in some more complicated instances. /cc @Ericson2314

Copy link
Member

Choose a reason for hiding this comment

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

@matthewbauer Yeah I think it's just more consistent to never assume, anything. Also, I am tempted to do less concrete arch processing and do build-cc cc target-cc, once we can get rid of the infix salt :D.

@Ericson2314 Ericson2314 merged commit d8cf784 into NixOS:master Nov 3, 2019
Staging automation moved this from Ready to Done Nov 3, 2019
@lopsided98
Copy link
Contributor

Dropping ARCH=arm broke the native build on armv6l. The build system is buggy and incorrectly sets ARCH=armv6l is it is not manually specified, breaking the build. The bug is easy to fix, so I submitted a patch upstream: https://sourceforge.net/p/gnu-efi/patches/71/

@lopsided98
Copy link
Contributor

See #72819

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants