rktrlng / arm-toolchain-build-scripts

Scripts for building a gcc-based ARM toolchain on Linux. Based on YAGARTO build scripts by Michael Fischer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ARM toolchain build scripts

Scripts for building a gcc-based ARM toolchain on Linux (target=arm-none-eabi) for building for the Cortex-M4 line of ARM processors, using hardware floating point instructions 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

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 libtoollibncurses5-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 gonna 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/yagarto
cp -R * /opt/yagarto
export PATH=$PATH:/opt/yagarto/bin    #or add to your .profile or whatever

Uninstall

rm -rf /opt/yagarto

Credit

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

Changes/tweaks by the following people:

caspencer (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:

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

rktrlng:

About

Scripts for building a gcc-based ARM toolchain on Linux. Based on YAGARTO build scripts by Michael Fischer.


Languages

Language:Shell 100.0%