Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

6.
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.

7.
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.

8.
EABI target

arm­eabi

arm­none­eabi

In practice the target name makes almost
no practical difference to the toolchain you

9.
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.

11.
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.

13.
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.

14.

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.

15.
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

17.
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.

18.
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