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

binutils: Fix cross, again #33186

Merged
merged 3 commits into from Dec 29, 2017
Merged

Conversation

Ericson2314
Copy link
Member

Motivation for this change

It's been broken since I made it multi-arch, but this fixes it. Making this a separate PR to lessen the diff, and in case anything breaks later.

Things done

Tested exhaustively in #26805.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

bgamari and others added 3 commits December 29, 2017 17:32
Binutils is patched so we don't rely on `--rpath-link`.
This ensures we by-default cross-compile to the intended platform.
@Ericson2314 Ericson2314 added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Dec 29, 2017
@@ -164,6 +164,20 @@ stdenv.mkDerivation {
set +u
'';

emulation = let
Copy link
Member Author

Choose a reason for hiding this comment

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

I think I will move this to the lib, with some of the other misc per-tool stuff / provide a way for {build,host,target}Platform (e.g. via crossConfig) to override it. That, however, is a non-hash-breaking change so no reason to rush it now.

@@ -53,6 +53,14 @@ stdenv.mkDerivation rec {
# elf32-littlearm-vxworks in favor of the first.
# https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766
./disambiguate-arm-targets.patch

Copy link
Member Author

Choose a reason for hiding this comment

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

I or @bgamari should email upstream cause the default behavior is insane.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have reported this at https://sourceware.org/bugzilla/show_bug.cgi?id=22458, with no response so far. (Said so in #30484 (comment).)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, you meant always-search-rpath.patch below.

@Ericson2314 Ericson2314 merged commit eb27be0 into NixOS:staging Dec 29, 2017
@Ericson2314 Ericson2314 deleted the cross-binutils branch December 29, 2017 22:42
@Ericson2314 Ericson2314 requested review from edolstra and removed request for edolstra December 29, 2017 22:42
@Ericson2314 Ericson2314 added this to Needed by the big PR---nice to move pick off pieces of it and move here, rebasing the big PR on top in Cross compilation Dec 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Cross compilation
Needed by the big PR---nice to move p...
Development

Successfully merging this pull request may close these issues.

None yet

4 participants