This project now provides user-friendly open-sourced bash build-scripts that auto-generates Compressed Cross & Native GCC ARM/ARM64 Toolchain binaries targeting Raspberry Pi 32-bit & 64-bit OSes. If you need additional language support or need to compile another suitable GCC version toolchains for your Raspberry Pi, then you can manually compile any GCC toolchains by running suitable build-scripts yourself through your system terminal.
- This script auto-generates Compressed Cross & Native GCC ARM Toolchain binaries targeting Raspberry Pi 32-bit Stretch(Debian 9) & Buster(Debian 10) OSes.
- This script auto-generates Compressed Cross & Native GCC ARM64 Toolchain binaries targeting any Raspberry Pi 64-bit (like Pi64) OSes.
You can run these bash scripts to manually compile any GCC toolchains version through your system terminal:
Important
-
For downloading artifacts these build-scripts requires an active Internet connection.
-
These build-scripts supports Linux-machines only.
-
Update environment & Install prerequisites:
# update your system sudo apt update && sudo apt dist-upgrade # install prerequisites sudo apt-get -y install gcc g++ gperf flex texinfo gawk gfortran texinfo bison \ build-essential openssl unzip wget git pigz \ libncurses-dev autoconf automake tar figlet
Optional: Install
ccache
for speeding up build time:# Install package sudo apt install -y ccache # Update symlinks sudo /usr/sbin/update-ccache-symlinks # Perpend ccache into the PATH echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc # Added related env variables export CCACHE_COMPRESS=1 export CCACHE_DIR=$HOME/.ccache # Source .bashrc to test the new PATH source ~/.bashrc && echo $PATH
-
Clone this repository:
# clone repository git clone https://github.com/abhiTronix/raspberry-pi-cross-compilers.git # call directory cd raspberry-pi-cross-compilers/build-scripts
-
Run scripts:
-
Usage parameters: This script requires a few command-line parameters, just run
./RTBuilder_32b
on terminal:Usage: ./RTBuilder_32b -g [GCC version] -r [Target Pi type] -o [Target Pi OS type] -g GCC version you want to compile?: (7.1.0|7.2.0|7.3.0|7.4.0|7.5.0|8.1.0|8.2.0|8.3.0|9.1.0|9.2.0|9.3.0) -r What's yours Raspberry Pi type?: (0-1|2-3|3+) -o What's yours Raspberry Pi OS type?: (stretch|buster)
-
Usage: Just pass targeted GCC version to
-g
parameter, targeted raspberry pi type to-r
parameter, and targeted raspberry pi OS type to-o
parameter of this script:⚠️ You must NOT compile GCC version less than GCC 8.3.0 for Buster OS, otherwise script will automatically switch to build for Stretch OS.chmod +x RTBuilder_32b ./RTBuilder_32b -g "9.2.0" -r "2-3" -o "buster"
This will take some time (approximately 55mins on 8cores), so grab a coffee ☕. On returning you will find
native-gcc-{GCC_VERSION}-pi_{PI_TYPE}.tar.gz
andcross-gcc-{GCC_VERSION}-pi_{PI_TYPE}.tar.gz
at your$HOME
directory.
-
Usage parameters: This script requires few command-line parameters, just run
./RTBuilder_64b
:Usage: ./RTBuilder_64b -g [GCC version] -t [OS Type] -g GCC version you want to compile?: (7.1.0|7.2.0|7.3.0|7.4.0|7.5.0|8.1.0|8.2.0|8.3.0|9.1.0|9.2.0|9.3.0) -t What's yours Raspberry Pi OS type?: (1|2) [default:1]
-
Usage: Just pass targeted GCC version to
-g
parameter of this script:chmod +x RTBuilder_64b ./RTBuilder_64b -g "9.2.0"
This will take some time (approximately 55mins on 8cores), so grab a coffee ☕. On returning you will find
native-gcc-{GCC_VERSION}-pi_64.tar.gz
andcross-gcc-{GCC_VERSION}-pi_64.tar.gz
at your$HOME
directory.
-
These scripts provide a few additional environment variables to tweak Toolchain Builds:
-
BUILDDIR
: To change build directory. By default it is set to temp(/tmp
) directory. Its usage is as follows:⚠️ Make sure assigned directory has read/write permission.BUILDDIR="/home/foo/foo1"
-
LANGUAGES
: To change supported programming languages for your Toolchains. Its default value isc,c++,fortran
. Its usage is as follows:⚠️ Make sure to install additional dependency manually according to your assigned supported languages.LANGUAGES="c,go,brig,d"
These scripts only support newer GCC versions, those are as follows:
GCC Version | Stretch OS build (32-bit) | Buster OS build (32-bit) | 64-bit OS build |
---|---|---|---|
7.1.0 | supported | x | supported |
7.2.0 | supported | x | supported |
7.3.0 | supported | x | supported |
7.4.0 | supported | x | supported |
7.5.0 | supported | x | supported |
8.1.0 | supported | x | supported |
8.2.0 | supported | x | supported |
8.3.0 | supported | supported | supported |
9.1.0 | supported | supported | supported |
9.2.0 | supported | supported | supported |
9.3.0 | supported | supported | supported |
If these binaries helped you big time, please consider supporting it through any size donations. Thank you ❤️.
You can also share your thoughts or just drop a star ⭐. Thank you.
Here is a Bibtex entry you can use to cite this project in a publication:
@misc{raspberry-pi-cross-compilers,
Title = {Raspberry Pi Toolchains},
Author = {Abhishek Thakur},
howpublished = {\url{https://github.com/abhiTronix/raspberry-pi-cross-compilers}}
}
Copyright © 2020 abhiTronix
This Project source-code and its precompiled binaries are licensed under the GPLv3 license.