首 页电子文章电子资料客户留言94论坛繁體中文
设为首页
加入收藏
联系我们
您当前的位置:中国电子前沿 -> ARM技术 -> ARM应用 -> 电子文章内容 退出登录 用户管理
栏目导航
· ARM入门 · ARM系统
· ARM应用
热门电子文章
· [USB技术] 基于DSP技术的..
· [USB技术] 在 Java 应用程..
· [USB技术] USB设计
· [linux移植] Linux解释器..
· [USB技术] 如何构造一个简..
· [USB技术] USB在数据采集..
· [USB技术] USB2.0控制器C..
· [linux移植] 在Redhat Li..
· [VHDL学习] 错误检测与纠..
· [原理欣赏] 高速高密度PC..
· [FPGA应用] FPGA器件的在..
· [ARM应用] 触摸屏在S3C24..
相关电子文章
· [组图] 开关电源(Bu..
· [图文] USB设备的Bul..
· uClinux 下如何写fr..
· [组图] Buck型三相功..
· Platform Builder实..
Building an ARM development environment (good!!!)
作者:佚名  来源:不详  发布时间:2006-9-12 16:08:15  发布人:zangyl

减小字体 增大字体

  Setting up all the tools you need for development on an ARM system can be a little daunting at first.  This page should contain all the information you need to get going.  Although this is mostly intended for people who want to use ELF on a Linux/ARM system most of the details here are also applicable to standalone and a.out systems.    

The latest toolchain news can be found on this page.  The information below isn’t so frequently updated.    

1.  Binutils    

Before you can do anything else you need to install an assembler and linker.  These are in the binutils package.  Currently the latest release known to work on ARM systems is 2.9.1.0.19a; the very latest version is currently 2.9.1.0.21 and this may also be OK.  Binutils can usually be found here or here.  Either of the versions mentioned earlier should work for the following target systems:    

arm-linux - Linux/ARM with ELF binaries    
arm-linuxaout - Linux/ARM with a.out binaries    
arm-aout - ARM/standalone using a.out binaries    
arm-coff - ARM/standalone using COFF binaries    
arm-elf - ARM/standalone using ELF binaries    
Support for the arm-elf configuration is more experimental than the others.  In particular, Cygnus have been working on an independent port to ARM/ELF which is not currently 100% compatible with this one.  Only use it if you know what you are doing.    
Once you have the source code in place, follow the instructions provided to compile it.  To build a native compiler on a Linux/ARM system you should configure with something like    

$ .../configure arm-linux --prefix=/usr    

To build a cross-compiler from some other machine to Linux/ARM you should use something like    

$ .../configure --target=arm-linux --prefix=/usr    

Then you should be able to do "make" and "make install" without problems.  If you use "make check" you should expect some failures at the moment.    


2. GCC    

The recommended compiler is currently EGCS 1.1.1.  You can download the source from this site and again there is a patch to apply to it.    
If you are building on a Linux/ARM system you need to have the kernel headers available before the compiler will build.  Assuming your kernel source is in /usr/src/linux you can do something like this:    

# cd PREFIX/arm-linux                                        # eg /usr/arm-linux    
# mkdir include    
# cd include    
# ln -s /usr/src/linux/include/asm-arm asm    
# ln -s /usr/src/linux/include/linux linux    

If you haven’t already done so, you must also configure the kernel appropriately.    

Then configure the compiler using the same arguments you gave to binutils, build it and off you go.    

If you are trying to bootstrap a development environment for the first time on this system you will find that not everything will build first time around.  The only things that matter at this stage are those that are built if you type `make LANGUAGES="c"’ in the `gcc’ subdirectory.  Once enough of the compiler is built you can install it - again you may need to be in the gcc subdirectory and use LANGUAGES="c" to get this to complete without errors.    

You now have enough of an environment to build kernels and standalone "C" programs.  If this is all you are interested in you can stop now and congratulate yourself on a job well done.  If you want to use other languages or build programs that link with the C library (including most user-space binaries for Linux) then you need to continue.    


3. libc    

For ARM systems you need glibc 2.1.  You will need the linuxthreads and crypt add-ons as well as the library itself.  The primary distribution site for glibc is here but this server is located in the USA and people from other countries must not download the crypt add-on from there.  Instead you can find it on ftp://ftp.funet.fi/. ;   

Compiling the libc natively is simple and you can just follow the instructions.  If you are building on a system that is already based on glibc then be careful if you install your new library -- a mistake may mean you are hosed.    

In a cross-compile environment things are a little more difficult.  You need to use a configure line of the following form:    

$ CC=arm-linux-gcc .../configure arm-linux --build=i586-linux --prefix=/usr/arm-linux --enable-add-ons=...    

Specifying the compiler is compulsory, otherwise you will end up building the library with your native compiler which will leave you with a horrendous mix of architectures and a broken library.  Specifying the build system is also necessary to ensure the make process goes smoothly.  The name you give here doesn’t need to be 100% accurate, it basically just has to be different from the name of the host system.  It makes no sense to use --target when configuring glibc.  Do NOT just give the same --prefix argument that you used for compiling gcc and binutils, make sure you add the extra component so that the library installs into the correct target directory.  Installing a cross library in /usr by mistake will bring you to grief quite quickly.    

For standalone environments you might like to investigate the newlib package instead.    


4. Other compilers    

Once libc is installed you can build basic user-space applications.  In particular you can now go back to egcs and compile all the parts that didn’t build the first time around like the C++ and Fortran front ends. 

[] [返回上一页] [打 印] [收 藏]
下一篇电子文章:异步传输模式ATM
∷相关电子文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论…]
关于本站网站帮助广告合作下载声明友情连接网站地图
Copyright © 2002-2006 EMB-CN.com. All Rights Reserved .