Because nvidia-drivers pulls some flags from the kernel config, when building with different toolchains it fails to filter the appropiate flags and ends up failing. Reproducible: Always Steps to Reproduce: 1. Compile the kernel with gcc 2. Switch to llvm sometime later 3. Compile nvidia-drivers with clang
Created attachment 845105 [details] config.log from nvidia-drivers
I think this is a case of "don't do that".
fwiw nvidia ebuild already has some logic to handle mismatch with clang kernels but not the other way around (given widely used, issues like these come up more often than other modules), but it doesn't work both ways so I could just extend it. Generally feel should be handled by linux-mod.eclass, but not something I feel like getting into testing for other modules myself.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65f99fae2270d133ca528c209959925884019c77 commit 65f99fae2270d133ca528c209959925884019c77 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2022-12-27 08:03:09 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2022-12-27 11:11:13 +0000 x11-drivers/nvidia-drivers: more thorough kernel toolchain handling Should "hopefully" cover most use cases without regressions. Makes some degree of sense to do this on (at least) nvidia-drivers, given it's widely used and compiles a lot of non-modules things and users may not want to use the same toolchain for these. e.g. can now do clang+lld+thinlto kernel + gcc+bfd nvidia or gcc+bfd kernel + clang+lld+thinlto nvidia Not that going to support every custom mixing possible, and please consider clang kernel an unsupported configuration despite this (hardly tested). Could be interesting to have linux-mod handle this, but that may be better to consider for EAPI=9 so it doesn't unexpectedly break anything (meanwhile it's simple to use a package.env for non-nvidia). Closes: https://bugs.gentoo.org/888587 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> .../nvidia-drivers/nvidia-drivers-390.157.ebuild | 62 +++++++++++++++++---- .../nvidia-drivers-470.161.03.ebuild | 62 +++++++++++++++++---- .../nvidia-drivers-510.108.03.ebuild | 62 +++++++++++++++++---- .../nvidia-drivers/nvidia-drivers-515.86.01.ebuild | 64 ++++++++++++++++++---- .../nvidia-drivers/nvidia-drivers-525.47.04.ebuild | 64 ++++++++++++++++++---- .../nvidia-drivers/nvidia-drivers-525.60.13.ebuild | 64 ++++++++++++++++++---- 6 files changed, 306 insertions(+), 72 deletions(-)
Please ping if still issues, fine with my own setup at least. Note can set KERNEL_CC/LD/NM and such if need to override yourself, albeit normally unneeded.