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"

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章