This repo will no longer be updated as I don't have the time. You can compile these toolchains yourself with either crosstool-NG or my build-tools-gcc repo. For Linaro toolchains, you can download their prebuilts on their releases site.
These are my personal toolchains, cross compiled for arm and arm64. They will always be up to date with the latest stable GCC (currently 7.1.1). I use them for compiling Flash Kernel. They are compiled with crosstool-NG.
Most if not all versions of 64-bit Linux should work with these as they are statically linked. Let me know if there are any issues following the questions section below.
- A standard GNU version, build straight from the gcc-7-branch
- A Linaro version, currently compiled from the linaro-local/gcc-7-integration-branch branch
Architecture | GCC source | Branch | Prefix | Tarball link |
---|---|---|---|---|
arm | GNU | arm-gnu-7.x | arm-gnu-linux-androideabi- | Link |
arm | Linaro | arm-linaro-7.x | arm-linaro-linux-androideabi- | Link |
arm64 | GNU | aarch64-gnu-7.x | aarch64-gnu-linux-android- | Link |
arm64 | Linaro | aarch64-linaro-7.x | aarch64-linaro-linux-android- | Link |
To use these toolchains, you first need to do a shallow clone (to avoid pulling too much history):
git clone -b <branch> --depth=1 https://github.com/nathanchance/gcc-prebuilts
Then point your cross compiler to the toolchain. For kernels, you can do the following:
export CROSS_COMPILE=$(pwd)/gcc-prebuilts/bin/<prefix>
Alternatively, if you are really short on space and don't want to clone a git repo, you can fetch the latest toolchain using the link above either via curl or wget directly to your terminal.
For kernels, you must have the following four commits:
- Makefile: Fix device not booting with GCC 7.x and above
- Revert "scripts: gcc-wrapper: Use wrapper to check compiler warnings"
- kernel: use the gnu89 standard explicitly
- compiler-gcc: integrate the various compiler-gcc[345.h] files
The last two commits are from Linux upstream. The first is only needed if your version is 3.10.79 or earlier. The second is needed for both 3.10 (3.10.101 or earlier) and 3.18 (3.18.31 or earlier). I do recommend upstreaming your kernels but if you choose not to, just pick that commit.
If you would like to learn how to compile these toolchains, please give this README a glance.
If you have any questions or issues, please open an issue on this repo or the build-tools-gcc repo OR make a post in the XDA thread and I'll do my best to assist you.