解决编译内核模块helloworld.c:1: 错误:代码模式‘kernel’在 32 位模式下不受支持问题,未编译对64位的支持
2013-11-16 09:44
597 查看
Makefile内容:
KERNELDIR ?=/root/Desktop/work/TI/linux-3.2.0 PWD := $(shell pwd) obj-m += helloworld.o default: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean: @rm -f *.o *.ord* *.sy* *.mod.* *.koclean标记中的@表示,执行命令的时候,终端上面不打印rm -r xxx.xx
make出错信息:
[root@localhost ldd3]# makemake -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
相关文章推荐
- 解决编译/home/module/hello.c:1: 错误:代码模式‘kernel’在 32 位模式下不受支持问题
- linux kernel 编译内核模块代码,插入内核模块遇到的问题和解决
- 问题解决:Spyder不支持OpenCV模块代码提示
- 解决 编译内核出现kernel/timeconst.pl line 373问题
- lame支持64位的编码库文件,无法编译64位包的问题解决了而且录音效果很好
- 内核模块编译时出现的问题解决
- CentOS v6.4 64位系统编译linux3.0.8内核错误的解决
- 在Ubuntu 64位环境下编译Liunx内核出现 Can't use 'defined(@array)' 错误的解决办法
- 在Ubuntu 64位环境下编译Liunx内核出现 Can't use 'defined(@array)' 错误的解决办法
- .NET下编译C++代码时出现"error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int"错误的解决方法。
- 在Ubuntu 64位环境下编译Liunx内核出现 Can't use 'defined(@array)' 错误的解决办法
- Linux编译内核kernel解决USB、网卡驱动等问题【suse enterprise linux】
- 解决TensorFlow最新代码编译错误问题
- IDEA编译时候出现问题:代码不提示错误,编译时出错解决办法
- Linux内核编译的一个错误解决 ump/common/ump_kernel_common.o
- 编译2.6内核模块出问题了,尚未解决.............
- Code maturity level options 代码成熟度选项 [*]Prompt for development and/or incomplete code/drivers 显示尚在开发中或尚未完成的代码与驱动.除非你是测试人员或者开发者,否则请勿选择 我是开发者,所以选[*] Loadable module support 可加载模块支持 [*]Enable loadable module support 内核编译配置选项简介 (2.4.20-8
- Java8系列(错误解决)--maven编译时"-source 1.5 中不支持 lambda 表达式"问题的解决
- CentOS v6.4 64位系统编译linux3.0.8内核错误的解决
- 在Ubuntu 64位环境下编译Liunx内核出现 Can't use 'defined(@array)' 错误的解决办法