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
cmd/go: error when building plugin with GOOS=linux under macos (cross compiling) #22452
Comments
Please include this self-contained reproducer in the report. |
@ALTree This means GOOS only support linux? In my environment, GOOS=linux, but GOHOSTOS=darwin. Does plugins support cross compiling like this? |
@xupeilin it’ll be easier to explain once you provide a runnable code sample that others can try to reproduce the issue you are seeing. |
source file: test.go
I want to compile to |
cgo is by default disabled in cross-compiling. You need to set Also I think you need a cross C compiler targeting Linux (which you probably already have), and set |
This is the reason, and now compiling can start. As @cherrymui said, I still need a cross C compiler to finish compiling...but I don't have. Thanks guys @ALTree @davecheney @cherrymui . |
Change https://golang.org/cl/73870 mentions this issue: |
Build cannot be executed. Get error
This program is a test plugin demo and can be compiled successfully under Ubuntu.
Go Version: 1.9.2
go env
The text was updated successfully, but these errors were encountered: