准备在小米路由器 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
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/216159
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.