2017-03-28 56 views
0

私はUbuntu 14.04でLinuxモジュールを構築しようとしています。致命的なエラーasm/bitsperlong.hそのようなファイルやディレクトリがありません

しかし、以下のようなエラーがあります。

[email protected]:~/Project/Linux/Hello$ make 
make -C /lib/modules/3.13.0-106-generic/build M=/home/dhkim/Project/Linux/Hello modules 
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-106-generic' 
    CC [M] /home/dhkim/Project/Linux/Hello/hello.o 
In file included from include/asm-generic/int-ll64.h:10:0, 
       from /usr/src/linux-headers-3.13.0-106-generic/arch/arm/include/asm/types.h:4, 
       from include/uapi/linux/types.h:4, 
       from include/linux/types.h:5, 
       from include/linux/init.h:5, 
       from /home/dhkim/Project/Linux/Hello/hello.c:1: 
include/uapi/asm-generic/int-ll64.h:11:29: fatal error: asm/bitsperlong.h: No such file or directory 
#include <asm/bitsperlong.h> 

compilation terminated. 
make[2]: *** [/home/dhkim/Project/Linux/Hello/hello.o] error 1 
make[1]: *** [_module_/home/dhkim/Project/Linux/Hello] error 2 
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-106-generic' 
make: *** [default] error 2 

ビルド環境は次のとおりです。

obj-m := hello.o 
KDIR := /lib/modules/$(shell uname -r)/build 
PWD := $(shell pwd) 

default : 
    $(MAKE) -C $(KDIR) M=$(PWD) modules 

clean : 
    rm -rf *.ko *.mod.* *.o 

-

[email protected]:~/Project/Linux/Hello$ uname -r 
3.13.0-106-generic 

[email protected]:/usr/include$ ls asm 
a.out.h  errno.h   kvm.h  mtrr.h    prctl.h   sigcontext.h svm.h  unistd_64.h 
auxvec.h  fcntl.h   kvm_para.h param.h   processor-flags.h sigcontext32.h swab.h  unistd_x32.h 
bitsperlong.h hw_breakpoint.h ldt.h  perf_regs.h  ptrace-abi.h  siginfo.h  termbits.h vm86.h 
boot.h   hyperv.h   mce.h  poll.h    ptrace.h   signal.h  termios.h vmx.h 
bootparam.h ioctl.h   mman.h  posix_types.h  resource.h   socket.h  types.h  vsyscall.h 
byteorder.h ioctls.h   msgbuf.h  posix_types_32.h sembuf.h   sockios.h  ucontext.h 
debugreg.h  ipcbuf.h   msr-index.h posix_types_64.h setup.h   stat.h   unistd.hH 
e820.h   ist.h   msr.h  posix_types_x32.h shmbuf.h   statfs.h  unistd_32.h 

どのように私はこの問題を解決することができますか?

+0

http://stackoverflow.com/questions/14806353/cross-compiling-of-kernel-module-for-arm-architecture→ ''への#include 'からの変更→ #include ' –

答えて

0

「arm」という単語がエラーパスに表示されていることに気付きました。システムをARM用にクロスコンパイルするように設定した後、私は同じエラーを経験しました。通常のx86モジュールを構築しようとするなら、少なくとも一時的にさまざまな環境変数を元に戻す必要があります。

export CROSS_COMPILE= 
export ARCH=x86_64 [or whatever arch you have] 
関連する問題