Sorry for my confused responses before.
The thing was my hardware board lacked fpu, so that's why I could not
make it work a simple hello world compiled with: GOOS=linux GOARCH=mips go build hello.go
because the go compiler did not emmit softfloat.
For other people who are facing the same problem, it can be done without modifying
the original image (withouting recompiling the kernel) by using the patch on this issue:
I got it done using the Vladimir patches with the following command:
env GOOS=linux GOARCH=mips GOMIPS=r2softfloat /home/lucas/Desktop/bin/go build -a helloworld.go
It seems ematsu shared his backport also recently, with a newest patch (with some fixes).
I would like to ask one question. I am trying to use c code in a go application. I was able to do the crosscompile
of the code for an arm board, but not for a mips board. The go build command I am using:
env CGO_ENABLED=1 GOOS=linux GOARCH=mips GOMIPS=r2softfloat CC=/home/lucas/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_glibc-2.19.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-5.3.0_glibc-2.19/bin/mips-openwrt-linux-gccgo CGO_LDFLAGS="-s -w -static-libgo -L/home/lucas/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_glibc-2.19.Linux-x86_64/staging_dir/target-mips_34kc_glibc-2.19/usr/lib" /home/lucas/Desktop/go-mips32/bin/go build -a -v mypackage/program
It generates a binary but when i try to run on my board, it gives me the following: 'program' not found
When do I set a cross compile (CC), does it overwrite the go build compiler with softfloat ?
Do I have the compile linking full static?
I am not sure if this is the best place to ask these questions, so I'm sorry if this forum is not the right place.
Lucas.