This issue concerns <=sys-kernel/gentoo-sources-5.10.67, with >=5.13 being unaffected. Owing to a faulty detection method, if gcc:11 is installed and selected as the active compiler, it becomes impossible to locate GCC_PLUGINS in menuconfig and to enable any of its sub-options. Not only that, but if an existing .config with an enabled plugin is imported, said options will be silently disabled in the course of building the kernel.
Levente Polyak, an Arch maintainer, has produced a patch to rectify this issue, which I shall attach here. Please incorporate it as part of genpatches-base. I checked some of the older kernels - 5.4, in particular - and found that the patch does not apply cleanly. Nevertheless, the patch is trivial and can be easily backported.
Created attachment 740556 [details, diff]
What is the upstream status of this patch?
(In reply to Mike Gilbert from comment #2)
> What is the upstream status of this patch?
As can be seen, the patch contains two hunks. The first touches "scripts/gcc-plugin.sh" and the second touches "scripts/gcc-plugins/Makefile".
As concerns the first hunk, its changes have not been incorporated by mainline. There is a simple reason for this, which is that gcc-plugin.sh was removed. Instead, there is a new compiler-version.h header, which is used in such a way as to render the script redundant. One could go as far as to backport all of this. Indeed, I did so for 5.10 before discovering Levente's patch. To do so is more intrusive, though.
As concerns the second hunk, its changes have been incorporated by mainline.
In short, Levente's patch does as little as is necessary to rectify the issue for 5.10. Whether anyone is looking at submitting it to the stable queue, I don't know.
What about this ? You will need to apply this by hand but it's one delete and one line change.
Tested with 5.4 w/gcc 11 and nothing else
(In reply to Mike Pagano from comment #4)
> What about this ? You will need to apply this by hand but it's one delete
> and one line change.
> Tested with 5.4 w/gcc 11 and nothing else
Yes, that's one of several changes that were ultimately made. In and as of itself, it's a good one. Only, I'm not sure that it should be applied in isolation. I'll look into it and get back to you, assuming you don't reach a conclusion in the intervening period.
Created attachment 740934 [details, diff]
Somewhat simpler patch, tested on 5.4
(In reply to Mike Pagano from comment #6)
> Created attachment 740934 [details, diff] [details, diff]
> Somewhat simpler patch, tested on 5.4
Does this patch work for you as expected?
(In reply to Mike Pagano from comment #7)
> Does this patch work for you as expected?
Hello, Mike. Sorry, I didn't have any time to look into it during the week. I'll test it out shortly.