When I try to cross compile my golang project from OSX to Linux, then I get following error message:
ld: unknown option: --build-id=none
clang: error: linker command failed
and the compilation aborts.
This is how I try to build my application:
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build
I also tried using gox:
but it still did not work.
Everything works as expected if I do not use the
GOOS=linux tag and I am able to build/run my project for/on my OSX machine successfully.