折腾了一整天,心力绞碎,做好笔记。目标是创建一个裸机(bare-metal)到编译环境,没有用crosstool,完全是从零开始下载安装,几点感想,ubuntu的包管理还是不错的,个人觉得不必去追最新版本,最好用长期支持版,例如 8.04,10.04,个人感觉挺稳定的。编译链到构造对版本到要求很高,所以最好用别人成功的版本,例如我这些组件的版本就是到crosstool官网看到有人成功的版本,TARGET 的名字不能随便起,一般按照系统认识的,例如 arm-none-eabi ,否则也很容易失败。最后编译了个LED走马灯程序下载到 mini2440,一切正常。
Etual
2012-3-21
- Author : Etual
- date : 2012-3-21
- host : ubuntu 10.04
- host gcc : gcc 4.3.4
- target: arm-unknow-eabi
- binutils : 1.19.1
- gcc : 4.3.4
- newlib : 1.17.0
- insight : 6.8.1
- note : in dual core system can use "make -j 2 all" for faster compile!
- 0. prepare src
- a. download
- binutils,gcc, ftp://ftp.gnu.org
- newlib
- insight ftp://sourceware.org/pub/insight/releases
- b. steup environment
- # export TARGET=arm-unknow-eabi
- # export PREFIX=/mini2440/tool/$TARGET
- # export PATH=$PATH:$PREFIX/bin
- c. setup required packet
- # apt-get install flex bison zlibc libgmp3-dev libmpfr-dev libmpc-dev autoconf texinfo build-essential libncurses5 libncurses5-dev
- d. make dir
- # cd /mini2440/temp
- # mkdir build-host build-gcc build-newlib build-binutils build-insight
- # tar xjf binutils-2.19.1.tar.bz2
- # tar xjf gcc-4.3.4.tar.bz2
- # tar xjf insight-6.8-1a.tar.bz2
- # tar xzf newlib-1.17.0.tar.gz
- 1. build a host gcc rather then ubuntu's GCC
- # cd build-host
- # ../gcc-4.3.4/configure --prefix=/opt --quiet --enable-languages="c,c++" --enable-shared --enable-threads=posix --enable-nls --enable-multiarch --with-system-zlib
- # rm /usr/bin/gcc
- # ln -s /opt/bin/gcc /usr/bin/gcc
- 2. install binutils
- # cd build-binutils
- # ../binutils-2.19.1/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --with-gnu-ld --with-gnu-as --disable-werror
- # make all
- # make install
- 3. install gcc without lib
- # cd build-gcc
- # ../gcc-4.3.4/configure --target=$TARGET --prefix=$PREFIX --with-newlib --without-headers --with-gnu-as --with-gnu-ld --disable-shared --enable-languages=c --disable-werror
- # make all-gcc
- # make install-gcc
- 4. build newlib
- # cd build-newlib
- # ../newlib-1.17.0/configure --target=$TARGET --prefix=$PREFIX --disable-newlib-supplied-syscalls --enable-interwork --enable-multilib --with-gnu-ld --with-gnu-as --disable-newlib-io-float --disable-werror
- # make all
- # make install
- 5. build gcc full
- # cd build-gcc
- # rm -rf *
- # ../gcc-4.3.4/configure --target=$TARGET --prefix=$PREFIX --with-gnu-as --with-gnu-ld --enable-languages=c --enable-interwork --enable-multilib --with-newlib --with-headers=../newlib-1.17.0/newlib/libc/include --disable-werror
- # make all
- # make install
- 6. insight
- # cd build-insight
- # ../insight-6.8-1/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --with-gnu-ld --with-gnu-as --disable-werror
- # make all
- # make install
- note : can change port in file "~/.gdbtkinit"
- done :-)
阅读(2619) | 评论(0) | 转发(0) |