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

Cross binutils #25232

Merged
merged 6 commits into from May 17, 2017
Merged

Cross binutils #25232

merged 6 commits into from May 17, 2017

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Apr 26, 2017

Motivation for this change

There's a lot more consistency now:

  • binutils binaries are always prefixed, when compiling from Darwin and Linux alike
  • binutils + cctools are always mixed together the same way if Darwin is the target

And there are tests to insure the darwin-targeting binutils+cctools mashups do build.

The main question is whether we want to so prefix the binutils derivation name, or adopt another convention distinguished from the existing build != host suffixes.

Builds on #25227, factored out of #25047

Things done

@mention-bot
Copy link

@Ericson2314, thanks for your PR! By analyzing the history of the files in this pull request, we identified @viric, @dezgeg and @copumpkin to be potential reviewers.

@Ericson2314 Ericson2314 assigned shlevy and Ericson2314 and unassigned shlevy and Ericson2314 Apr 26, 2017
@Ericson2314 Ericson2314 added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Apr 26, 2017
@Ericson2314
Copy link
Member Author

@shlevy its hanging and won't let me request a review from you, so I'm doing it here.

@Ericson2314
Copy link
Member Author

Ericson2314 commented Apr 26, 2017

Two issues are:

  • My previously-merged triple parsing see the mingw stuff as ambiguous. A change in this PR forces that thunk causing mingw builds to fail. The triple can be fixed CC @taktoa

  • the ios-cross stuff is broken because cc-wrapper doesn't support the prefixing. The original PR fully fixes cc-wrapper for all cross, but some linux tests break because of missing attributes. I do have a commit that props of cc-wrapper a bit---enough for ios-cross to build---though adding it causes more churn. CC @shlevy

@@ -14,7 +14,7 @@ let
float = "soft";
withTLS = true;
libc = "glibc";
platform = lib.systems.platforms.sheevaplug;
platform = pkgsNoParams.platforms.sheevaplug;
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't you just merge a PR to master that did the opposite change (pkgsNoParame -> lib.systems)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah all my rebasing runs the risk of stuff like this. Good catch.

@taktoa
Copy link
Member

taktoa commented Apr 26, 2017

@Ericson2314 I never bothered to fix the parser for mingw32, and am fairly busy with other stuff at the moment. It should be easy though.

@Ericson2314 Ericson2314 force-pushed the cross-binutils branch 3 times, most recently from 3522058 to a922461 Compare April 27, 2017 20:51
@Ericson2314
Copy link
Member Author

Fixed up mingw32 so there's no longer any regressions.

@Ericson2314 Ericson2314 force-pushed the cross-binutils branch 2 times, most recently from 3390044 to ab5f3a8 Compare May 17, 2017 17:57
@Ericson2314
Copy link
Member Author

Ok rebased this on merged (and remerged, welp) other PRs. Also re-ran the hydra job to ensure everything is ship-shape (so far, so good).

This is a cross derivation---it's built on one platform to run on
another---so let's structure it like all the other cross derivations.
 - No more *Cross duplication for binutils on darwin either.
   `cctools_cross` is merged into plain `cctools`, so `buildPackages`
   chains alone are used to disambiguate.

 - Always use a mashup of cctools and actual GNU Binutils as `binutils`.
   Previously, this was only done in the native case as nobody had
   bothered to implement the masher in the cross case. Implemented it
   basically consisted of extending the wrapper to deal with prefixed
   binaries.
We want platform triple prefixes and suffixes on derivation names to
be used consistently. The ideom this commit strives for is

 - suffix means build != host, i.e. cross *built* packages. This is
   already done.

 - prefix means build != target, i.e. cross tools. This matches the
   tradition of such binaries themselves being prefixed to disambiguate.]
   Binutils and cctools, as build tools, now use the latter
Previously this was just done on Darwin.
This does a decent job of testing everything in this PR up to here.
Something better should be done longer term to support such version
suffixes.
@Ericson2314
Copy link
Member Author

Ok I think the remaining builds are stalled or something, and I didn't operate hydra correctly to restart. This all worked before I rebased, and "by parametricity" the remaining builds should also work fine, and nobody reviewed up or down while I was out of town, so... merging!

@Ericson2314 Ericson2314 merged commit bec5ffe into NixOS:master May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different sort platform than than they will be run on
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants