Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1146641
  • 博文数量: 177
  • 博客积分: 761
  • 博客等级: 上士
  • 技术积分: 1518
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-04 22:37
文章分类

全部博文(177)

文章存档

2017年(1)

2016年(3)

2015年(33)

2014年(48)

2013年(60)

2012年(32)

分类: LINUX

2015-05-07 14:32:41

原文地址:linux下各种交叉编译工具 作者:eelb123

linux移植能力太强了,这也累了我们做开发的。。文件系统一堆,交叉编译工具也一堆。。

平台arm,做个记录,使用后适当做些对比:

crosstools:这个好像是比较传统的,方便,不过好像没人维护更新了


ELDK:德国人的,uboot一个team维护,方便4.1有glibc和uclibc两版本的,4.2暂时还没uclibc


buildroot:想用uclibc必然想起他啊,不过要自己编译,少许麻烦


scratchbox:说是补充buildroot的。。不知,没用过


codesourcery:gnu的,说了太多了,不知道这个有啥优缺点。。



[Learning] Toolchains 

Toolchains

From eLinux.org

Jump to: ,

A is a set of distinct software development tools that are linked (or chained) together by specific stages such as GCC, binutils and glibc (a portion of the ). Optionally, a toolchain may contain other tools such as a or a for a specific programming language, such as ,. Quite often, the toolchain used for embedded development is a cross toolchain, or more commonly known as a . All the programs (like GCC) run on a host system of a specific architecture (such as x86) but produce binary code (executables) to run on a different architecture (e.g. ARM). This is called cross compilation and is the typical way of building embedded software. It is possible to compile natively, running gcc on your target. Before searching for a prebuilt toolchain or building your own, it's worth checking to see if one is included with your target hardware's if you have one.

Contents

[]
[]

Note about C libraries

Realistically, there are two options for the C Library: & . GLibc is what your PC is probably using. It's a bit of a brute, very powerful but a bit bloated. If flash space and memory footprint is an issue, using uClibc is likely to be the better option. However, the space advantages gained using uClibc are becoming less important as the price of memory & flash continues to drop. There are a few "gotcha"s when using uClibc. At time of writing(uClibc 0.9.28), locales are a bit ropey and the new Application Binary Interface (ABI) for ARM architectures (EABI) introduced with GCC 4.1.1 requires patches to be applied. This situation is likely to get better quickly as uClibc is under heavy development.

[]

Available Toolchains

Creating a cross development toolchain from sources can be a real pain. There are version dependency issues, patches required to make something work etc. etc. Check out the for crosstool and look at all the red "failed" entries. Fortunately, there are several groups of people who have done all the hard work for you, producing scripts to create a toolchain or releases of binary toolchains.

[]

DENX ELDK

The DENX Embedded Linux Development Kit (ELDK) provides a complete and powerful software development environment for embedded and real-time systems. It is available for ARM, PowerPC and MIPS processors and consists of:

   * Cross Development Tools (Compiler, Assembler, Linker etc.) to develop software for the target system.
* Native Tools (Shell, commands and libraries) which provide a standard Linux development environment that runs on the target system.
* Firmware (U-Boot) that can be easily ported to new boards and processors.
* Linux kernel including the complete source-code with all device drivers, board-support functions etc.
* Xenomai - RTOS Emulation framework for systems requiring hard real-time responses.
* SELF (Simple Embedded Linux Framework) as fundament to build your embedded systems on.

All components of the ELDK are available for free with complete source code under GPL and other Free Software Licenses. Also, detailed instructions to rebuild all the tools and packages from scratch are included.

The ELDK can be downloaded for free from several mirror sites or ordered on CD-ROM for a nominal charge (99 Euro). To order the CD please contact office@denx.de

Detailed information about the ELDK is available .

[]

Buildroot

Buildroot is a complete build system based on the Linux Kernel configuration system and supports a wide range of target architectures. It generates root file system images ready to be written to flash. In addition to having a huge number of packages which can be compiled into the image, it also generates a cross toolchain to build those packages from source. Even if you don't want to use buildroot for your root filesystem, it is a useful tool for generating a toolchain. It should be noted however that it only supports uClibc. If you want to use glibc, you'll need something else. Link:

[]

Scratchbox

Scratchbox provides toolchains for ARM and x86 target architectures (with PowerPC, MIPS and CRIS in experimental stages). Both uClibc & glibc are supported. Scratchbox simplifies cross compiling software which is built using GNU autotools - Code tests performed by configure are run in an emulator or even on the actual target. The toolchains scratchbox ships with are based on gcc 3.3 and as such are quite old, but stable and well tested. It should be pointed out that scripts to build custom toolchains are also provided with scratchbox allowing more recent gcc versions to be used. Link:

Crossdev (Gentoo)

Crossdev is specific to developers using Gentoo for their development PCs. It is a script which generates a cross toolchain using the portage build scripts for gcc etc. There are numerous architectures which are supported and both uClibc and glibc toolchains can be built. Link:

[]

Crosstool

Crosstool is a script which downloads source tar-balls and builds simple gcc/glibc cross toolchains. There is a build matrix which shows which versions of gcc/glibc work together with various architectures (). The inclusion of this matrix makes it easy to select which versions of gcc/glibc should be used to generate a toolchain for a particular architecture. Link:

[]

Crosstool-NG

Crosstool-NG is a fork of crosstool, targeted at easier configuration, re-factored code, and a learning base on how toolchains are built, with support for both uClibc and glibc, for debug tools (gdb, strace, dmalloc...), and a wide range of versions for each tools. Different target architectures are supported as well. Link:

[]

CodeSourcery

develops , an based Integrated Development Environment (IDE) that incorporates the (gcc, gdb, etc.) for cross development for numerous target architectures. provides a "lite" version for , , and architectures. The toolchains are always very up to date. contributes enhancements it makes to the upstream continually, making it the single largest (by patch count) corporate contributor.

Crossdev/tsrpm (Timesys)

Crossdev is a project sponsored by Timesys, completely unrelated to the Gentoo cross toolchain generation system. The projects main focus is on a tool called tsrpm which is used to build cross development toolchains and generate cross-compiled software packages. Currently only x86 and select PowerPC architectures are supported. Link: Crossdev

[]

Fedora ARM

Fedora ARM is a try to port Fedora to ARM. It provides some tools as an ARM toolchain packaged in RPM format. Link:

[]

Embedded Debian cross-tools packages

For Debian users, the toolchains problem is fairly reliably solved.

For a debian-based box just install pre-built cross toolchains from emdebian. Instructions are given here:

Supported build architectures are: i386, amd64, (and powerpc, ish) Targets insclude nearly all debian-supported architectures Compilers are gcc3.3, 3.4, 4.1, 4.2, 4.3. Lenny and sid are supported although the tools are inevitably slightly behind Debian proper.

http://www.emdebian.org/toolchains/search.php?section=devel gives a (long) listing of available packages.

emdebian-tools also provides the debian equivalent of crosstool ('emchain' to build your own version of current toolchain, should a suitable pre-built one not exist.

[]

OSELAS.Toolchain()

The OSELAS.Toolchain() project aims at supplying a complete build system for recent GNU toolchains. It uses the PTXdist build system, a userland build system based on Kconfig. The current version 1.99.3.1 of OSELAS.Toolchain() contains support for arm, x86, avr, mips and PowerPC. In addition, there are toolchains for bare metal platforms like Cortex-M3 and AVR-8-Bit.

OSELAS.Toolchain() Feature matrix (v1.99.1, build with PTXdist v1.99.7)
Architeture CPUtype gcc glibc binutils kernel header
ARM (eabi) 1136jfs,xscale(-hf),iwmmx,v4t(-hf),v5te,xscale 4.1.2, 4.3.2 2.5, 2.8 2.17, 2.18 2.6.18, 2.6.27
AVR n/a 3.4.6, 4.1.2, 4.3.2 1.0.5, 1.4.8, 1.6.2 2.17 n/a
X86 i586, i686 4.1.2, 4.3.2 2.5, 2.8 2.17, 2.18 2.6.18, 2.6.27
PowerPC 603e 4.1.2, 4.3.2 2.5, 2.8 2.17, 2.18 2.6.18, 2.6.27
MIPS mipsel (softfloat) 4.2.3 2.8 2.18 2.6.27

OSELAS.Toolchain() contains some further goodies like gcj support for ARM and mingw Support for x86. Link: Link:

[]

Bitbake

Bitbake is the tool used by . There is a bitbake manual at , but the best way to get started is probably by just building an existing distribution that uses openembedded (e.g. Ångström, see for details).


阅读(4123) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~