This repository contains Crosstool-NG configurations and helper scripts to build Windows and Linux toolchains for my personal use.
Updated to GCC 8.1.0.
Remember to re-run ./bootstrap.sh
when updating from an older version.
Updated to GCC 7.2.0.
Remember to re-run ./bootstrap.sh
when updating from an older version.
- Tested on Ubuntu 16.04 LTS and Debian 8.7
sudo apt-get update
sudo apt-get install -y build-essential automake gperf bison flex gawk libncurses5-dev python-dev texinfo help2man mingw-w64
./bootstrap.sh
Build a single toolchain:
./build-toolchain.sh gcc-arm-socfpga_hf-eabi-linux
.. or build all of them:
./build-toolchain.sh gcc-*
Building all toolchains requires 45 GB of disk space and will take about 2 hours on a recent Core i7 machine.
Afterwards, you will (hopefully) find nicely packaged toolchains in the "releases" folder.
Each toolchain directory has a defconfig
-file. To make changes, execute:
../crosstool-ng defconfig
../crosstool-ng menuconfig
../crosstool-ng saveconfig
Altera's SoC EDS includes a variant of Sourcery CodeBench Lite. While the full version supports the "hard" floating point ABI, the lite edition only supports "softfp" -- i.e. floating point arguments are passed in integer registers on function calls.
The alternatives are no better: GNU ARM Embedded only supports Thumb mode (which is 10% slower), and Linaro's arm-eabi toolchain only does software floating point (on purpose, for bootloaders). All other prebuilt toolchains are either proprietary or outdated.
-
Use fastest floating point ABI
-mfloat-abi=hard
-
newlib options
-
Reeantrancy with multi-thread and multi-core support (see 10, 11)
-DREENTRANT_SYSCALLS_PROVIDED -D__DYNAMIC_REENT__
-
Disable NEON optimized memcpy to prevent floating point instructions in otherwise integer-only code.
As there is no better flag (see 12), newlib is configured with
-mno-unaligned-access
-
Mentor Graphics stopped to release Sourcery CodeBench Lite in 2013 (and only supported softfp anyways).
-
Use fastest floating point ABI
-mfloat-abi=hard
-
newlib
-
Reentrancy with multi-thread support
-DREENTRANT_SYSCALLS_PROVIDED
-