-
Notifications
You must be signed in to change notification settings - Fork 18k
mac m1 can not run cgo #45772
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
Comments
The darwin/arm64 port supports cgo. Could you provide the instruction to reproduce this, including the program you are building? Thanks. |
The environment variable of my IDE is like this: My version of the clang compiler like this: |
What IDE is it? Do you know what commands does it run when you build your program? Could you capture the full error message? And what is the program source code? Thanks. |
Similar issue, same env variables, clang compiler: I'm trying to build wireguard's go kit and it misses symbols for arm64 in runtime/cgo:
|
@ChristianOrgler are you building for macOS or iOS? The references of those two functions should only appear if TARGET_OS_IPHONE is #defined. Could you share your environment when running the |
I'm building for iOS - yet I figured out that the culprit is with the Makefile of the vendor not GO in particular. |
What version of Go are you using (
go version
)?go env
OutputWhat did you do?
Undefined symbols for architecture arm64:
"_create_byte_array", referenced from:
__cgo_21bc20011f30_Cfunc_create_byte_array in _x002.o
(maybe you meant: __cgo_21bc20011f30_Cfunc_create_byte_array)
"_decrypt", referenced from:
__cgo_21bc20011f30_Cfunc_decrypt in _x002.o
(maybe you meant: __cgo_21bc20011f30_Cfunc_decrypt)
"_get_key", referenced from:
__cgo_21bc20011f30_C2func_get_key in _x002.o
__cgo_21bc20011f30_Cfunc_get_key in _x002.o
(maybe you meant: __cgo_21bc20011f30_Cfunc_get_key, __cgo_21bc20011f30_C2func_get_key )
"_release_byte_array", referenced from:
__cgo_21bc20011f30_Cfunc_release_byte_array in _x002.o
(maybe you meant: __cgo_21bc20011f30_Cfunc_release_byte_array)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The text was updated successfully, but these errors were encountered: