Cross-compiling for ARM on x86 with llvm/Clang

A simpler way might be to get ELLCC (

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

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

That was on an x86_64 system.