0

https://github.com/mattn/go-sqlite3/

Can't find the correct go build compiler arguments for OSX to linux using the clang compiler, help greatly appreciated thx

% env GOOS=linux CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static"
# runtime/cgo
ld: unknown option: --build-id=none
clang: error: linker command failed with exit code 1 (use -v to see invocation)

% env GOOS=linux CGO_ENABLED=1 go build
# runtime/cgo
ld: unknown option: --build-id=none
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Note that a plain go build without cross compiling works

Gert Cuykens
  • 6,845
  • 13
  • 50
  • 84
  • 1
    You haven't set `CC_FOR_TARGET`. Do you have the toolchain necessary to cross-compile C programs for Linux at all? – JimB Oct 03 '17 at 13:06
  • 2
    BTW, it's far easier to just build it in a Docker container. – JimB Oct 03 '17 at 13:08
  • 1
    You right building it in a Docker container seem to work, don't know enough about clang compiler to confirm if i have all the tools needed. I guess i do but don't know for sure. Feel free to collaborate and maybe pull request the readme go-sqlite3 to help others thx – Gert Cuykens Oct 03 '17 at 13:17

0 Answers0