我可以设置GOARCH和GOOS值的任意组合以构建ELF 32位二进制文件吗?
解决方法:
GOOS = linux和GOARCH = 386.
更多示例:架构:
32-bit -> GOARCH=386
64-bit -> GOARCH=amd64
OS:
Windows -> GOOS=windows
Linux -> GOOS=linux
OS X -> GOOS=darwin
FreeBSD -> GOOS=freebsd
有关完整列表(有效的“个别”值),请参阅go/build/syslist.go
文件:
const goosList = "android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows "
const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc s390 s390x sparc sparc64 "
和GOOS GOARCH(source)的有效组合:
$GOOS $GOARCH
darwin 386
darwin amd64
darwin arm
darwin arm64
dragonfly amd64
freebsd 386
freebsd amd64
freebsd arm
linux 386
linux amd64
linux arm
linux arm64
linux ppc64
linux ppc64le
linux mips64
linux mips64le
netbsd 386
netbsd amd64
netbsd arm
openbsd 386
openbsd amd64
openbsd arm
plan9 386
plan9 amd64
solaris amd64
windows 386
windows amd64