I wanted to compile software for NVIDIA Jetson release r32.7 using the recommended Linaro gcc 7.3.1 2018.05 aarch64 toolchain. However there is no binary release for native compilation on aarch64 hosts, so I needed to build my own copy of the toolchain. This script does so.
Note that from Jetson release r34, the toolchain has changed to the Bootlin gcc toolchain. This script does not compile this toolchain.
Thanks to Vivin Uthappa for his blog post that introduced the process of building the Linaro toolchain.