Commit 3832d1fd authored by Robert Elliott's avatar Robert Elliott Committed by Jonathan Corbet

docs/core-api: expand Fedora instructions for GCC plugins

In Fedora 36, cross-compiling an allmodconfig configuration
for other architectures on x86 fails with this problem:

In file included from ../scripts/gcc-plugins/gcc-common.h:95,
                 from ../scripts/gcc-plugins/latent_entropy_plugin.c:78:
/usr/lib/gcc/aarch64-linux-gnu/12/plugin/include/builtins.h:23:10: fatal
error: mpc.h: No such file or directory
   23 | #include <mpc.h>
      |          ^~~~~~~
compilation terminated.

In that distro, that header file is available in the separate
libmpc-devel package.

Although future versions of Fedora might correctly mark
that dependency, mention this additional package.

To help detect such problems ahead of time, describe the
    gcc -print-file-name=plugin
command that is used by scripts/gcc-plugins/Kconfig to detect
plugins [1].

[1] https://lore.kernel.org/lkml/CAHk-=wjjiYjCp61gdAMpDOsUBU-A2hFFKJoVx5VAC7yV4K6WYg@xxxxxxxxxxxxxx/

Fixes: 43e96ef8 ("docs/core-api: Add Fedora instructions for GCC plugins");
Signed-off-by: default avatarRobert Elliott <elliott@hpe.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220827193836.2582079-1-elliott@hpe.comSigned-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent e2815b71
......@@ -90,7 +90,11 @@ e.g., on Ubuntu for gcc-10::
Or on Fedora::
dnf install gcc-plugin-devel
dnf install gcc-plugin-devel libmpc-devel
Or on Fedora when using cross-compilers that include plugins::
dnf install libmpc-devel
Enable the GCC plugin infrastructure and some plugin(s) you want to use
in the kernel config::
......@@ -99,6 +103,19 @@ in the kernel config::
CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
...
Run gcc (native or cross-compiler) to ensure plugin headers are detected::
gcc -print-file-name=plugin
CROSS_COMPILE=arm-linux-gnu- ${CROSS_COMPILE}gcc -print-file-name=plugin
The word "plugin" means they are not detected::
plugin
A full path means they are detected::
/usr/lib/gcc/x86_64-redhat-linux/12/plugin
To compile the minimum tool set including the plugin(s)::
make scripts
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment