【问题标题】:centos system can't compile lkmcentos系统无法编译lkm
【发布时间】:2020-06-23 16:00:00
【问题描述】:

我安装了 Linux 头文件并创建了 Makefile 并尝试构建它,但我遇到了在 Internet 上找不到的错误 这是错误

make -C /lib/modules/4.18.0-147.el8.x86_64/build M=/home/daniel modules
make[1]: Entering directory '/usr/src/kernels/4.18.0-147.el8.x86_64'
arch/x86/Makefile:184: *** Compiler lacks asm-goto support..  Stop.
make[1]: Leaving directory '/usr/src/kernels/4.18.0-147.el8.x86_64'
make: *** [Makefile:5: all] Error 2

这是我的 Makefile

 obj-m :=   hook.o
 export-objs := hook.o

 all:
         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

【问题讨论】:

  • 你安装了编译器吗?什么编译器?如果你运行 gcc --version 它会说什么?
  • 我有最新版本,我用 yum 安装它
  • 好吧,将该错误剪切并粘贴到 Google 中会得到很多点击,例如 unix.stackexchange.com/questions/456767/… ...

标签: linux makefile kernel


【解决方案1】:

尝试运行这个:

yum group install "Development Tools"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-20
    • 1970-01-01
    • 2016-12-06
    • 1970-01-01
    • 2012-09-19
    • 2011-12-10
    • 2015-04-14
    • 2020-10-30
    相关资源
    最近更新 更多