Skip to content
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

crosscompile on darwin for linux: undefined symbols #38

Closed
iharsuvorau opened this issue Jun 5, 2018 · 1 comment
Closed

crosscompile on darwin for linux: undefined symbols #38

iharsuvorau opened this issue Jun 5, 2018 · 1 comment

Comments

@iharsuvorau
Copy link

I would be very happy if someone can post a recipe how to build this pkg on OS X for linux?

Running this

GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -v .

on my program which uses the package fails with the message:

/usr/local/Cellar/go/1.10.2/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: ignoring file /var/folders/9k/vjqfzdjs31ng3nljg71nmnxm0000gn/T/go-link-939718562/go.o, file was built for unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): /var/folders/9k/vjqfzdjs31ng3nljg71nmnxm0000gn/T/go-link-939718562/go.o
Undefined symbols for architecture x86_64:
  "__cgo_topofstack", referenced from:
      __cgo_f7895c2c5a3a_C2func_getnameinfo in 000002.o
      __cgo_f7895c2c5a3a_Cfunc_getnameinfo in 000002.o
      __cgo_f7895c2c5a3a_C2func_getaddrinfo in 000004.o
      __cgo_f7895c2c5a3a_Cfunc_gai_strerror in 000004.o
      __cgo_f7895c2c5a3a_Cfunc_getaddrinfo in 000004.o
      __cgo_52a37432605b_Cfunc_add in 000018.o
      __cgo_52a37432605b_Cfunc_composite 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)

There is a similar question on stackoverflow but it has no answer too.

@tonimelisma
Copy link
Collaborator

Hey @iharsuvorau - apologies for the super long delay. MacOS build instructions are now in the readme and you shouldn't have any problems building there. We've recently integrated a bunch of new functionality and bug fixes and macOS is a supported platform - hope you're willing to try again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants