编译 GCCGO 编译器的时候出现错误

2015-08-26 16:55:53 +08:00
 vare
准备在小米路由器 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
736 次点击
所在节点    OpenWrt
10 条回复
jeromeli
2015-08-26 21:41:42 +08:00
新手撸过帮顶

你先 make download V=s 把需要的包先下载下来子啊编译试试呢
vare
2015-08-27 01:09:34 +08:00
@jeromeli 已经下好所有的包了。
难道只能是用 eglibc 才可以编译 libgo ?
debiansid
2015-08-27 12:56:05 +08:00
Uclibc 有 context 补丁
vare
2015-08-27 16:48:16 +08:00
@debiansid uClibc-0.9.33.2 集成 context 补丁了吗?
vare
2015-08-27 17:56:51 +08:00
@debiansid 可否给这个 Patch 的下载地址?
debiansid
2015-08-28 08:46:23 +08:00
Google 下 很难么?
debiansid
2015-08-28 10:54:55 +08:00
vare
2015-08-28 15:27:24 +08:00
@debiansid 感谢。
charlesri
2018-02-19 12:07:44 +08:00
求学信网 数据库
charlesri
2018-02-19 12:09:22 +08:00
@vare 求学信网数据库 1366589917@qq.com

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/216159

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX