Chinaunix首页 | 论坛 | 博客
  • 博客访问: 591554
  • 博文数量: 99
  • 博客积分: 5128
  • 博客等级: 大校
  • 技术积分: 1538
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-27 19:40
文章分类

全部博文(99)

文章存档

2012年(3)

2011年(5)

2010年(4)

2009年(31)

2008年(56)

分类: LINUX

2012-03-21 12:02:14

折腾了一整天,心力绞碎,做好笔记。目标是创建一个裸机(bare-metal)到编译环境,没有用crosstool,完全是从零开始下载安装,几点感想,ubuntu的包管理还是不错的,个人觉得不必去追最新版本,最好用长期支持版,例如 8.04,10.04,个人感觉挺稳定的。编译链到构造对版本到要求很高,所以最好用别人成功的版本,例如我这些组件的版本就是到crosstool官网看到有人成功的版本,TARGET 的名字不能随便起,一般按照系统认识的,例如 arm-none-eabi ,否则也很容易失败。最后编译了个LED走马灯程序下载到 mini2440,一切正常。
Etual
2012-3-21

  1. Author : Etual
  2. date : 2012-3-21
  3. host : ubuntu 10.04
  4. host gcc : gcc 4.3.4
  5. target: arm-unknow-eabi
  6. binutils : 1.19.1
  7. gcc : 4.3.4
  8. newlib : 1.17.0
  9. insight : 6.8.1
  10. note : in dual core system can use "make -j 2 all" for faster compile!
  11. 0. prepare src
  12. a. download
  13. binutils,gcc, ftp://ftp.gnu.org
  14. newlib
  15. insight ftp://sourceware.org/pub/insight/releases
  16. b. steup environment
  17. # export TARGET=arm-unknow-eabi
  18. # export PREFIX=/mini2440/tool/$TARGET
  19. # export PATH=$PATH:$PREFIX/bin
  20. c. setup required packet
  21. # apt-get install flex bison zlibc libgmp3-dev libmpfr-dev libmpc-dev autoconf texinfo build-essential libncurses5 libncurses5-dev
  22. d. make dir
  23. # cd /mini2440/temp
  24. # mkdir build-host build-gcc build-newlib build-binutils build-insight
  25. # tar xjf binutils-2.19.1.tar.bz2
  26. # tar xjf gcc-4.3.4.tar.bz2
  27. # tar xjf insight-6.8-1a.tar.bz2
  28. # tar xzf newlib-1.17.0.tar.gz
  29. 1. build a host gcc rather then ubuntu's GCC
  30. # cd build-host
  31. # ../gcc-4.3.4/configure --prefix=/opt --quiet --enable-languages="c,c++" --enable-shared --enable-threads=posix --enable-nls --enable-multiarch --with-system-zlib
  32. # rm /usr/bin/gcc
  33. # ln -s /opt/bin/gcc /usr/bin/gcc
  34. 2. install binutils
  35. # cd build-binutils
  36. # ../binutils-2.19.1/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --with-gnu-ld --with-gnu-as --disable-werror
  37. # make all
  38. # make install
  39. 3. install gcc without lib
  40. # cd build-gcc
  41. # ../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
  42. # make all-gcc
  43. # make install-gcc
  44. 4. build newlib
  45. # cd build-newlib
  46. # ../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
  47. # make all
  48. # make install
  49. 5. build gcc full
  50. # cd build-gcc
  51. # rm -rf *
  52. # ../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
  53. # make all
  54. # make install
  55. 6. insight
  56. # cd build-insight
  57. # ../insight-6.8-1/configure --target=$TARGET --prefix=$PREFIX --enable-interwork --enable-multilib --with-gnu-ld --with-gnu-as --disable-werror
  58. # make all
  59. # make install
  60. note : can change port in file "~/.gdbtkinit"
  61. done :-)



 

阅读(6639) | 评论(0) | 转发(1) |
0

上一篇:闲聊~~

下一篇:STM32的初学者

给主人留下些什么吧!~~