While cross-compiling Linux kernel tools with Clang on ArchLinux, it
was revealed the sysroot and triplet are not properly detected and
instead of fixing the root cause in Clang, kernel developers started
doing workarounds [1] upon workarounds [2] in the kernel build to be
able to pass a working sysroot and triplet during Clang invocation.
To give a concrete example, ArchLinux installs its cross-compliation
sysroot in /usr/aarch64-linux-gnu for triplet aarch64-linux-gnu.
This causes two problems which this commit fixes:
1. The triplet results in an Unknown OS & Unknown distro. To fix this
error, we call Triplet::normalize() which does the following transform
aarch64-linux-gnu -> aarch64-unknown-linux-gnu, then the OS & Distro
are properly detected.
2. The sysroot under /usr/<triplet> itself is not properly detected
in Linux::computeSysRoot() so we add a relative path to the ArchLinux
installed GCC toolchain.
Fixing these two bugs allows to significantly clean up the kernel
build as well as fix the cross-compilation detection on ArchLinux.
[1] https://github.com/torvalds/linux/commit/cebdb7374577ac6e14afb11311af8c2c44a259fa
[2] https://github.com/torvalds/linux/commit/7fd9fd46a459272e641be78c1cc36baab1921fa1