clang/kbuild_helper: fix arm64 cross compilation (#2288)
clang/kbuild_helper: fix arm64 cross compilation (#2288)

Commit 28949f17e0 ("Translate arch into source directory when ARCH is set")
moved $ARCH processing earlier in the function so $ARCH gets processed
by the the same logic which parses the uname_machine value.

This introduced two bugs breaking ARCH=arm64 cross-compilation:

1. The arch.compare(0, 3, "arm") test matches both $ARCH=arm and $ARCH=arm64
leading to builds which always include from "arch/arm/include" instead
of "arch/arm64/include".

2. The only way arch == arm64 is if $ARCH=aarch64. uname returns aarch64
but the rest of the compiler logic expects $ARCH=arm64.

This fixes the above bugs by moving the "aarch64" test earlier than
the "arm" test and also accepting ARCH=arm64.

Fixes: 28949f17e0 ("Translate arch into source directory when ARCH is set (#2122)")
Signed-off-by: Adrian Ratiu <7ec73abcfe099fc5574c01312b62768070c80980@collabora.com>
iovisor/bcc,tuxology/bcc,brendangregg/bcc,iovisor/bcc,tuxology/bcc,iovisor/bcc,brendangregg/bcc,brendangregg/bcc,iovisor/bcc,tuxology/bcc,iovisor/bcc,brendangregg/bcc,tuxology/bcc,tuxology/bcc,brendangregg/bcc