-
Notifications
You must be signed in to change notification settings - Fork 92
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
Mac下编译不了linux的binary? #30
Comments
I can confirm I run into this as well:
|
Build your code in linux, it could be more easy. |
That really defeats the point of cross-compiilation :) I primarily to dev on an Mac. I could do the release from Linux via Github Workflow actions and runner I suppose. Is there no way we can fix this in this codebase? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build ./main.go
# command-line-arguments
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: ignoring file /var/folders/m2/nwyl7pg57j378_k7qqfghmpw0000gn/T/go-link-956317668/go.o, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 )
Undefined symbols for architecture x86_64:
"__cgo_topofstack", referenced from:
__cgo_26061493d47f_C2func_getnameinfo in 000002.o
__cgo_26061493d47f_Cfunc_getnameinfo in 000002.o
__cgo_26061493d47f_C2func_getaddrinfo in 000004.o
__cgo_26061493d47f_Cfunc_gai_strerror in 000004.o
__cgo_26061493d47f_Cfunc_getaddrinfo in 000004.o
__cgo_9b69751600cf_Cfunc_WebPGetFeatures in 000018.o
__cgo_9b69751600cf_Cfunc_webpDecodeGray in 000018.o
...
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The text was updated successfully, but these errors were encountered: