presentation

21
Building your own toolchain ~ Chaitannya Mahatme

Upload: chaitannya-mahatme

Post on 27-Jan-2015

531 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Presentation

Building your own toolchain~ Chaitannya Mahatme

Page 2: Presentation

Overview of ARM architectures.

ARM 7

ARM 9

ARM 11

Page 3: Presentation

ARM7TDMI

ARM7TDMI (ARM7+Thumb+Debug+Multiplier+ICE)

This generation introduced the Thumb 16-bit instruction set

Audio controller in the SEGA Dreamcast D-Link DSL-604+ Wireless ADSL Router. iPod ,iRiver Most of Nokia's mobile phone range.

Page 4: Presentation

ARM 9

ARM moved from a von Neumann architecture (Princeton architecture) to a Harvard architecture with separate instruction and data bus (and caches), significantly increasing its potential speed.

Most important change was introduction of MMU, POSIX complaint OS could be ported.

All smart phones

Page 5: Presentation

ARM 11

SIMD instructions which can double MPEG-4 and audio digital signal processing algorithm speed

Cache is physically addressed, solving many cache aliasing problems and reducing context switch overhead.

TI OMAP2 series processors. All touch based smart phones.

Page 6: Presentation

Steps of Cross-Compilation

gcc: Run the cross-compiler on the host machine to produce assembler files for the target machine.

as: Assemble the files produced by the cross-compiler.

ld: Link those files to make an executable. You can do this either with a linker on the target machine, or with a cross-linker on the host machine.

Page 7: Presentation

Specifing target for your toolchain

arm-linux Armv4l : This makes support for the

ARM v4 architecture, as used in the StrongARM,

ARM7TDMI, ARM8, ARM9. Armv5l : This makes support for the

ARM v5 architecture, as used in the XScale and

ARM10.

Page 8: Presentation

EABI target

arm-eabi arm-none-eabi

In practice the target name makes almost

no practical difference to the toolchain you

Page 9: Presentation

Other EABI options

arm-none-gnueabi: this is the name as arm-none-eabi (specific to GNU compiler)

arm-unknown-eabi: bare metal arm-linux-eabi: Designed to be used

to build programs with glibc under a Linux environment. This would what you would use to build programs for an embeded linux ARM device.

Page 10: Presentation

CPU options

arm7, arm7tdmi, arm720t, arm9', arm9e, arm920, arm920t arm1136j-s, arm1176jz-s

Page 11: Presentation

Other configure options

--enable-interwork This allows for assembling Thumb and ARM code mixed into the same binaries (for those chips that support that)

--enable-multilib Multilib allows the use of libraries that are compiled multiple times for different targets/build types.

Page 12: Presentation

EABI for Linux

GNU EABI is a new Application Binary Interface (ABI) for Linux a.k.a Embedded ABI.

EABI specifies standard conventions for file formats, data types, register usage, stack frame organization, and function parameter passing of an embedded software program.

Page 13: Presentation

Why switch to EABI?

Compilers that support the EABI create object code that is compatible with code generated by other such compilers, thus you can link libraries generated with with object code generated with a different compiler.

Page 14: Presentation

Allows use of optimized hardfloat functions with the system's softfloat libraries

Uses a more efficient syscall convention, hence faster performance.

Since it's a newly adopted standard, will be more compatible with future tools.

Page 15: Presentation

Setting up build envoirnment.

Preferably use virtual box / Vmware. Create a new user for the installation. Set up the configure parameters in

the .profile Create separate dir for build and

source. Set PREFIX dir

Page 16: Presentation

Compilation process

Binutils glibc gcc gdb

Page 17: Presentation

Bootstrapping gcc

Install all the dependencies. The list of dependencies is on gcc.org Mandatory dependencies are GMP

and MPFR. The configure option --with-newlib

tells gcc we are using newlib (see below) and --without-headers tells GCC not to rely on any C library (standard or runtime) being present for the target.

Page 18: Presentation

Installing glibc

Before doing any configuring or compiling, you must set the C compiler that you’re using to be your cross-compiler, otherwise glibc will compile as a horrible mix of ARM code and native code

Make all-gcc. Make install-gcc

Page 19: Presentation

Installing gcc: Part II

Make Make install Add compiler to path variable

Page 20: Presentation

Get more info on http://wiki.openarmlab.org/

http://wiki.openarmlab.org/index.php?title=Building_your_own_toolchain

Page 21: Presentation

That's all Folks … Thank you