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 compile from Mac to Linux #1040
Comments
Your C compiler seems not support cross compiling for Linux. |
I ended up using Docker. I don't know much about it, but I managed. Command:
And here's the important part for from dockerfile:
|
You can use zig as a cross-compiler (many references on the internet how to do it). I am on linux/amd64, so will cross-compile
You can also use, for example, |
Work for me! Macos compile to arm64-linux brew install zig
CC="zig cc -taget aarch64-linux-musl" CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build xxx.go -o executable |
Following your comment @LittleKey, I tried the same but ended up with 7 errors (warnings omitted by flag). Does anyone know how to handle this? This really looks like a problem with the bindings, in combination with the more strict zig.
|
There is a solution in this issue: #1164.
|
The text was updated successfully, but these errors were encountered: