gpt4 book ai didi

戈朗。 MIPS 交叉编译

转载 作者:IT王子 更新时间:2023-10-29 02:12:08 31 4
gpt4 key购买 nike

我试过编译我的简单程序:

func main(){fmt.Printf("Hello")}

根据文档在我的 PC 上使用 64 位 Debian Linux 到 MIPS 架构

https://golang.org/doc/install/source#environment

通过使用命令

GOOS=linux GOARCH=mipsle go build 
GOOS=linux GOARCH=mips go build

每次我得到错误:

runtime/internal/sys compile

unknown architecture "mipsle(mips)"

有趣的是,如果尝试使用命令:

GOOS=linux GOARCH=mipsle64 go build

程序已构建。

它是否取决于我 PC 上的系统操作系统?如何为 MIPS 或 MIPSLE 构建二进制文件?

最佳答案

Go 1.6 不支持 MIPS 或 MIPSLE。 1.6 支持 MIPS64(LE)。 1.8 支持 MIPS(LE)。

来自 https://golang.org/doc/install/source :

  • amd64 (also known as x86-64)
    • A mature implementation.
  • 386 (x86 or x86-32)
    • Comparable to the amd64 port.
  • arm (ARM)
    • Supports Linux, FreeBSD, NetBSD, OpenBSD and Darwin binaries. Less widely used than the other ports.
  • arm64 (AArch64)
    • Supports Linux and Darwin binaries. New in 1.5 and not as well exercised as other ports.
  • ppc64, ppc64le (64-bit PowerPC big- and little-endian)
    • Supports Linux binaries. New in 1.5 and not as well exercised as other ports.
  • mips, mipsle (32-bit MIPS big- and little-endian)
    • Supports Linux binaries. New in 1.8 and not as well exercised as other ports.
  • mips64, mips64le (64-bit MIPS big- and little-endian)
    • Supports Linux binaries. New in 1.6 and not as well exercised as other ports.
  • s390x (IBM System z)
    • Supports Linux binaries. New in 1.7 and not as well exercised as other ports.

关于戈朗。 MIPS 交叉编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43208366/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com