如何为内核模块重建 gcc 插件

如何为内核模块重建 gcc 插件

我一直在研究内核头文件中包含的 gcc 插件。我有一个 Manjaro Linux 发行版,我正在尝试让系统重建 gcc 插件。不幸的是,我似乎无法做到这一点:

[nathan@nathanb-manjario scripts]$ sudo touch gcc-plugins/structleak_plugin.c
[nathan@nathanb-manjario scripts]$ sudo make gcc-plugins
make: Nothing to be done for 'gcc-plugins'.

即使我完全删除插件 .so,也会发生这种情况。

[nathan@nathanb-manjario scripts]$ sudo rm gcc-plugins/structleak_plugin.so
[nathan@nathanb-manjario scripts]$ sudo make gcc-plugins
make: Nothing to be done for 'gcc-plugins'.

我已经在内核配置中验证了该插件已启用:

[nathan@nathanb-manjario build]$ grep "GCC_PLUGIN" .config
CONFIG_HAVE_GCC_PLUGINS=y
CONFIG_GCC_PLUGINS=y
# CONFIG_GCC_PLUGIN_CYC_COMPLEXITY is not set
# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set
# CONFIG_GCC_PLUGIN_RANDSTRUCT is not set
CONFIG_GCC_PLUGIN_STRUCTLEAK=y
# CONFIG_GCC_PLUGIN_STRUCTLEAK_USER is not set
# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF is not set
CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y
# CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE is not set
# CONFIG_GCC_PLUGIN_STACKLEAK is not set

这让我大吃一惊。有谁有任何知识可以告诉我吗?

相关内容