解决编译内核模块helloworld.c:1: 错误:代码模式‘kernel’在 32 位模式下不受支持问题,未编译对64位的支持
2023-09-14 08:57:16 时间
@rm -f *.o *.ord* *.sy* *.mod.* *.ko
clean标记中的@表示,执行命令的时候,终端上面不打印rm -r xxx.xx
make -C /root/Desktop/work/TI/linux-3.2.0 M=/root/Desktop/work/ldd3 modules
make[1]: Entering directory `/root/Desktop/work/TI/linux-3.2.0
CC [M] /root/Desktop/work/ldd3/helloworld.o
/root/Desktop/work/ldd3/helloworld.c:1: 错误:代码模式 ‘kernel’ 在 32 位模式下不受支持
/root/Desktop/work/ldd3/helloworld.c:1: 对不起,尚未实现:未编译入对 64 位模式的支持
make[2]: *** [/root/Desktop/work/ldd3/helloworld.o] 错误 1
make[1]: *** [_module_/root/Desktop/work/ldd3] 错误 2
make[1]: Leaving directory `/root/Desktop/work/TI/linux-3.2.0
make: *** [default] 错误 2
make -C /root/Desktop/work/TI/linux-3.2.0 M=/root/Desktop/work/ldd3 modules
make[1]: Entering directory `/root/Desktop/work/TI/linux-3.2.0
CC [M] /root/Desktop/work/ldd3/helloworld.o
/root/Desktop/work/ldd3/helloworld.c:1: 错误:代码模式 ‘kernel’ 在 32 位模式下不受支持
/root/Desktop/work/ldd3/helloworld.c:1: 对不起,尚未实现:未编译入对 64 位模式的支持
make[2]: *** [/root/Desktop/work/ldd3/helloworld.o] 错误 1
make[1]: *** [_module_/root/Desktop/work/ldd3] 错误 2
make[1]: Leaving directory `/root/Desktop/work/TI/linux-3.2.0
make: *** [default] 错误 2
出错原因:在内核目录中的Makefile,没有指定ARCH、CROSS_COMPILE。因为编译内核的时候,使用的是:make CROSS_COMPILE=arm-linux- ARCH=arm uImage命令,并未修改Makefile文件。
解决:指定ARCH、CROSS_COMPILE内容
ARCH=arm CROSS_COMPILE=arm-linux- 在编译通过,生成helloworld.ko相关文章
- SpringBootTest—–踩坑错误
- 将 SAP Spartacus 作为 feature module 进行 Lazy Load 延迟加载时遇到的注入错误分析
- 系统错误&H80004005(-2147467259),未指定的错误。[通俗易懂]
- 出现500错误
- Pyhon:PyQt5 QMediaPlayer 错误解决
- 【错误记录】Melodyne 报错 ( 无法打开音频文件 )
- 【错误记录】Android 应用执行报错 ( java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[ )
- SQLServer 错误 7308 因为 OLE DB 访问接口“%ls”配置为在单线程单元模式下运行,所以该访问接口无法用于分布式查询。 故障 处理 修复 支持远程
- 关于服务器PHP错误日志详解
- Linux错误:怎样有效地解决问题?(linux错误)
- 跟后台打印程序系统服务通讯时出现错误解决方法
- 彻底杜绝PHP的sessioncookie错误
- 由注册表引起的I/O操作发生了不可恢复的错误修复方法
- 实现Nginx中使用PHP-FPM时记录PHP错误日志的配置方法