|
1 |
| -# Latest Set of Precompiled Raspberry Pi GCC Cross-Compilers/Native Binaries - v2.0(Fastest & Easiest Method) |
2 |
| -**20 Febraury, 2019: Major Native Compiler Fixes** |
3 |
| -[](https://sourceforge.net/p/raspberry-pi-cross-compilers/) |
4 |
| -[](https://github.com/abhiTronix/raspberry-pi-cross-compilers) |
| 1 | +# Latest Set of Precompiled GCC Cross & Native Compiler Binaries for Raspberry Pi - v2.5 (Stable-Release) |
| 2 | + |
| 3 | +***Update 06 March, 2019: Major Native Compiler Fixes*** |
| 4 | + |
5 | 5 | [-yellow.svg?style=for-the-badge)](https://github.com/abhiTronix/raspberry-pi-cross-compilers)
|
6 | 6 | [](https://github.com/abhiTronix/raspberry-pi-cross-compilers)
|
7 | 7 |
|
8 | 8 | ## Summary:
|
9 |
| -This project contains the Latest Set of Precompiled Raspberry pi GCC Cross-Compilers(*i.e. 8.2.0*), saving your tons of time(*No compiling or Error Handling needed whatsoever*). Just Extract, Link & Enjoy full GCC(*Raspberry Pi*) functionality in your Machine. You can use it as native compiler for raspberry pi(*Can be used besides old & slow 6.3.0 GCC with full C++17 support*), Or use it as Cross-Compiler in any Linux Machine(*Tested on Latest Ubuntu/bionic x64*) to compile programs for your Raspberry Pi (*Both Latest 8.2.0 & Current 6.3.0 binaries available*). |
| 9 | +This project contains the UpToDate set of **Precompiled Raspberry pi GCC Cross & Native Compilers Binaries**, saving your tons of time(*No compiling or Error Handling needed whatsoever*). Just Extract, Link & Enjoy complete GCC(*Raspberry Pi*) functionality in your Machine. You can use its native compilers for Raspberry Pi(*Can be used along with old & slow 6.3.0 GCC*), Or use the Cross-Compiler in any Linux Machine(*Tested on Latest Ubuntu/bionic x64*) to compile programs for your Raspberry Pi. All these compilers binaries are Raspberry Pi hardware optimized for enhanced overall performance. |
| 10 | + |
| 11 | +### Supported GCC Versions: |
| 12 | +- GCC 6.3.0 |
| 13 | +- GCC 7.4.0 |
| 14 | +- GCC 8.2.0 |
| 15 | +- GCC 8.3.0 |
| 16 | + |
| 17 | +### Supported Hardwares: |
| 18 | +- All Raspberry Pi versions/models are currently supported. |
| 19 | +- Any other ARM Devices with similar Hardware configurations, may also work. |
| 20 | + |
| 21 | +## Binaries Description: |
| 22 | +![]() |
| 23 | + |
| 24 | +### Available Binaries Reference Tree: |
| 25 | +``` |
| 26 | +
|
| 27 | +Raspberry Pi GCC Cross & Native Compilers |
| 28 | +├── Raspberry Pi GCC Cross-Compilers |
| 29 | +│ ├── GCC 6.3.0 |
| 30 | +│ │ ├── Raspberry Pi 1, Zero |
| 31 | +│ │ │ └── cross-gcc-6.3.0-pi_0-1.tar.gz |
| 32 | +│ │ ├── Raspberry Pi 2, 3 |
| 33 | +│ │ │ └── cross-gcc-6.3.0-pi_2-3.tar.gz |
| 34 | +│ │ └── Raspberry Pi 3A+, 3B+ |
| 35 | +│ │ └── cross-gcc-6.3.0-pi_3+.tar.gz |
| 36 | +│ ├── GCC 7.4.0 |
| 37 | +│ │ ├── Raspberry Pi 1, Zero |
| 38 | +│ │ │ └── cross-gcc-7.4.0-pi_0-1.tar.gz |
| 39 | +│ │ ├── Raspberry Pi 2, 3 |
| 40 | +│ │ │ └── cross-gcc-7.4.0-pi_2-3.tar.gz |
| 41 | +│ │ └── Raspberry Pi 3A+, 3B+ |
| 42 | +│ │ └── cross-gcc-7.4.0-pi_3+.tar.gz |
| 43 | +│ ├── GCC 8.2.0 |
| 44 | +│ │ ├── Raspberry Pi 1, Zero |
| 45 | +│ │ │ └── cross-gcc-8.2.0-pi_0-1.tar.gz |
| 46 | +│ │ ├── Raspberry Pi 2, 3 |
| 47 | +│ │ │ └── cross-gcc-8.2.0-pi_2-3.tar.gz |
| 48 | +│ │ └── Raspberry Pi 3A+, 3B+ |
| 49 | +│ │ └── cross-gcc-8.2.0-pi_3+.tar.gz |
| 50 | +│ └── GCC 8.3.0 |
| 51 | +│ ├── Raspberry Pi 1, Zero |
| 52 | +│ │ └── cross-gcc-8.3.0-pi_0-1.tar.gz |
| 53 | +│ ├── Raspberry Pi 2, 3 |
| 54 | +│ │ └── cross-gcc-8.3.0-pi_2-3.tar.gz |
| 55 | +│ └── Raspberry Pi 3A+, 3B+ |
| 56 | +│ └── cross-gcc-8.3.0-pi_3+.tar.gz |
| 57 | +└── Raspberry Pi GCC Native-Compilers |
| 58 | + ├── GCC 7.4.0 |
| 59 | + │ ├── Raspberry Pi 1, Zero |
| 60 | + │ │ └── native-gcc-7.4.0-pi_0-1.tar.gz |
| 61 | + │ ├── Raspberry Pi 2, 3 |
| 62 | + │ │ └── native-gcc-7.4.0-pi_2-3.tar.gz |
| 63 | + │ └── Raspberry Pi 3A+, 3B+ |
| 64 | + │ └── native-gcc-7.4.0-pi_3+.tar.gz |
| 65 | + ├── GCC 8.2.0 |
| 66 | + │ ├── Raspberry Pi 1, Zero |
| 67 | + │ │ └── native-gcc-8.2.0-pi_0-1.tar.gz |
| 68 | + │ ├── Raspberry Pi 2, 3 |
| 69 | + │ │ └── native-gcc-8.2.0-pi_2-3.tar.gz |
| 70 | + │ └── Raspberry Pi 3A+, 3B+ |
| 71 | + │ └── native-gcc-8.2.0-pi_3+.tar.gz |
| 72 | + └── GCC 8.3.0 |
| 73 | + ├── Raspberry Pi 1, Zero |
| 74 | + │ └── native-gcc-8.3.0-pi_0-1.tar.gz |
| 75 | + ├── Raspberry Pi 2, 3 |
| 76 | + │ └── native-gcc-8.3.0-pi_2-3.tar.gz |
| 77 | + └── Raspberry Pi 3A+, 3B+ |
| 78 | + └── native-gcc-8.3.0-pi_3+.tar.gz |
| 79 | +
|
| 80 | +30 directories, 21 files |
| 81 | +
|
| 82 | +
|
| 83 | +``` |
10 | 84 |
|
11 |
| -### Supported Raspberry Pi: |
12 |
| -Raspberry Pi Zero/2/3 any version/model (Performance may vary) <t>[](https://github.com/abhiTronix/raspberry-pi-cross-compilers) |
| 85 | +## Supported Languages(full functionality): |
| 86 | + |
| 87 | +- C++ |
| 88 | +- Fortran |
| 89 | +- C |
| 90 | +- Ask for other Language support. |
13 | 91 |
|
14 |
| -## Binaries Description: (Read Carefully) |
15 |
| -- `gcc-6.3.0-rpi.tar.bz2` - GCC Raspberry Pi Cross-Compilier version 6.3.0, works with Ubuntu(or other Linux distro) |
16 |
| -- `gcc-8.2.0-rpi.tar.bz2` - GCC Raspberry Pi Cross-Compilier version 8.2.0, works with Ubuntu(or other Linux distro) |
17 |
| -- `gcc-8.2.0.tar.bz2` - GCC Native Raspberry Pi version 8.2.0, works with Raspberry Pi 2/3 any Model(Zero not tested) |
18 | 92 |
|
19 | 93 | ## Binaries Download:
|
20 |
| -Compressed Precompiled Binary Files are available. |
21 |
| -You can easily download them from Sourceforge:(_Links Below_) |
| 94 | +Compressed Precompiled Binary Files are available. You can easily download them from Sourceforge:(_Links Below_) |
22 | 95 | ### Files https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/
|
23 |
| -[](https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/latest/download) |
24 | 96 |
|
25 | 97 | ---
|
26 | 98 |
|
27 |
| -## Extracting & Linking: (Read & Execute Carefully) |
28 |
| -**1. Prerequisites (Native & Cross-Compiler):** |
29 |
| - * Update your environment `sudo apt-get update && dist-upgrade` |
30 |
| - * Install Build-essential gawk, texinfo, git, bison `sudo apt install build-essential gawk git texinfo bison` |
31 |
| - |
32 |
| -**2. Extracting (Native & Cross-Compiler):** |
33 |
| - * Extract files using cmd: `tar xf <filename e.g gcc-8.2.0.tar.bz2>` |
34 |
| - |
35 |
| -**3. Linking (Native & Cross-Compiler):** |
36 |
| - * Move files to its correct location (ie `/opt`) using cmd: `sudo mv <extracted folder-name e.g gcc-8.2.0> /opt` |
37 |
| - * Properly configure paths as below(Permanently by adding it to your `.bashrc`): |
38 |
| - ``` |
39 |
| - echo 'export PATH=/opt/<extracted folder-name e.g gcc-8.2.0>/bin:$PATH' >> .bashrc |
40 |
| - echo 'export LD_LIBRARY_PATH=/opt/<extracted folder-name e.g gcc-8.2.0>/lib:$LD_LIBRARY_PATH' >> .bashrc |
41 |
| - source .bashrc |
42 |
| - ``` |
43 |
| - **4. Manage Links as below:(Native Compiler Only)** |
44 |
| - |
45 |
| - `sudo ln -s /usr/include/arm-linux-gnueabihf/sys /usr/include/sys` |
46 |
| - `sudo ln -s /usr/include/arm-linux-gnueabihf/bits /usr/include/bits` |
47 |
| - `sudo ln -s /usr/include/arm-linux-gnueabihf/gnu /usr/include/gnu` |
48 |
| - `sudo ln -s /usr/include/arm-linux-gnueabihf/asm /usr/include/asm` |
49 |
| - `sudo ln -s /usr/lib/arm-linux-gnueabihf/crti.o /usr/lib/crti.o` |
50 |
| - `sudo ln -s /usr/lib/arm-linux-gnueabihf/crt1.o /usr/lib/crt1.o` |
51 |
| - `sudo ln -s /usr/lib/arm-linux-gnueabihf/crtn.o /usr/lib/crtn.o` |
52 |
| - |
53 |
| - **5. Manage Links as below:(Cross-Compiler Only)** |
54 |
| - |
55 |
| - Temporary fix Hardcoded paths in binaries: [#4](https://github.com/abhiTronix/raspberry-pi-cross-compilers/issues/4#issue-403285170) |
56 |
| - |
57 |
| - ``` |
58 |
| - sudo ln -s /opt/<extracted folder-name e.g gcc-8.2.0>/arm-linux-gnueabihf/lib/libpthread.so /opt/cross-pi-gcc-8.2.0/arm-linux-gnueabihf/lib/libpthread.so |
59 |
| - sudo ln -s /opt/<extracted folder-name e.g gcc-8.2.0>/arm-linux-gnueabihf/lib/libc.so /opt/cross-pi-gcc-8.2.0/arm-linux-gnueabihf/lib/libc.so |
60 |
| - ``` |
61 |
| - |
62 |
| - **6. Extra step If you want to completely replace previous `gcc-6.3.0` with latest `gcc-8.2.0`: (Native Compiler Only)** |
63 |
| - |
64 |
| - <p style='color:yellow'>MADE FOR RASPBERRY-PI/RASPBIAN-OS ONLY, DO NOT RUN THIS SCRIPT ON ANY OTHER LINUX MACHINE/OS !</p> |
65 |
| - |
66 |
| - * Download this script [experimental_6-3_w_8-2.sh](https://github.com/abhiTronix/raspberry-pi-cross-compilers/blob/master/Tools/experimental_6-3_w_8-2.sh)(_right click and "Save As"_) and execute following commands: |
67 |
| - |
68 |
| - ``` |
69 |
| - chmod +x experimental_6-3_w_8-2.sh |
70 |
| - ./experimental_6-3_w_8-2.sh |
71 |
| - ``` |
72 |
| - To revert to old GCC-6.3.0 anytime, Do [this](https://github.com/abhiTronix/raspberry-pi-cross-compilers#important). |
73 |
| - |
74 |
| - **7. Extra step to use Cross-Compiler Binaries with Cmake: (Cross-Compiler Only)** |
| 99 | +## Extracting & Linking & Testing: (Read & Execute Carefully) |
75 | 100 |
|
| 101 | +- [For Native Compilers](https://github.com/abhiTronix/raspberry-pi-cross-compilers/wiki/Native-Compiler:-Linking-&-Testing-Instructions) |
76 | 102 |
|
77 |
| - Enable CMake's implicit directory feature by injecting the following lines into toolchain file: (Refer Issue:[#3](https://github.com/abhiTronix/raspberry-pi-cross-compilers/issues/3#issuecomment-453117354)) |
78 |
| - ``` |
79 |
| - unset(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES) |
80 |
| - unset(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES) |
81 |
| - ``` |
| 103 | +- [For Cross Compilers](https://github.com/abhiTronix/raspberry-pi-cross-compilers/wiki/Cross-Compiler:-Linking-&-Testing-Instructions) |
82 | 104 |
|
83 | 105 | **That's it, Enjoy ;)**
|
84 | 106 |
|
85 | 107 | ***Don't forget to Share, drop a :star:***
|
86 | 108 |
|
87 | 109 | ---
|
88 | 110 |
|
89 |
| - ## Testing: (Post Linking) |
90 |
| - You can check Installed versions as below: |
91 |
| - * Native Compiler[***if you DON'T followed step-6***] (Raspberry pi only): |
92 |
| - `arm-linux-gnueabihf-gcc-8.2.0 --version` |
93 |
| - |
94 |
| - `arm-linux-gnueabihf-g++-8.2.0 --version` |
95 |
| - |
96 |
| - `arm-linux-gnueabihf-gfortran-8.2.0 --version` |
| 111 | +## Support This Project: |
97 | 112 |
|
| 113 | +If this project help you reduce time to develop, you can give me a cup of coffee :) |
98 | 114 |
|
99 |
| - * Native Compiler[***if you followed step-6***] (Raspberry pi only): |
100 |
| - `gcc --version` |
101 |
| - |
102 |
| - `g++ --version` |
103 |
| - |
104 |
| - `gfortran --version` |
105 |
| - |
106 | 115 |
|
107 |
| - |
108 |
| - * Cross- Compiler (Ubuntu x64 Tested): |
109 |
| - `arm-linux-gnueabihf-gcc --version` |
110 |
| - |
111 |
| - `arm-linux-gnueabihf-g++ --version` |
112 |
| - |
113 |
| - `arm-linux-gnueabihf-gfortran --version` |
| 116 | +You can donate money to the project through given PayPal account. There is no minimal amount for your donation. |
114 | 117 |
|
115 |
| ---- |
| 118 | +<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> |
| 119 | +<input type="hidden" name="cmd" value="_s-xclick" /> |
| 120 | +<input type="hidden" name="hosted_button_id" value="S5A54TFCVBSTQ" /> |
| 121 | +<input type="image" src="https://static1.squarespace.com/static/52658c2fe4b0b063c472d9e6/t/5be1e4c4cd8366bcec4619d4/1544462643232/Donate-Box_goodwill.png" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" /> |
| 122 | +<img alt="" border="0" src="https://www.paypal.com/en_IN/i/scr/pixel.gif" width="1" height="1" /> |
| 123 | +</form> |
116 | 124 |
|
117 |
| -### Important: |
118 |
| -To restore old configration(Only, if you followed step-6), download this script [Restore_old_6.3.sh](https://github.com/abhiTronix/raspberry-pi-cross-compilers/blob/master/Tools/Restore_old_6.3.sh)(_right click and "Save As"_) and execute: |
119 |
| - |
120 |
| - ``` |
121 |
| - chmod +x Restore_old_6.3.sh |
122 |
| - ./Restore_old_6.3.sh |
123 |
| - ``` |
124 |
| - |
125 |
| ---- |
126 |
| - |
127 |
| -## Supported Languages(full functionality): |
128 |
| -- C++ |
129 |
| -- Fortran |
130 |
| -- C |
131 |
| -- Ask for other Language support. |
132 | 125 |
|
133 | 126 | ## Advantages:
|
134 |
| -- C++17 support(Native Raspberrypi GCC 6.3.0 lacks it) |
| 127 | +- Fully Raspberry Pi Optimized and Improved Performance [Benchmarking Result](https://www.phoronix.com/scan.php?page=article&item=gcc-81-benchmarks&num=1) |
| 128 | +- C++17 support (Default Raspberry pi GCC 6.3.0 lacks it) and Other [Major Changes](https://www.gnu.org/software/gcc/gcc-8/changes.html) |
135 | 129 | - Fastest inbuilt optimization flags(Raspberry optimized GCC)
|
136 |
| -- Rediculously low installation time(few mins) |
137 |
| -- Benchmarking Results: https://www.phoronix.com/scan.php?page=article&item=gcc-81-benchmarks&num=1 |
| 130 | +- Ridiculously low installation time(few mins) |
138 | 131 |
|
139 |
| -### Side Note: |
140 |
| -*Building GCC 8.2.0 with the given cross compiler took about 35 minutes on my Ubuntu machine on all cores. Compare this with the straight 4~6 hours needed to build GCC 8.2.0 directly on Pi 3B+(+10 hours on Rpi2) at full CPU Load plus memory swapping needed and you will see the advantage of having a cross compiler on your main machine.* |
141 | 132 |
|
142 |
| -## Contributing and licenses |
| 133 | +## Contributing and licenses: |
143 | 134 | The original compiled GCC files source is licensed under the [GNU v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) license. However, This Project is licensed under the [Apache 2.0](https://github.com/abhiTronix/raspberry-pi-cross-compilers/blob/master/LICENSE) license.
|
144 | 135 |
|
145 |
| -You are welcome to contribute with suggestions or pull requests. To contact me, send an email. |
| 136 | +You are welcome to contribute with suggestions or pull requests. |
146 | 137 |
|
147 | 138 | ## Thanks
|
148 | 139 | https://gcc.gnu.org/ for original source files.
|
149 | 140 | https://www.raspberrypi.org/ for kernel Headers.
|
150 |
| -http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/ for nice tuitorial. |
| 141 | +http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/ for nice tutorial. |
0 commit comments