问题
I cloned the kernel from
https://github.com/torvalds/linux.git
Then tried to compile it as follows
#make menuconfig
menu config screens shows up. Without making any changes I save the config that generated .config file
#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
I get the following error. Please advise
In file included from arch/arm/kernel/asm-offsets.c:20:0:
/home/androiddev/linus/linux/arch/arm/include/asm/glue-df.h:107:2: error: #error Unknown data abort handler type
#error Unknown data abort handler type
^
In file included from arch/arm/kernel/asm-offsets.c:21:0:
/home/androiddev/linus/linux/arch/arm/include/asm/glue-pf.h:54:2: error: #error Unknown prefetch abort handler type
#error Unknown prefetch abort handler type
^
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
回答1:
If you do
make menuconfig
then configuration is read for x86 not for ARM. First you need to take default configuartion look @ this
Are kernel headers depend on processor type, vendor etc?
also
hv look @ Just black screen after running Qemu
if you dont know the configuration you can get copy of .config from target rootfs /proc/config.gz
Cross Compiling Linux Arm Kernel with new driver module
回答2:
For some reason ARCH is not a part of the saved configuration. As soon as you run any make command without the ARCH=arm it defaults back to PC architecture. Compiling a kernel configured for Intel with an arm compiler leads to problems.
I usually commit my own local ARCH=arm in the kernel top level makefile to avoid exactly this problem but I really don't understand why it is not a part of the saved configuration it would save a lot of headaches for people working on non-intel based architectures...
来源:https://stackoverflow.com/questions/22280598/error-while-compiling-linux-kernel-for-arm