【问题标题】:linux kernel compilation: ERROR: "function" [path/to/module/module.ko] undefinedlinux内核编译:错误:“函数”[path/to/module/module.ko]未定义
【发布时间】:2016-11-05 20:14:23
【问题描述】:

我有一个与this 类似的问题,只是对我来说这是一个错误而不是警告。我正在构建 linux-4.8.5,并将 patch 应用于一个模块。我明白了:

ERROR: "intel_soc_pmic_readb" [drivers/gpu/drm/i915/i915.ko] undefined!
ERROR: "intel_soc_pmic_writeb" [drivers/gpu/drm/i915/i915.ko] undefined!
scripts/Makefile.modpost:91: recipe for target '__modpost' failed
make[1]: *** [__modpost] Error 1
Makefile:1201: recipe for target 'modules' failed
make: *** [modules] Error 2

在另一个问题中,他们说了一些关于 KBUILD_EXTRA_SYMBOLS 的内容,并且文档应该在 Documentation/kbuild/modules.txt 中。但是看了这个文件,这似乎只适用于linux本身不包含的模块?

函数定义如下

int function(){
    do_stuff;
}
EXPORT_SYMBOL(function);

然后是声明

 int function();

在包含文件夹中的 .h 文件中,它被称为

 #include <the_aforementioned_file.h>
//stuff
function();

来自与函数定义位于同一文件夹中的文件。整个源代码树中没有其他函数名出现。

而且我真的没有看到错误。我想我很可能没有找对地方。

【问题讨论】:

  • 您确定定义给定符号的模块确实已构建吗?它需要配置选项CONFIG_INTEL_SOC_PMIC
  • @Tsyvarev 这就是问题所在。 o.O 而且我从没想过要寻找它,我确信当然这个模块正在构建中。

标签: compilation compiler-errors linux-kernel linker-errors


【解决方案1】:

正如 Tsyvarev 在评论中解释的那样,这个错误是因为有问题的模块没有被构建,它需要选项CONFIG_INTEL_SOC_PMIC

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-19
    • 1970-01-01
    • 2018-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-01
    • 1970-01-01
    相关资源
    最近更新 更多