可以在Solaris 5.10上使用Golang吗?

huangapple go评论70阅读模式
英文:

Can I use golang on Solaris 5.10?

问题

我正在尝试在Solaris 5.10 i86c (x86 + x86_64)上使用golang,但是我找不到适用于Solaris的软件包。

此外,我想要创建一个在Solaris 5.10系统上运行的Filebeat的二进制文件。当前发布的Filebeat (amd64)在我的Solaris发行版上无法工作。

有人可以给我一点指导吗?

英文:

I'm trying to use golang on Solaris 5.10 i86c (x86 + x86_64) but I can't find a package made for Solaris.

In addition, I want this to make a binary file for Filebeat which runs in Solaris 5.10 systems. The actual release of Filebeat (amd64) doesn't work on my Solaris distro.

Anyone can guide me a little bit?

答案1

得分: 3

Go支持在amd64架构上的Solaris 11,但不支持sparc架构。要在sparc架构上构建,您需要使用gccgo。

要为Solaris/amd64构建纯Go项目,可以使用以下命令:

$ GOOS=solaris GOARCH=amd64 go build

有关在Solaris上使用Filebeat的更多信息,请参见此答案https://stackoverflow.com/a/37419289/503798(其中包含一个针对Solaris 11/amd64的Filebeat二进制文件的链接)。

英文:

Go supports Solaris 11 on amd64, but not sparc. To build for sparc you need to use gccgo.

To build a pure Go project for Solaris/amd64 you can use:

$ GOOS=solaris GOARCH=amd64 go build

See this answer https://stackoverflow.com/a/37419289/503798 for more info about Filebeat on Solaris (it includes a link to a Filebeat binary for solaris 11 on amd64).

huangapple
  • 本文由 发表于 2017年2月2日 19:03:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/42000525.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定