The MSM target tests building the Qualcomm MSM Linux kernel from Code Aurora Forum 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:

git clone

Now make the versatile target

cd llvmlinux/targets/msm

The Makefile will build all the prerequisites (LLVM, Clang), download the kernel, apply the patch for LLVM compatibility, copy a tested config file and build the kernel.

The msm board will fail to apply several of the upstream patches, so these are filtered out, and has additional board specific patches. The common patches in llvmlinux/common and llvmlinux/common/arm are be applied as well as the patches in llvmlinux/targets/msm. The config file for the msm platform is in llvmlinux/targets/msm. The upstream patches that could not be applied are listed in llvmlinux/targets/msm/kernel-filter.

Known Issues

  • The atomic.h assembly code is not currently supported by upstream Clang. See
    •  %H, %Q and %R are not supported
      • H The highest-numbered register of a pair
      • Q The least significant register of a pair
      • R The most significant register of a pair

There are two patches applied to Clang to add the required support for the above.

Testing the built kernel


Project Hosting

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More about the foundation...