Linux内核出错

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux内核出错相关的知识,希望对你有一定的参考价值。

我在尝试编译Linux内核时遇到以下错误,同样来自kernel.org的4.14 rc2和来自kernel.org的4.13.4以及使用git克隆的linux-stable。

root@kami:/home/linux-stable# make O=/home/LINUX
make[1]: Entering directory '/home/LINUX'
  CHK     include/config/kernel.release
  Using /home/linux-stable as source for kernel
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CC      kernel/bounds.s
  CHK     include/generated/bounds.h
  UPD     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  UPD     include/generated/timeconst.h
  CC      arch/x86/kernel/asm-offsets.s
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  CALL    /home/linux-stable/scripts/checksyscalls.sh
  DESCEND  objtool
  CC       /home/LINUX/tools/objtool/orc_dump.o
orc_dump.c: In function 'orc_dump':
orc_dump.c:105:26: error: passing argument 2 of 'elf_getshdrnum' from       incompatible pointer type [-Werror=incompatible-pointer-types]
  if (elf_getshdrnum(elf, &nr_sections)) {
                      ^
In file included from /usr/local/include/gelf.h:32:0,
                 from elf.h:22,
                 from warn.h:26,
                 from orc_dump.c:20:
/usr/local/include/libelf.h:304:12: note: expected 'size_t * {aka unsigned     int *}' but argument is of type 'long unsigned int *'
 extern int elf_getshdrnum (Elf *__elf, size_t *__dst);
        ^~~~~~~~~~~~~~
orc_dump.c:190:17: error: format '%lx' expects argument of type 'long   unsigned int', but argument 3 has type 'Elf64_Sxword {aka long long int}'    [-Werror=format=]
    printf("%s+%lx:", name, rela.r_addend);
               ~~^          ~~~~~~~~~~~~~
               %llx
cc1: all warnings being treated as errors
mv: cannot stat '/home/LINUX/tools/objtool/.orc_dump.o.tmp': No such file  or directory
/home/linux-stable/tools/build/Makefile.build:95: recipe for target '/home  /LINUX/tools/objtool/orc_dump.o' failed
make[4]: *** [/home/LINUX/tools/objtool/orc_dump.o] Error 1
Makefile:41: recipe for target '/home/LINUX/tools/objtool/objtool-in.o'   failed
make[3]: *** [/home/LINUX/tools/objtool/objtool-in.o] Error 2
Makefile:61: recipe for target 'objtool' failed
make[2]: *** [objtool] Error 2
/home/linux-stable/Makefile:1622: recipe for target 'tools/objtool' failed
make[1]: *** [tools/objtool] Error 2
make[1]: Leaving directory '/home/LINUX'
Makefile:145: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

如果有人可以提供帮助,我将不胜感激。

似乎是精灵和兽人的问题。

我正在使用knoppix 8.1 64位安装,但平台运行在32位。我已经安装了内核自述文件中指定的所有最低要求。我尝试使用我自己选择的选项中的.config文件和oldconfig选项以及localmodconfig选项。

答案

我安装了4.13(metapackage)的linux-headers,它通过从kernel.org版本4.13.4下载的源代码满足了对CONFIG_STACK_VALIDATION的需求的elfs和orcs。

虽然它没有超过来自git的linux-stable的精灵和兽人。

我有一些新的错误,一些司机没有建立。

root@kami:/home/linux-4.13.4# make O=/home/linux-4134
make[1]: Entering directory '/home/linux-4134'
  CHK     include/config/kernel.release
  Using /home/linux-4.13.4 as source for kernel
  GEN     ./Makefile
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    /home/linux-4.13.4/scripts/checksyscalls.sh
  DESCEND  objtool
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
  BLD FW  drivers/net/wan/wanxlfw.inc
/bin/sh: as68k: command not found
/home/linux-4.13.4/drivers/net/wan/Makefile:58: recipe for target 'drivers/net/wan/wanxlfw.inc' failed
make[4]: *** [drivers/net/wan/wanxlfw.inc] Error 127
/home/linux-4.13.4/scripts/Makefile.build:561: recipe for target 'drivers/net/wan' failed
make[3]: *** [drivers/net/wan] Error 2
/home/linux-4.13.4/scripts/Makefile.build:561: recipe for target 'drivers/net' failed
make[2]: *** [drivers/net] Error 2
/home/linux-4.13.4/Makefile:1019: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
make[1]: Leaving directory '/home/linux-4134'
Makefile:145: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

以上是关于Linux内核出错的主要内容,如果未能解决你的问题,请参考以下文章

Linux内核出错

Linux 内核编译出错:make zimage命令;错误提示:make :***No rule to make target ‘zimage’. stop .

问一下,为啥代码在RedHat里面gcc编译出错,提示找不到module.h等头文件

linux内核过高导致vm打开出错修复脚本

在 Linux 内核中使用 netlink 套接字在用户空间应用程序和字符设备之间进行通信时出错

什么是在 C++ 中获取总内核数量的跨平台代码片段? [复制]