本帖最后由 si692828681 于 2012-12-30 13:17 编辑
今天突然想保存一下编译参数还有各部分的版本 ------ 弄到合适的太不容易了,当时是翻了好多文章,编译了好多次才通过的。。。(保存在自己电脑里,容易丢,所以贴在论坛里,也许还会有朋友用得着;还可以赚积分,现在太低了,好友都加不了。。。)
-------------------------------------------------------------------------------------------------------------------------------------
1. 编译 binutils
cd binutils-2.22/
./configure --target=arm-none-eabi --prefix=/home/tutu/tools/ --enable-interwork --enable-multilib --disable-nls --disable-libssp
make all
make install
cd ..
2. 编译 gcc with newlib (这里要分三步)
1)
cd gcc-4.7.1/
make objdir
cd objdir
../configure --target=arm-none-eabi --prefix=/home/tutu/tools/ --enable-interwork --enable-multilib --enable-languages=c --with-newlib --with-headers=../../newlib-1.20.0/newlib/libc/include/ --disable-libssp --disable-nls --with-system-zlib --with-float=hard --with-fpu=fpv4-sp-d16 --with-cpu=cortex-m4 --with-mode=thumb
make all-gcc
make install-gcc
cd ../..
2)
cd newlib-1.20.0/
./configure --target=arm-none-eabi --prefix=/home/tutu/tools/ --enable-interwork --enable-multilib --disable-libssp --disable-nls --with-float=hard --with-fpu=fpv4-sp-d16 --with-cpu=cortex-m4 --with-mode=thumb
make all
make install
cd ..
3)
cd gcc-4.7.1/objdir/
make all
make install
cd ../..
3. 编译 gdb
cd gdb-7.4/
./configure --target=arm-none-eabi --prefix=/home/tutu/tools/ --enable-interwork --enable-multilib --disable-libssp --disable-nls
make all
make install
cd ..
-------------------------------------------------------------------------------------------------------------------------------------
注意点:
--prefix=/home/tutu/tools/ 这是我安装的目录,要更换成你要安装的目录
有几个参数的意思,引用别人文章里的:
–enable-interwork: Allows ARM and Thumb code to be used
–enable-multilib: Build multible versions of some libs. E.g. one with soft float and one with hard
–disable-nls: Tells gcc to only support American English output messages
–disable-libssp: Don’t include stack smashing protection
–with-system-zlib: Fixes the error: configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES