Cross-compiling for ARM on x86 with llvm/Clang


Without going into too much detail I think the basic problem is that
when you use gcc as the linker driver you are using the linker from
aarch64-linux-gnu which will include the GNU linker supporting aarch64
and the aarch64 libraries. When you set the sysroot to
arm-linux-gnueabi you are using the aarch32 sysroot which won't
include the libraries and linker needed for aarch64. It will be worth
finding out the sysroot that aarch64-linux-gnu-gcc is using and use
that instead.