求好心人帮忙交叉编译 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
请不要在回答技术问题时复制粘贴 AI 生成的内容
charliepan
V2EX    程序员

求好心人帮忙交叉编译

  •  
  •   charliepan 2015-06-06 12:57:10 +08:00 6262 次点击
    这是一个创建于 3784 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    12 条回复    2015-10-25 16:29:26 +08:00
    way2exluren
        1
    way2exluren  
       2015-06-06 13:17:46 +08:00 via Android
    交叉编译不仅仅和cpu架构有关,还和运行环境有关,库版本之类的。。所以。。。
    march1993
        2
    march1993  
       2015-06-06 13:37:33 +08:00
    顶楼上,需要对应 Linux 的一份 libc,对应的 mips-gcc,然后才可以编译 -,- 不然静态编译出来的东西太大了。。。。。
    charliepan
        3
    charliepan  
    OP
       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
    /td>
    march1993
        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

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

    openwrt BB ASUS rt-n13u B1
    charliepan
        8
    charliepan  
    OP
       2015-06-06 22:38:11 +08:00
    @1423 谢谢
    lilydjwg
        9
    lilydjwg  
       2015-06-07 10:00:51 +08:00
    @charliepan Killed? 内存不够用了么?
    bruce55
        10
    bruce55  
       2015-06-07 12:45:58 +08:00 via Android
    之前干过在路由器上弄一套toolchain编译的事情
    table cellpadding="0" cellspacing="0" border="0" width="100%"> v2exhehehehe
        11
    v2exhehehehe  
       2015-06-07 13:20:10 +08:00
    如果是虚拟机交叉编译的话显示Killed基本就是内存不够了,为什么不考虑弄个实体机
    jyf007
        12
    jyf007  
       2015-10-25 16:29:26 +08:00
    我有脑残建议,在路由器上挂 u 盘编译.
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     989 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 28ms UTC 18:40 PVG 02:40 LAX 11:40 JFK 14:40
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86