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
go: fix cross, enable ppc64le #99511
Conversation
Sorry, I think this needs more work. This is able to cross-build a native go compiler, but breaks when trying to build a cross-compiler. |
9f06f47
to
e8fa489
Compare
Ok, this now works for cross compiling go packages and cross building the go compiler, but is still very ugly ;) |
targetCC = (if stdenv.hostPlatform == stdenv.targetPlatform | ||
then pkgsHostTarget else pkgsTargetTarget).stdenv.cc; |
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.
Please have a look: cc @Ericson2314
I don't think you should need that conditional definition of Remember that |
Hmm, well I agree it doesn't make sense, but without the targetcc hack,
|
Ah, I see the problem: that compiler isn't runnable at build time. You want |
Thank you so much, that is working beautifully now. I've kept the targetCC variable, let me know if you have a better name for it. |
The CC_FOR_TARGET will run on the host platform so should be from pkgsHostTarget.
Cross-compiled Go then works for me on ppc64le.
(tested resulting pkgsCross.powernv.go on https://github.com/cpliakas/cgo-example)
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)