Hello,
I'm trying to use llvm-gcc (llvm version 1.7) to compile a driver program (linux/drivers/net/zorro8390.c) in the linux kernel source code (version 2.6.18.8) for research purpose, but I get a lot of errors from the jiffies.h:
bash-3.2$ llvm-gcc -D__GNUCC -E -I../../include zorro8390.c -o test.o
In file included from ../../include/linux/lockdep.h:12,
from ../../include/linux/spinlock_types.h:12,
from ../../include/linux/spinlock.h:78,
from ../../include/linux/module.h:10,
from zorro8390.c:22:
../../include/linux/list.h:887:2: warning: #warning "don't include kernel headers in userspace"
In file included from zorro8390.c:30:
../../include/linux/jiffies.h:210:31: error: division by zero in #if
../../include/linux/jiffies.h:210:31: error: division by zero in #if
...(a bunch of same errors)
../../include/linux/jiffies.h:432:28: error: division by zero in #if
I've googled lots of discussions on this error, but lots of them are about building kernel with make command. I still don't know how to fix it when using llvm-gcc directly. Any suggestion on it? Thank you very much for your help!
Daniel