V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
charliepan
V2EX  ›  程序员

求好心人帮忙交叉编译

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

    我有一个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
    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也不是通用的
    1423
        7
    1423  
       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编译的事情
    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   ·   实用小工具   ·   986 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 23:04 · PVG 07:04 · LAX 15:04 · JFK 18:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.