1

I've been working on the gcc plugins included in the kernel headers. I have a Manjaro Linux distribution, and I'm trying to get the system to rebuild the gcc plugins. Unfortunately, I can't seem to make that happen:

[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'.

This happens even if I remove the plugin .so entirely.

[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'.

I've verified in the kernel config that this plugin is enabled:

[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

This is blowing my mind. Anyone have any knowledge to drop my way?

7
  • Your parent distribution is Arch, therefore this Wiki Entry should help: Compile kernel module. It should be noted that only Kernel build scripts should be used in the kernel source tree.
    – eyoung100
    Oct 16, 2019 at 20:54
  • @eyoung100 maybe I'm missing something, but I don't think that document talks about GCC plugins at all. Which part of that entry should I be reading?
    – Nathan
    Oct 17, 2019 at 20:34
  • You’re approaching this wrong. The only way to load the modules you want is to recompile the kernel they are attached to, and reboot, so that the new kernel loads
    – eyoung100
    Oct 17, 2019 at 20:37
  • You do understand that I'm not loading any modules, I'm rebuilding gcc plugins, right? Not trying to be snarky, just confused because the documentation I've found all seems to suggest that what I'm doing should work (see kernel.org/doc/html/latest/core-api/gcc-plugins.html for example)
    – Nathan
    Oct 17, 2019 at 20:45
  • Anything from kernel.org involves the KERNEL. I was right in telling you that that config file is a kernel config. It should say at the top: Do not edit manually. You’re supposed to enable the modules through the kernels menu config, setting them as M, rebuild the kernel and reboot. The way you have it set now has them built into the kernel, plus they aren’t active
    – eyoung100
    Oct 17, 2019 at 20:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.