The ARM versatile express support in QEMU can be used to test the Linux kernel built with LLVM.
- Installed ARM cross compiler in $PATH (/opt/arm-2011.03 assumed)
Using the LLVMLinux project
If you have not already done so, clone the LLVMLinux project:
Now make the versatile express target
cd llvmlinux/targets/vexpress make
The Makefile will build all the prerequisites (Clang, Qemu), download the kernel, apply the patch for LLVM compatibility, copy a tested config file and build the kernel.
To use a prebuilt version of QEMU, just modify INSTALLDIR in llvmlinux/targets/Makefile.
To use a prebuilt version of Clang, modify llvmlinux/config/make-kernel.sh
The versatile board needs no board specific patches. The common patches in llvmlinux/common and llvmlinux/common/arm need to be applied. The config file for the versatile express is in llvmlinux/targets/vexpress.
Testing the built kernel
To test the newly built kernel:
cd llvmlinux/targets/vexpress make test # boot GNU initramfs in QEMU make test2 # boot toybox based initramfs in QEMU make test3 # boot Linaro SD card image in QEMU