简体   繁体   English

为ARM编译Linux内核时出错

[英]Error while compiling Linux kernel for ARM

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 在不进行任何更改的情况下,我保存了生成.config文件的配置

#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

If you do 如果你这样做

make menuconfig

then configuration is read for x86 not for ARM. 然后为x86而不是ARM读取配置。 First you need to take default configuartion look @ this 首先,您需要采用默认配置外观@ this

Are kernel headers depend on processor type, vendor etc? 内核头是否依赖于处理器类型,供应商等?

also

hv look @ Just black screen after running Qemu hv看@ 运行Qemu后只是黑屏

if you dont know the configuration you can get copy of .config from target rootfs /proc/config.gz 如果你不知道配置,你可以从目标rootfs /proc/config.gz获得.config的副本

Cross Compiling Linux Arm Kernel with new driver module 使用新的驱动程序模块交叉编译Linux Arm Kernel

For some reason ARCH is not a part of the saved configuration. 由于某种原因,ARCH不是已保存配置的一部分。 As soon as you run any make command without the ARCH=arm it defaults back to PC architecture. 只要在没有ARCH = arm的情况下运行任何make命令,它就会默认返回到PC架构。 Compiling a kernel configured for Intel with an arm compiler leads to problems. 使用arm编译器编译为Intel配置的内核会导致问题。

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... 我通常在内核顶级makefile中提交我自己的本地ARCH = arm来避免这个问题但我真的不明白为什么它不是保存配置的一部分它会为非工作的人节省很多麻烦基于英特尔的架构......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM