Skip to content

ARMinARM/arm-toolchain-build-scripts

Repository files navigation

ARM toolchain build scripts

Scripts for building the ARMinARM toolchain, a gcc-based ARM toolchain on Linux (target=arm-none-eabi) for building for the Cortex M0/M3/M4 line of ARM processors, using hardware floating point instructions (M4) and calling conventions.

Based almost entirely on YAGARTO build scripts by Michael Fischer:

The target is arm-none-eabi, and gcc is built with the following multilibs (arm-none-eabi-gcc --print-multi-lib):

.;
thumb;@mthumb
thumb/thumb2;@mthumb@march=armv7
thumb/armv6-m;@mthumb@march=armv6-m
thumb/cortex-m4/float-abi-hard/fpuv4-sp-d16;@mthumb@mcpu=cortex-m4@mfloat-abi=hard@mfpu=fpv4-sp-d16

Compiling for Cortex-M3

When building your programs the CFLAGS you want are:

-mthumb -mcpu=cortex-m3 --march=armv7-m

Compiling for Cortex-M4

When building your programs the CFLAGS you want are:

-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16

You may also want:

-mthumb-interwork -mlittle-endian

Build

Install required packages

  • Debian: apt-get install build-essential automake bzip2 libtool gcc-multilib libncurses5-dev
  • Raspbian: apt-get install bzip2 libtool libncurses5-dev flex bison texlive
  • CentOS: yum install gcc gcc-c++ make autoconf glibc-devel.i386 libstdc++-devel.i386 automake ncurses-devel

Download / extract scripts

  • Set options for 32 or 64 bits in '_env-only.sh' (must match to host that does the cross compiling)
  • Update version numbers in '_env-only.sh' as needed (see download/README.md)

Download src packages into download directory (or skip to the next step, and run './auto.sh')

Run "./xx-build-all.sh" (or "./auto.sh" to download sources) to start the build

  • Go make a snack and watch a movie, it's going to take anywhere from 15 minutes to multiple hours.
  • The build should be successfull if there's a file named "xx-ready.txt" and a numbered "-ready.txt" for each build script.
  • 'xx-restart.sh' will delete all '*-build' directories and starts building from scratch.

Install

cd install
mkdir /opt/arminarm
cp -R * /opt/arminarm
export PATH=$PATH:/opt/arminarm/bin    #or add to your .profile or whatever

Uninstall

rm -rf /opt/arminarm

Credit

Credit goes to Michael Fischer (www.yagarto.org) for the original scripts.

Changes/tweaks by the following people:

caspencer (https://github.com/caspencer/arm-toolchain-build-scripts)

  • based on yagarto for Windows 20110429
  • removed the MinGW/MSYS-specific stuff
  • fixed some things regarding how libgmp is built and referenced (forced 32-bit build)
  • added .log files for each numbered build script

amour03 (https://github.com/amoer03/arm-toolchain-build-scripts)

  • extra script for downloading
  • updated versions of sources
  • extra environment vars

rktrlng/ARMinARM (https://github.com/rktrlng/arm-toolchain-build-scripts)

ARMinARM (https://github.com/ARMinARM/arm-toolchain-build-scripts)

  • Raspberry Pi specific tweaks

About

Scripts for building a gcc-based ARM toolchain on Linux.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages