how can I cross-compile to darwin 386 from linux?

2.1k views Asked by At

I am trying to compile from linux using:

GOOS=darwin GOARCH=386 CGO_ENABLED=0 go build .

but it throws the error:

cmd/go: unsupported GOOS/GOARCH pair darwin/386

I looked everywhere but it seems that darwin/386 should be supported
(compilation for windows/386 and linux/386 work fine)
(compilation for darwin/amd64 works fine)

(I even tried on windows but the error is the same)

What am I missing?

1

There are 1 answers

0
TehSphinX On

From the Go 1.15 release notes:

As announced in the Go 1.14 release notes, Go 1.15 drops support for 32-bit binaries on macOS, iOS, iPadOS, watchOS, and tvOS (the darwin/386 and darwin/arm ports). Go continues to support the 64-bit darwin/amd64 and darwin/arm64 ports.

You can use Go 1.14 to compile to darwin/386 if needed. The latest OSX versions do not run any 32bit programs any more (from Catalina). That is the reason they dropped the support: Go 1.14 release notes announced that.