求好心人帮忙交叉编译

2015-06-06 12:57:10 +08:00
 charliepan

我有一个C文件 可以麻烦大家帮我交叉编译成 Mips 和 Mipsel下可用的吗?

http://pan.baidu.com/s/1pJFVFaN

5841 次点击
所在节点    程序员
12 条回复
way2exluren
2015-06-06 13:17:46 +08:00
交叉编译不仅仅和cpu架构有关,还和运行环境有关,库版本之类的。。所以。。。
march1993
2015-06-06 13:37:33 +08:00
顶楼上,需要对应 Linux 的一份 libc,对应的 mips-gcc,然后才可以编译 -,- 不然静态编译出来的东西太大了。。。。。
charliepan
2015-06-06 13:42:16 +08:00
我一直打算用Openwrt的SDK编译,但是Openwrt 我一直编译失败

make[5]: Leaving directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/zlib'
make[5]: Entering directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/libbacktrace'
make all-am
make[6]: Entering directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/libbacktrace'
true DO=all multi-do # make
make[6]: Leaving directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/libbacktrace'
make[5]: Leaving directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/libbacktrace'
make[5]: Entering directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/libcpp'
make[5]: Leaving directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/libcpp'
make[5]: Entering directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/libdecnumber'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/libdecnumber'
make[5]: Entering directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/fixincludes'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/fixincludes'
make[5]: Entering directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/gcc'
build/genattrtab /root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04/gcc/config/mips/mips.md insn-conditions.md \
-Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c
Makefile:3583: recipe for target 's-attrtab' failed
make[5]: *** [s-attrtab] Killed
make[5]: Leaving directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/gcc'
Makefile:3892: recipe for target 'all-gcc' failed
make[4]: *** [all-gcc] Error 2
make[4]: Leaving directory '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal'
Makefile:46: recipe for target '/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/.built' failed
make[3]: *** [/root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04-minimal/.built] Error 2
make[3]: Leaving directory '/root/trunk/toolchain/gcc/minimal'
toolchain/Makefile:81: recipe for target 'toolchain/gcc/minimal/compile' failed
make[2]: *** [toolchain/gcc/minimal/compile] Error 2
make[2]: Leaving directory '/root/trunk'
toolchain/Makefile:80: recipe for target '/root/trunk/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/stamp/.toolchain_install' failed
make[1]: *** [/root/trunk/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/stamp/.toolchain_install] Error 2
make[1]: Leaving directory '/root/trunk'
/root/trunk/include/toplevel.mk:181: recipe for target 'world' failed
make: *** [world] Error 2
march1993
2015-06-06 13:49:01 +08:00
@charliepan
手动执行一下?
build/genattrtab /root/trunk/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gcc-linaro-4.8-2014.04/gcc/config/mips/mips.md insn-conditions.md \
-Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c

看看提示错什么
20015jjw
2015-06-06 14:31:54 +08:00
学C苦逼手翻飘过...
niklaus520
2015-06-06 16:31:00 +08:00
你的Linux内核版本,gcc版本不同,编出来的mips也不是通用的
1423
2015-06-06 16:35:38 +08:00
http://pan.baidu.com/s/1hqw7e3y

openwrt BB ASUS rt-n13u B1
charliepan
2015-06-06 22:38:11 +08:00
@1423 谢谢
lilydjwg
2015-06-07 10:00:51 +08:00
@charliepan Killed? 内存不够用了么?
bruce55
2015-06-07 12:45:58 +08:00
之前干过在路由器上弄一套toolchain编译的事情
v2exhehehehe
2015-06-07 13:20:10 +08:00
如果是虚拟机交叉编译的话显示Killed基本就是内存不够了,为什么不考虑弄个实体机
jyf007
2015-10-25 16:29:26 +08:00
我有脑残建议,在路由器上挂 u 盘编译.

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

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

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

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

© 2021 V2EX