llvm-gcc (llvm 버전 1.7)를 사용하여 드라이버 프로그램을 컴파일하려고합니다 (linux/drivers/순/연구 목적을 위해 리눅스 커널 소스 코드 (버전 2.6.18.8)에서 zorro8390.c),하지만 난 jiffies.h에서 많은 오류를 얻을 수는 :llvm-gcc로 드라이버 코드를 컴파일 할 때 "error : #if에서 0으로 나누기"가 표시됩니다.
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
나는에 대한 논의를 많이 봤했습니다 이 오류는 많이 있지만, make 명령을 사용하여 커널을 빌드하는 것에 관한 내용이 많이 있습니다. 나는 llvm-gcc를 직접 사용할 때 그것을 고치는 방법을 여전히 모른다. 그것에 대한 어떤 제안? 당신의 도움을 주셔서 대단히 감사합니다! 당신이 손으로 리눅스 커널 소스 파일을 컴파일 할 때 명령 행에서 정의 될 필요가있는 많은 것들 중 몇 가지를 정의하지 않았기 때문에
다니엘