-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/compile: document whether c-archive is supported on 386 #12048
Comments
The error message seems to answer the question? |
the error message shows "-buildmode=c-shared" not supported on linux/386, but "-buildmode=c-archive" |
Over to @ianlancetaylor to clarify and/or fix the error message. |
You need to tell us more. What files are in the directory in which you run the command? Are there any buildable Go source files there? |
yes,there is Go sources file ,if i just use "go build -buildmode=c-archive" without "GOARCH=386",it can build an archive file that can be linked into a C program,my Go version is go1.5rc1 |
I can not recreate the problem. Can you show a small example with the exact .go files you are using? I do see a completely different problems. When setting GOARCH with -buildmode=c-archive, you may need to add a go build argument |
Ah. By default, cross-compilers do not enable cgo, so the go tool is ignoring p/p.go since it needs cgo. You need to say CGO_ENABLED=1 GOARCH=386 go build -buildmode=c-archive |
oh,thank you |
i use "GOARCH=386 go build -buildmode=c-archive",it shows ": no buildable Go source files in"
if use "GOARCH=386 go build -buildmode=c-shared", it shows "-buildmode=c-shared not supported on linux/386"
The text was updated successfully, but these errors were encountered: