-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
cgo: cross-compilation #1020
Comments
Would it be possible to specify the toolchain itself? The reason is I worry that relying on things like |
hey @ianthehat, any good news for the new year ? :) |
Not even looked at this yet I am afraid |
(Re-triaging old issues) This should work, at least theoretically. You can target a platform with Leaving this issue open because we don't have adequate test coverage or documentation yet. |
Hello @jayconrod , These are the flags I was using: We are trying to cross-compile for darwin on Linux; my experiment is done on darwin and the result is the same. Thanks in advance! |
@devastating The |
@jayconrod It works on MacOS - however, when I tried to really cross-compile on Linux, I got the error:
Did the "_cgo" build feature not support cross-compilation? We are using bazel 1.1.0 release. |
I guessed I will have to wait until #1642 is close.. |
Hey, this issue has been open for a while, is cross compiling cgo still not doable today? |
It is if you supply your own C toolchain. Alternatively, you can try this approach: https://dev.to/kristoff/zig-makes-go-cross-compilation-just-work-29ho |
This is currently not possible, as we can only build the standard library in "pure" mode if we are cross compiling.
In theory there is no reason to limit this quite so much, but we need a way to pick the pure version of the standard library when cross compiling without having to compile all libraries in pure mode.
The text was updated successfully, but these errors were encountered: