[llvmlinux] cannot compile kernel module by Clang

Jovi Zhang bookjovi at gmail.com
Sat May 4 05:12:31 UTC 2013


I'm trying to compile kernel module by Clang, note that
the kernel is compiled by GCC.
(I know that there have some problem to compile kernel without any patches,
that's why I only want to compile kernel module here, not kernel)

As we known, Clang/llvm doesn't support global register variable at present,
when the kernel module C file include <linux/module.h>, it report that error,


register unsigned long current_stack_pointer asm("esp") __used;

so is there have any workaround to handle this problem? I just want to compile
kernel module only by Clang. Thanks.

More information about the LLVMLinux mailing list