-
-
Notifications
You must be signed in to change notification settings - Fork 107
64 Bit Cross Compiler: Installation Instructions
- These 64-Bit Compiler Toolchain Binaries will only compile programs for Raspberry Pi Models/Versions with
ARMV8-A
CPU Architecture that supports 64-Bit execution state(You can find all supported Raspberry Pi Models here) and with Raspberry Pi 64-Bit OS flavors(such asPi64 by @bamarni
) installed. - Note::bulb: These instructions are exclusively for GCC Cross Compiler version 9.2.0 but will work with any compiler version available with this project.
-
Update your environment:
sudo apt update && sudo apt dist-upgrade
-
Install Important Packages:
sudo apt-get install build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev
You can easily visit downloading page and find suitable cross-binaries for your Machine. Click Link given below:
This repository now provides Free-Standing Cross-Compiler Toolchains that gives a common setup for everyone, the same standardized headers with no hardcoded paths, therefore the same solutions for everyone.
-
Extraction: Extract using
tar
terminal command as follows:tar xf <filename e.g cross-gcc-9.1.0-pi_64.tar.gz>
-
Linking:
PATH=/<extracted folder-name e.g cross-pi-gcc-9.1.0-64>/bin:$PATH LD_LIBRARY_PATH=/<extracted folder-name e.g cross-pi-gcc-9.1.0-64>/lib:$LD_LIBRARY_PATH
-
Extraction: Extract using
tar
terminal command as follows:tar xf <filename e.g cross-gcc-9.1.0-pi_64.tar.gz>
-
Configuring: Move extracted folder to any location (for e.g.
/opt
) by using following command:sudo mv <extracted folder-name e.g cross-pi-gcc-9.1.0-64> /opt
-
Linking: Properly link Path/Environment Variables permanently with either of the following given methods:
-
Appending variables to your
.profile
: (Recommended)echo 'export PATH=/opt/<extracted folder-name e.g cross-pi-gcc-9.1.0-64>/bin:$PATH' >> .profile echo 'export LD_LIBRARY_PATH=/opt/<extracted folder-name e.g cross-pi-gcc-9.1.0-64>/lib:$LD_LIBRARY_PATH' >> .profile source .profile
-
Appending variables to your
.bashrc
:⚠️ Some Linux users reported some trouble with configuring path variables at.profile
that doesn't seem to work for them. If you encounter a similar problem, try setting/configure by adding paths to your.bashrc
file instead of as follows:echo 'export PATH=/opt/<extracted folder-name e.g cross-pi-gcc-9.1.0-64>/bin:$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=/opt/<extracted folder-name e.g cross-pi-gcc-9.1.0-64>/lib:$LD_LIBRARY_PATH' >> .bashrc source .bashrc
-
-
Extra step to use Cross-Compiler Binaries with CMAKE: Enable CMAKES's implicit directory feature by injecting the following lines into toolchain file: (Refer Issue:#3)
unset(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES) unset(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES)
If these binaries helped you big time, please consider supporting it. Thank you.
Also, don't forget to share your views & drop a ⭐
- Native-Compiler ARM Toolchains Guide
- Cross-Compiler ARM Toolchains Guide
- Native-Compiler 64-Bit GCC ARM64 Toolchains Guide
- Cross-Compiler 64-Bit GCC ARM64 Toolchains Guide