Cross-compiling for ARM on x86 with llvm/Clang

A simpler way might be to get ELLCC (http://ellcc.org):

rich@dev:~$ ~/ellcc/bin/ecc -target arm64v8-linux hello.c
rich@dev:~$ file a.out
a.out: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
rich@dev:~$ ~/ellcc/bin/qemu-aarch64 a.out
hello world
rich@dev:~$

ELLCC includes all the stuff you need: libraries, linker, etc.

That was on an x86_64 system.

-Rich