Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 724642 - sys-devel/gcc:10 leads to disabled CONFIG_GCC_PLUGINS in linux kernel
Summary: sys-devel/gcc:10 leads to disabled CONFIG_GCC_PLUGINS in linux kernel
Status: RESOLVED FIXED
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:
Depends on:
Blocks: gcc-10
  Show dependency tree
 
Reported: 2020-05-23 10:22 UTC by Nils Freydank
Modified: 2020-05-27 18:42 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nils Freydank 2020-05-23 10:22:52 UTC
Hi,

with gcc:10 installed CONFIG_PLUGIN_HOSTCC is incorrectly set to an empty string instead of "g++" and therefore CONFIG_GCC_PLUGINS is disabled.

CONFIG_PLUGIN_HOSTCC is set by an external helper script in scripts/gcc-plugin.sh. As I manually edited this script into

echo "g++"; exit 0

the CONFIGs are correct, but compilation failes as the kernel can't find some headers like params.h in /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/plugin/include/.

I tested with gcc-10.1.0 and gcc-10.1.1_pre9999 (8275e0a6686b465d4d1717784e3e864305d37d02) and both vanilla-sources and gentoo-sources (even though it's obvious that the genpatches don't touch this area).

So far the only workaround I know of is to downgrade to <=sys-devel/gcc-9.3.0 and build the kernel with it.

Reproducible: Always
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-23 15:30:31 UTC
Upstream kernel had quite a few fixes related to plugins you might want to backport.

commit 9851a0dee7c28514f149f7e4f60ec1b06286cc1b
Merge: a16a47e98a30 c7527373fe28
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Mon May 4 11:20:32 2020 -0700

    Merge tag 'gcc-plugins-v5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

    Pull gcc-plugins fixes from Kees Cook:
     "GCC 10 fixes for gcc-plugins:

       - Adjust caller of cgraph_create_edge for GCC 10 argument usage

       - Update common headers to build under GCC 10 (Frédéric Pierret)"

commit c7527373fe28f97d8a196ab562db5589be0d34b9
Author: Frédéric Pierret (fepitre) <frederic.pierret@qubes-os.org>
Date:   Tue Apr 7 13:32:59 2020 +0200

    gcc-common.h: Update for GCC 10

    Remove "params.h" include, which has been dropped in GCC 10.


And a ton of -Werror, -fno-common and warning fixes.
Comment 2 Kenton Groombridge gentoo-dev 2020-05-24 07:42:01 UTC
Having the same issue. Masking >sys-devel/gcc-9.3.0 fixed it for me for the time being.
Comment 3 sddnd 2020-05-26 09:54:39 UTC
Upcoming stable linux-5.6.15 should include the backport:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/queue-5.6/gcc-common.h-update-for-gcc-10.patch

Applying this patch on v5.6.14 and building with gcc-10 gives me the same result as gcc-9.3.0.
Comment 4 Nils Freydank 2020-05-27 18:42:34 UTC
Upstream released 5.6.15 which will be probably inside the tree soon, so I do close this bug. Kernel configuration works now and compilation looks good so far, too (still in progress).

[1] https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.6.15