欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

Golang 编译MIPS helloworld程序出现 Illegal instruction 或者helloworld: applet not found 的解决

发布时间:2025/4/5 编程问答 42 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Golang 编译MIPS helloworld程序出现 Illegal instruction 或者helloworld: applet not found 的解决 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

编译helloworld程序在MIPS平台上跑出现上述错误。

增加了软浮点编译选项就好了

GOMIPS=hardfloat: use floating point instructions (the default) GOMIPS=softfloat: use soft floating point

完整的编译命令:

#!/bin/sh export PATH=$PATH:/usr/local/go/bin:/opt/msdk-4.3.6-mips-EB-2.6.32-0.9.30.3-m32-120424/bin/ export GOPATH=`pwd`/../.. export GOROOT=/usr/local/go CC=mips-linux-gcc GOARCH=mips GOMIPS=softfloat CGO_ENABLED=1 /usr/local/go/bin/go build -ldflags="-w -s"

 

总结

以上是生活随笔为你收集整理的Golang 编译MIPS helloworld程序出现 Illegal instruction 或者helloworld: applet not found 的解决的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。