我有一个C文件 可以麻烦大家帮我交叉编译成 Mips 和 Mipsel下可用的吗?
1
way2exluren 2015-06-06 13:17:46 +08:00 via Android
交叉编译不仅仅和cpu架构有关,还和运行环境有关,库版本之类的。。所以。。。
|
2
march1993 2015-06-06 13:37:33 +08:00
顶楼上,需要对应 Linux 的一份 libc,对应的 mips-gcc,然后才可以编译 -,- 不然静态编译出来的东西太大了。。。。。
|
3
charliepan OP 我一直打算用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 |
4
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 看看提示错什么 |
5
20015jjw 2015-06-06 14:31:54 +08:00 via Android
学C苦逼手翻飘过...
|
6
niklaus520 2015-06-06 16:31:00 +08:00 via Android
你的Linux内核版本,gcc版本不同,编出来的mips也不是通用的
|
7
1423 2015-06-06 16:35:38 +08:00 1
|
8
charliepan OP @1423 谢谢
|
9
lilydjwg 2015-06-07 10:00:51 +08:00
@charliepan Killed? 内存不够用了么?
|
10
bruce55 2015-06-07 12:45:58 +08:00 via Android
之前干过在路由器上弄一套toolchain编译的事情
|
11
v2exhehehehe 2015-06-07 13:20:10 +08:00
如果是虚拟机交叉编译的话显示Killed基本就是内存不够了,为什么不考虑弄个实体机
|
12
jyf007 2015-10-25 16:29:26 +08:00
我有脑残建议,在路由器上挂 u 盘编译.
|