准备在小米路由器 Mini 上运行 Go 程序,编译 gccgo 出错。标准库选的是 uClibc ,出现下面的错误。请问该怎么解决?
在
https://groups.google.com/forum/#!topic/golang-nuts/fAElwJu-QUM 似乎说是因为 uClibc 缺少 libgo 目前的实现需要 的 getContext / setcontext / makecontext 。
/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04/libgo/runtime/proc.c:244:2: error: implicit declaration of function 'setcontext' [-Werror=implicit-function-declaration]
setcontext (&newg->context );
^
/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04/libgo/runtime/proc.c: In function 'runtime_mcall':
/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04/libgo/runtime/proc.c:279:3: error: implicit declaration of function 'getcontext' [-Werror=implicit-function-declaration]
getcontext (&gp->context );
^
/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04/libgo/runtime/proc.c: In function 'runtime_newextram':
/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04/libgo/runtime/proc.c:1111:2: error: implicit declaration of function 'makecontext' [-Werror=implicit-function-declaration]
makecontext (&mp->g0->context, kickoff, 0 );
^
cc1: all warnings being treated as errors
make[8]: *** [proc.lo] Error 1
make[8]: Leaving directory `/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-final/mipsel-openwrt-linux-uclibc/libgo'
make[7]: *** [all-recursive] Error 1
make[7]: Leaving directory `/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-final/mipsel-openwrt-linux-uclibc/libgo'
make[6]: *** [all] Error 2
make[6]: Leaving directory `/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-final/mipsel-openwrt-linux-uclibc/libgo'
make[5]: *** [all-target-libgo] Error 2
make[5]: Leaving directory `/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-final'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-final'
make[3]: *** [/home/vare/openwrt-go/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-final/.built] Error 2
make[3]: Leaving directory `/home/vare/openwrt-go/toolchain/gcc/final'
make[2]: *** [toolchain/gcc/final/compile] Error 2
make[2]: Leaving directory `/home/vare/openwrt-go'
make[1]: *** [/home/vare/openwrt-go/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/stamp/.toolchain_install] Error 2
make[1]: Leaving directory `/home/vare/openwrt-go'
make: *** [world] Error 2