【问题标题】:Error while compiling Linux kernel for ARM为 ARM 编译 Linux 内核时出错
【发布时间】:2014-03-09 18:06:21
【问题描述】:

我从

克隆了内核
 https://github.com/torvalds/linux.git

然后尝试编译如下

#make menuconfig 

菜单配置屏幕出现。在不进行任何更改的情况下,我保存了生成 .config 文件的配置

#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

我收到以下错误。请指教

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

【问题讨论】:

标签: compiler-errors linux-kernel arm


【解决方案1】:

如果你这样做了

make menuconfig

然后为 x86 而不是 ARM 读取配置。首先你需要采取默认配置看看@this

Are kernel headers depend on processor type, vendor etc?

还有

看@Just black screen after running Qemu

如果您不知道配置,您可以从目标 rootfs /proc/config.gz 获取 .config 的副本

Cross Compiling Linux Arm Kernel with new driver module

【讨论】:

  • 如何构建rootfs..你能看看这个吗..stackoverflow.com/questions/22286364/…
  • 我也是这里给出的方法,但是没用..linuxforu.com/2011/06/…
  • 是位于 .../config/versatile_defconfig.dts 中的 $make ARCH=arm dedicated_defconfig 的 .dts 文件。我需要在其中包含另一个 .dtsi 文件,我应该如何确认它是否包含 #include
【解决方案2】:

由于某种原因,ARCH 不是已保存配置的一部分。只要您运行任何没有 ARCH=arm 的 make 命令,它就会默认返回 PC 架构。使用 arm 编译器编译为 Intel 配置的内核会导致问题。

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

【讨论】:

  • 保持顶级 Makefile 通用
  • 这毫无意义。 ARCH 可以像任何其他配置参数一样成为配置参数,并与所有其他配置参数一起保存在 .config 中。唯一的论点可能是相同的配置可以在不同的架构上不加改变地使用,但由于 ARCH 会影响可以配置的内容,我认为这永远不会起作用。
  • 有些人从一个源目录构建多个目标。见选项O=xxx;其中 source 和 build 位于不同的目录中。对于集成子系统的人来说,这非常有价值,因为您不必同步数十棵树。假设开发“mm”子系统的人必须测试它是否可以在所有架构上编译。也就是说,这对某些人来说并不是一个坏建议;没有适合所有人的解决方案。另一种解决方案是将命令包装在脚本中。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多