mips linux 编译,Linux下编译MIPS compiler

1. Download binutils & gcc  & newlib

URL:http://sourceware.org/projects.html

[root@localhost mips]# ll

total 114768

-rwxr--r-- 1 root root 19973532 Oct 16 09:56 binutils-2.22.tar.bz2

-rwxr--r-- 1 root root 82884636 Oct 16 10:06 gcc-4.7.2.tar.bz2

-rwxr--r-- 1 root root 14571004 Oct 16 09:53 newlib-1.20.0.tar.gz

2. Unpack

[root@localhost mips]# ll

total 114768

drwxr-xr-x 17 root root 4096 Oct 17 11:06 binutils-2.22

-rwxr--r-- 1 root root 19973532 Oct 16 09:56 binutils-2.22.tar.bz2

drwxr-xr-x 33 1000 1000 4096 Oct 17 11:47 gcc-4.7.2

-rwxr--r-- 1 root root 82884636 Oct 16 10:06 gcc-4.7.2.tar.bz2

drwxrwxr-x 7 2608 2613 4096 Dec 20 2011 newlib-1.20.0

-rwxr--r-- 1 root root 14571004 Oct 16 09:53 newlib-1.20.0.tar.gz

3. Execute the following command

[root@localhost mips]# mv newlib-1.20.0 gcc-4.7.2

[root@localhost mips]# cd gcc-4.7.2

[root@localhost gcc-4.7.2]# ln -s newlib-1.20.0/newlib .

[root@localhost gcc-4.7.2]# ./contrib/download_prerequisites

[root@localhost gcc-4.7.2]# cd -

4. Compile binutils

[root@localhost mips]# mkdir build_binutils/

[root@localhost mips]# cd build_binutils/

[root@localhost build_binutils]# ../binutils-2.22/configure --target=mips-elf --with-arch-32=xcpu --with-arch-64= --with-abi=eabi --disable-shared --enable-lto --enable-gold --disable-libmudflap --disable-libssp --disable-libgomp --disable-nls --disable-libstdcxx-pch --disable-sgxx-sde-multilibs --with-gnu-as --with-gnu-ld --with-pkgversion="bintutils 2.22 Coolsand 2012.09-01" --prefix=$HOME/usr/gnu-tools/mips-elf

[root@localhost build_binutils]# make -j4

[root@localhost build_binutils]# make install

[root@localhost build_binutils]# cd -

5. Compile gcc

[root@localhost mips]# mkdir build_gcc/

[root@localhost mips]# cd build_gcc/

[root@localhost build_gcc]# ../gcc-4.7.2/configure --target=mips-elf --with-arch-32=xcpu --with-arch-64= --with-abi=eabi --with-float=soft --enable-languages=c,c++ --disable-shared --enable-lto --with-newlib --disable-multilib --enable-plugin --enable-gold --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-nls --disable-libstdcxx-pch --disable-sgxx-sde-multilibs --with-gnu-as --with-gnu-ld --with-pkgversion="GCC 4.7.2 Coolsand 2012.09-01" --prefix=$HOME/usr/gnu-tools/mips-elf

[root@localhost build_gcc]# make -j4

[root@localhost build_gcc]# make install

[root@localhost build_gcc]# cd -

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值