Project Blacksphere Intro Hardware 331x/3330 ARM Boot ROM Building GCC DSP Phone models Peripherals Nokia OS Software Glossary of Terms Todo Credits Forum Guestbook

Building GCC

Here go some instructions for building an ARM cross compiler to build applications in C for the DCT 3 line of phones.

To be exact, it needs the following specs to achieve the best result for those platforms:

In this document I will assume a GCC version of 3.3.

Binutils

Version "binutils 2.14" was used, using this version (or higher) is recommended.

Changes
You need to make the following source changes before configuring and building:
ld/configure.tgt:
  • Change the beginning of the line starting with arm-*-elf to armeb-*-elf
ld/emulparams/armelf.sh:
  • Change the following line:
    OUTPUT_FORMAT=bigarm
Build process
Change /opt/arm to your destination directory of choice.
./configure --prefix=/opt/arm --target=armeb-elf \
            --program-prefix="armeb-elf-"
make
make install

GCC

Version "GCC 3.3" was used, using this version (or higher) is recommended. This needs binutils installed like described in the previous section.

gcc/config/arm/t-arm-elf:
  • uncomment the MULTILIB_* lines associated with mlittle-endian and mbig-endian
Build process
Change each occurence of /opt/arm to your destination directory of choice.
export PATH="$PATH:/opt/arm/bin"
./configure --prefix=/opt/arm --target=armeb-elf \ 
            --program-prefix="armeb-elf-" -with-newlib -nfp \
            --enable-languages=c
make
make install

Usage

You should now have the entire GNU compiler chain for ARM Thumb Big Endian in the $prefix/bin directory. All utility names have "armeb-elf-" prefixed to them, for example "arm-eb-elf-gcc".

Compilation
armeb-elf-gcc -O2 -mthumb -mbig-endian (file).c -o (file).o
Linkage
armeb-elf-gcc -nodefaultlibs -nostartfiles \
              -Xlinker memmap \
              (objects) -o (outfile).elf
Stripping

The resulting executable needs to be stripped of its ELF headers before it can be used as flash image:

armeb-elf-objcopy -O binary (outfile).elf (outfile).bin

Last updated: 2005-02-21 14:19

This site is the result of a great deal of assembly code reading, research, countless (mostly futile) searches for data sheets, cross-referencing and analysing. If you use this information in any way please mention wumpus <blacksphere@goliath.darktech.org> (and others in the credits section) in the credits of your program/document. And tell me :) If you have more information please contribute. If you just copy this, stick your name on it and call it yours I hope you get your genitals bitten off by a three headed monkey. Have a nice day.

No mobile phones were harmed in the production of this site.