linux - centos系统无法编译lkm
问题描述
我安装了 Linux 头文件并创建了 Makefile 并尝试构建它,但出现了我在互联网上找不到的错误,这是错误
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
解决方案
尝试运行这个:
yum group install "Development Tools"
推荐阅读
- android - 编译 NDKr12b - 尝试从 Eigen 库编译 Matrix.h 时遇到问题
- python - 什么情况下报错?“Scipy.optimize”:'Desired error不一定能达到,因为精度损失'
- excel - 用 Excel 中的新单词库系统地替换纯 txt 中的所有单词
- python-3.x - 延迟排序 HackerRank Python
- python - 从多个进程将数据添加到队列
- python - Python Flask 项目的 TSQL 查询
- javascript - 使用按钮在歌曲之间切换
- c# - 加载 Visual Studio 解决方案在设计器中出现未处理的异常:“找不到路径的一部分(文件路径)”
- typescript - 使用 Mocha Chai 异步函数进行测试
- windows - 在 NavView 导航窗格 UWP 中使用命令栏