Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 804618

Summary: Upgrading sys-devel/gcc and x11-drivers/nvidia-drivers in the same run breaks with kernel's gcc plugins
Product: Gentoo Linux Reporter: onkobu
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED CANTFIX    
Severity: normal CC: ionen
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description onkobu 2021-07-27 09:27:14 UTC
Starting point is a kernel 5.10.x build weeks ago with gcc-10.2.0. This kernel has gcc plugins enabled. In turn they were compiled with gcc-10.2.0 when the kernel was built. Directory since then stayed untouched. Other kernels were cleaned from the system after 5.10.x started successfully.

Today I upgraded this machine completely. Part of the emerge run was a bump of gcc from 10.2.0 to 10.3.0 and build of nvidia-drives. The latter broke with error messages loading the gcc plugins – nvidia-drivers compiler run picks them up.

During config-run of nvidia-drivers config itself already complained about incompatible plugins. It suggests to run make oldconfig && make prepare. This re-compiles the plugins. After that the build of nvidia-drivers went fine.

I expected either the build to break because of the config error. Or emerge not to automatically switch gcc after upgrade to the most recent version. When I now issue eselect gcc list gcc-10.3.0 is selected/ marked with an asterisk. I didn't do this explicitely.

Reproducible: Always

Steps to Reproduce:
0. Have at least two gcc versions, e.g. 10.2.0 and 10.3.0
1. Enable gcc plugins in kernel
2. With gcc-10.2.0 in /usr/src/linux make oldconfig && make prepare
3. With gcc-10.3.0 emerge nvidia-drivers -> errors out failing to load gcc plugins
Actual Results:  
Emerge terminates showing errors from compiler run which failed to load plugins

Expected Results:  
Either build errors out during config or upgrade of gcc during same run does not eselect it.
Comment 1 Ionen Wolkens gentoo-dev 2021-07-27 09:47:12 UTC
>Either build errors out during config or upgrade of gcc during same run does not eselect it.

gcc-10.2 -> 10.3 is not eselect, 10 share the same slot so 10.3 replaces 10.2

That sounds like CANTFIX material.
Comment 2 Georgy Yakovlev archtester gentoo-dev 2021-07-27 12:28:31 UTC
it's a known "feature" of gcc-plugins in kernel.
if you updated compiler, you have to recompile kernel before external drivers can be built with plugins enabled with new compiler.

we can't really fix it. just keep an eye on updates and emerge drivers after kernel is rebuilt with new compiler.
Comment 3 onkobu 2021-07-29 10:08:50 UTC
(In reply to Ionen Wolkens from comment #1)
> >Either build errors out during config or upgrade of gcc during same run does not eselect it.
> 
> gcc-10.2 -> 10.3 is not eselect, 10 share the same slot so 10.3 replaces 10.2
> 
> That sounds like CANTFIX material.

$> eselect gcc list
 [1] armv6j-unknown-linux-gnueabihf-10.2.0
 [2] armv6j-unknown-linux-gnueabihf-10.3.0 *

 [3] armv7a-unknown-linux-gnueabihf-10.2.0
 [4] armv7a-unknown-linux-gnueabihf-10.3.0 *

 [5] x86_64-pc-linux-gnu-10.2.0
 [6] x86_64-pc-linux-gnu-10.3.0 *

They don't share the same slot, at least not on this particular machine. But I'm fine with the reply. 

Since I'm not a gcc expert could an ebuild contain a check for this situation? The ebuild would fail then or even the pre-conditions of emerge run?
Comment 4 onkobu 2021-07-29 12:13:14 UTC
Added some lines to the Wiki: https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers#Kernel_GCC_Plugins