Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 814200 - sys-kernel/gentoo-sources: GCC_PLUGINS are forcibly disabled if gcc-11 is the active compiler
Summary: sys-kernel/gentoo-sources: GCC_PLUGINS are forcibly disabled if gcc-11 is the...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: gcc-11
  Show dependency tree
 
Reported: 2021-09-21 18:23 UTC by Kerin Millar
Modified: 2021-10-13 13:38 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gcc-plugins-modern-gcc-plugin-infrastructure-requres.patch (0002-gcc-plugins-modern-gcc-plugin-infrastructure-requres.patch,3.28 KB, patch)
2021-09-21 18:25 UTC, Kerin Millar
Details | Diff
Somewhat simpler patch, tested on 5.4 (gcc-plugins-simplify-GCC-plugin-dev-capability-test.patch,1.75 KB, patch)
2021-09-23 17:24 UTC, Mike Pagano
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kerin Millar 2021-09-21 18:23:57 UTC
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.
Comment 1 Kerin Millar 2021-09-21 18:25:18 UTC
Created attachment 740556 [details, diff]
gcc-plugins-modern-gcc-plugin-infrastructure-requres.patch
Comment 2 Mike Gilbert gentoo-dev 2021-09-21 18:34:53 UTC
What is the upstream status of this patch?
Comment 3 Kerin Millar 2021-09-21 19:00:19 UTC
(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.
Comment 4 Mike Pagano gentoo-dev 2021-09-22 17:37:00 UTC
What about this ? You will need to apply this by hand but it's one delete and one line change.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=1e860048c53ee77ee9870dcce94847a28544b753

Tested with 5.4 w/gcc 11 and nothing else
Comment 5 Kerin Millar 2021-09-22 19:29:41 UTC
(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.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/
> ?id=1e860048c53ee77ee9870dcce94847a28544b753
> 
> 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.
Comment 6 Mike Pagano gentoo-dev 2021-09-23 17:24:27 UTC
Created attachment 740934 [details, diff]
Somewhat simpler patch, tested on 5.4
Comment 7 Mike Pagano gentoo-dev 2021-09-29 13:05:49 UTC
(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?
Comment 8 Kerin Millar 2021-10-01 17:15:19 UTC
(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.