Sign inSign up

antonioma/xsgo

By antonioma

•Updated over 7 years ago

Cross compiling toolchains for Darwin and Windows, to allow CGO x-compilations.

Image
0

10K+

antonioma/xsgo repository overview

Cross compiling toolchains for Darwin and Windows, to allow go compilations that require cgo. It's based on karalabe/xgo, removing the xgo binary, the build script and most of the utilities. So to use this you need to specify all the parameters (CC, CXX) to the specific build that you want to use.

So if you want to compile for Darwin, for example, you need to use something like:

CC=o64-clang CXX=o64-clang++ GOARCH=amd64 GOOS=darwin CGO_ENABLED=1 GOFLAGS=-mod=vendor go build -o mybinary.darwin myPackage

or to compile for Windows:

CC=x86_64-w64-mingw32-gcc-posix CXX=x86_64-w64-mingw32-g++-posix GOARCH=amd64 GOOS=darwin CGO_ENABLED=1 GOFLAGS=-mod=vendor go build -o mybinary.exe myPackage

Note that the build.sh script from xgo is included on the image also, it's just not used by default.

Tag summary

Content type

Image

Digest

Size

838.1 MB

Last updated

over 7 years ago

docker pull antonioma/xsgo