-
-
Notifications
You must be signed in to change notification settings - Fork 107
64 Bit Cross Compiler: Installation Instructions
Note:💡 These instructions are exclusively for GCC 64-Bit Cross Compiler version 9.1.0 but will work with all 64-bit compiler versions available with this project.
-
Update your environment:
sudo apt-get update && dist-upgrade -
Install Important Packages:
sudo apt-get install build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev
- Visting download page on Browser: You can easily visit downloading page and find suitable cross-binaries for your Machine. Click Link given below:
-
Through Terminal: You can also download files directly from your terminal with
wgetas follows:wget 'https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compilers/GCC%208.3.0/Raspberry%20Pi%203A%2B%2C%203B%2B/cross-gcc-8.3.0-pi_3%2B.tar.gz'
-
Extraction: Extract using
tarterminal command as follows:tar xf <filename e.g cross-gcc-9.1.0-pi_64.tar.gz>
-
Configuring: Move extracted folder to its correct location (i.e.
/opt) by using following command:sudo mv <extracted folder-name e.g cross-pi-gcc-9.1.0-2> /opt
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-2>/bin:$PATH' >> .profile echo 'export LD_LIBRARY_PATH=/opt/<extracted folder-name e.g cross-pi-gcc-9.1.0-2>/lib:$LD_LIBRARY_PATH' >> .profile source .profile
-
Appending variables to your
.bashrc:⚠️ Some Linux users reported some trouble with configuring path variables at.profilethat doesn't seem to work for them. If you encounter a similar problem, try setting/configure by adding paths to your.bashrcfile instead of as follows:echo 'export PATH=/opt/<extracted folder-name e.g cross-pi-gcc-9.1.0-2>/bin:$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=/opt/<extracted folder-name e.g cross-pi-gcc-9.1.0-2>/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