简体   繁体   English

Linux 内核出错

[英]Linux Kernel Make Error

I have the following error when trying to compile Linux Kernel, the same on 4.14 rc2 from kernel.org and 4.13.4 from kernel.org and also linux-stable cloned using git.尝试编译 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

If anyone could help, I am much appreciated.如果有人可以提供帮助,我将不胜感激。

Appears to be an issue with elfs and orcs.似乎是精灵和兽人的问题。

I am using knoppix 8.1 64bit installation but platform runs in 32bits.我正在使用 knoppix 8.1 64 位安装,但平台以 32 位运行。 Ive installed all the minimum requirements as specified in the kernel readme.我已经安装了内核自述文件中指定的所有最低要求。 Ive tried using a .config file from my own selected options and the oldconfig option plus localmodconfig option.我试过使用我自己选择的选项和 oldconfig 选项加上 localmodconfig 选项中的 .config 文件。

I installed the linux-headers for 4.13 (metapackage) and it gets past the elfs and orcs satisfying the demand for CONFIG_STACK_VALIDATION with the source downloaded from kernel.org version 4.13.4.我为 4.13(元包)安装了 linux-headers,它通过了 elfs 和 orcs,满足了对 CONFIG_STACK_VALIDATION 的需求,源代码从 kernel.org 4.13.4 版下载。

Though it did not get past the elfs and orcs on the linux-stable sourced from git.虽然它没有通过来自 git 的 linux-stable 上的精灵和兽人。

Im having new errors with some drivers not building though.我有一些驱动程序没有构建的新错误。

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

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

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