• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[TOOLCHAINS] [ARM/ARM64] [GCC 7.2.1] GNU and Linaro - September 15th, 2017

Search This thread

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,753
50,003
26
Mesa, AZ
nathanchance.dev
Introduction

Hello everyone, these are some arm and arm64 toolchains I have compiled using a script created by @USBhost and modified by @frap129 and me. I know the concept of toolchains is not a new one, as there have been many specialized/optimized variants. However, some people may want a pure/unaltered toolchain for certain projects. That's what this will be, a generic/simple toolchain configuration. These will be done on a semi-nightly basis. They have been tested on up to date Arch Linux and Ubuntu 17.04 systems. If you know how to use scripts or cross compile, feel free to skip straight to the downloads!


Configuration

The GNU (standard or unlabeled) toolchains are built from GNU's latest gcc-7-branch. The Linaro toolchains are compiled from the linaro-local/gcc-7-integration-branch branch.

These are the additional components:
Code:
binutils 2.29.1
gmp 6.1.2
mpfr 3.1.5
mpc 1.0.3
isl 0.18
bionic r15c
Latest Linux Kernel headers (7318413077a5141a50a753b1fab687b7907eef16)

These toolchains are statically linked so they should work on any 64-bit Linux system; let me know if there are any issues with this.


Build script

These were compiled with crosstool-NG, which is extremely versatile but a little complex for the average user. Instead, I offer a build script in this repo to compile very similar toolchains (they will not be statically linked but that's no issue if you are only compiling on your machine and they won't have bionic). It has been modified heavily from the original repo to support two different architecture configurations (more can easily be added upon request).

To learn more about the script, give the README a glance, as it will be more up to date than the thread.


Using the toolchains

Please see the README.


Issues?

If you run into any issues with either using or compiling these toolchains, please do one of the following:
  • Open an issue on Github. Use the toolchains repo for issues with using, use the script repo for issues with compiling.
  • Make a post on here.
In both cases, I will require a detailed explanation of your system configuration, what you are compiling, and a FULL terminal output; without these, your problem will be ignored.


Credits

  • @USBhost: For the initial script and permission to make this thread
  • @frap129: For his modifications to the script
  • @MSF Jarvis: For testing the arm option
  • @kantjer: For testing the Ubuntu versions on Linux Mint
 
Last edited:

frap129

Inactive Recognized Developer
Jan 6, 2013
1,392
4,124
Dude it took me days to get arm to build because of weird errors and you just added a flag that builds it? :eek:
 
  • Like
Reactions: nathanchance

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,753
50,003
26
Mesa, AZ
nathanchance.dev
So linaro or standard, what's recommended?
And what flags do you suggest to use for ROM and kernel?

I personally use Linaro given all the work they do for the arm architecture. These are the flag I use for my kernel. I'd love to claim credit for them but @kwoktopus helped me with most of them :p

Any support for x86/x86_64 platform?

I do not currently plan on it but if there is enough demand I can consider it.
 

zibiksior

Senior Member
Dec 8, 2009
349
100
Warsaw
Hi, can I use it to compile my rom based on LineageOS 14.1? I started to develop my own rom recently and now I wanted to try changing the toolchain. :)
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,753
50,003
26
Mesa, AZ
nathanchance.dev
Hi, can I use it to compile my rom based on LineageOS 14.1? I started to develop my own rom recently and now I wanted to try changing the toolchain. :)

Mostly will not be able to compile a ROM with this but give it a try. It for sure can compile the inline kernel.

Just a brief update, the build script still works perfectly fine but I will start compiling the provided toolchains with crosstool-NG as I can make the toolchains statically linked, meaning that they should work with all versions of Linux. It will also be easier for me to manage and tarballs will be smaller. I will try to have this done tomorrow, given Linaro just released their updated snapshot source :)
 

zibiksior

Senior Member
Dec 8, 2009
349
100
Warsaw
Mostly will not be able to compile a ROM with this but give it a try. It for sure can compile the inline kernel.

Just a brief update, the build script still works perfectly fine but I will start compiling the provided toolchains with crosstool-NG as I can make the toolchains statically linked, meaning that they should work with all versions of Linux. It will also be easier for me to manage and tarballs will be smaller. I will try to have this done tomorrow, given Linaro just released their updated snapshot source :)

Ok, I undertstand can you instead point me some link with prebuild toolchains which I can use to compile my rom? I connot find any... Or meybe some manual how to compile appropriate version of toolchain?
 
Last edited:

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,753
50,003
26
Mesa, AZ
nathanchance.dev
20170520 toolchains are now uploaded!

As I mentioned before, they are compiled with crosstool-NG so that it's easier for me to update. Furthermore, the toolchains are much smaller now so they're easier to download and they're statically linked so they *should* work when any updated form of Linux. Let me know of any issues and enjoy! :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 54
    Introduction

    Hello everyone, these are some arm and arm64 toolchains I have compiled using a script created by @USBhost and modified by @frap129 and me. I know the concept of toolchains is not a new one, as there have been many specialized/optimized variants. However, some people may want a pure/unaltered toolchain for certain projects. That's what this will be, a generic/simple toolchain configuration. These will be done on a semi-nightly basis. They have been tested on up to date Arch Linux and Ubuntu 17.04 systems. If you know how to use scripts or cross compile, feel free to skip straight to the downloads!


    Configuration

    The GNU (standard or unlabeled) toolchains are built from GNU's latest gcc-7-branch. The Linaro toolchains are compiled from the linaro-local/gcc-7-integration-branch branch.

    These are the additional components:
    Code:
    binutils 2.29.1
    gmp 6.1.2
    mpfr 3.1.5
    mpc 1.0.3
    isl 0.18
    bionic r15c
    Latest Linux Kernel headers (7318413077a5141a50a753b1fab687b7907eef16)

    These toolchains are statically linked so they should work on any 64-bit Linux system; let me know if there are any issues with this.


    Build script

    These were compiled with crosstool-NG, which is extremely versatile but a little complex for the average user. Instead, I offer a build script in this repo to compile very similar toolchains (they will not be statically linked but that's no issue if you are only compiling on your machine and they won't have bionic). It has been modified heavily from the original repo to support two different architecture configurations (more can easily be added upon request).

    To learn more about the script, give the README a glance, as it will be more up to date than the thread.


    Using the toolchains

    Please see the README.


    Issues?

    If you run into any issues with either using or compiling these toolchains, please do one of the following:
    • Open an issue on Github. Use the toolchains repo for issues with using, use the script repo for issues with compiling.
    • Make a post on here.
    In both cases, I will require a detailed explanation of your system configuration, what you are compiling, and a FULL terminal output; without these, your problem will be ignored.


    Credits

    • @USBhost: For the initial script and permission to make this thread
    • @frap129: For his modifications to the script
    • @MSF Jarvis: For testing the arm option
    • @kantjer: For testing the Ubuntu versions on Linux Mint
    15
    Update!

    Couple of major updates I am pleased to announce:

    1. All of the toolchains are compiled with bionic (Android's C library) instead of glibc, meaning (in theory) these toolchains can now be used for ROM compilation in addition to kernel compilation. I have not tried this though.

    2. I have completely redone the git repo from scratch, resulting in (hopefully) a smaller repo size. I have also started offering tarballs, which will have a constant URL so you can use either curl or wget to constantly get those without the additional repo history (links for the direct tarballs are available in the table in the README).

    Please update by either recloning (recommended) or using the following commands:
    Code:
    git fetch origin
    git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)

    3. I have updated the build script repo to allow you to compile GCC 4.x, 5.x, 6.x, 7.x, or 8.x with ease. Please see the README and built in help menu for more info. NOTE: These will still be built with glibc, as I have not studied how to compile with bionic.

    Enjoy!
    9
    Update!

    Some kernel compilers probably noticed some spam like this after the last toolchain update:
    Code:
    Warning: ignoring attempt to redefine built-in register 'lr'
    Turns out there is something up with the released tarball of binutils 2.29; I have used the upstream git repo and everything works fine now.

    Some other people have reported issues with kernels not booting after the August 5th toolchains. I am not having any issues so I have no way to diagnose issues. Sorry!

    Lastly, I added some commits to crosstool-NG that allows me to remove that horrible versioning in the package name so now gcc --version's output (and by extension, the full kernel version from /proc/version) is much cleaner. Something small but super necessary imo.

    Update by using git pull or downloading the latest tarball. Enjoy!

    Changelog:
    * Update GNU version to latest from upstream
    * Fix binutils
    * Update headers
    9
    Update!

    Toolchains have been updated to GCC 7.2.1 with bionic from NDK r15c and binutils 2.29. Either use git pull or download the tarball using the links in the README. Enjoy!
    6
    New toolchains have been released!

    I will pretty much update these once a month, GCC 7.1.1 is in a very stable spot.

    All you should need to do is run a git pull. If for some reason there are any odd errors, get your current branch by typing git branch then run the following commands:
    Code:
    git fetch origin <branch_name>
    git reset --hard origin/<branch_name>

    Nothing else to note, enjoy!