Open bettermanbao opened 8 years ago
你是怎么编译的 编译时候的参数都有哪些 我编译出来的有7m呢
cd git clone https://github.com/gomini/go-mips32.git cd go-mips32/src export GOOS=linux export GOARCH=mips32 <== Change to mips32le if ramips sudo mkdir /opt/mipsgo ./make.bash cd .. sudo cp -R * /opt/mipsgo export GOROOT=/opt/mipsgo export PATH=/opt/mipsgo/bin:$PATH vi helloworld.go go build helloworld.go
I have trouble when building mips32go on x86_64 machine, please help me:
/home/tymon/work/test/go-mips32-dev.github/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic? /home/tymon/work/test/go-mips32-dev.github/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic? runtime/cgo(.text): unexpected relocation type 298 runtime/cgo(.text): unexpected relocation type 298
/home/tymon/work/test/go-mips32-dev.github/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic? /home/tymon/work/test/go-mips32-dev.github/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic? runtime/cgo(.text): unexpected relocation type 298 runtime/cgo(.text): unexpected relocation type 298
To make the "unexpected relocation" errors go away, change the ./make.bash command to: CGO_ENABLED=0 ./make.bash
Does anyone know the advantage of re-compile openwrt firmware with this repo? Currently I could run cross compiled go program on original openwrt mips32 firmware, but the performance is very poor.
I tried an UDP tunnel program which written in golang, but when it runs on my mips32 router after cross compiled, the transfer rate is only 2-3Mbps.
So I'm looking for some optimized metheds to run golang on my mips32 router now. Thanks!
My cross compile bin attahed, source code here: https://github.com/xtaci/kcptun
kcptun-client_mips32_little_endian.zip kcptun-client_mips32_big_endian.zip