-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add support for cross cc compilers #240
Conversation
Nice! You beat me to it... 😄 Note, that this is not only useful for cross-compilation, but also when using a static CC based on musl for example (think I'll have a deeper look when I found some time later... |
Nice! Thank you for looking into this!
Mainly, when we created this, we didn't know how much liberty users would need to override the details of the toolchain, e.g. see here. However, looking at the shape this is taking, and how things like
Where are you encountering difficulties? The tests for the cc-toolchain have been moved here. |
@layus What's the status on this one? What do you need to push it over the finish line? |
@layus @avdv I think I resolved the merge conflict between this PR and Pass the unwrapped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
In the current state, cc.nix is not compatible with crossPkgs and cross compilers.
This PR makes some progress by using buildPackages instead of pkgs where needed (everywhere, except stdenv.cc).
To get a cross toolchain one still needs to provide a nixpkgs with an hard-coded cross config. Alternatively, an expression that provides a cross compiler should also work without modifying the nixpkgs argument to nixpkgs_cc_configure.
But providing such an expression is difficult because the wrapper (the
buildEnv
call) needs to be duplicated. Any reason why we do not always apply it ? Worst case the user expression needs to be coaxed a bit to provide binutils, isClang and targetPrefix. Not really hard.A tricky one is also wrapCCWith. Not sure how it works in mixed setups.
Finally, I could use some help writing tests in this new repo layout.