为另一种架构重建linux内核模块

问题描述 投票:0回答:1

假设我有带某些版本Linux内核的机器。而且我有包含其他版本内核源代码的目录。该内核是为 arch构建的,并已加载到适当的设备。现在,我只需要在这个大目录中重建一个内核模块。我读了this post,并尝试过类似的操作

make path/to/the/module/itself.ko

,但它为amd64构建模块。

当我尝试

make M=path/to/the/module/

它给出了一堆与拱有关的C错误。

有人可以解释如何轻松使用支持ARM的环境重建某些内核模块吗?

c makefile linux-kernel gnu-make kernel-module
1个回答
0
投票

您可以尝试:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- M=path/to/the/module/

也请阅读:

Cross compiling a kernel module

gcc-arm-linux-gnueabi command not found

© www.soinside.com 2019 - 2024. All rights reserved.