I'm using sys-kernel/gentoo-sources-4.0.3 and sys-devel/gcc-4.9.2
emerge @module-rebuild tries to rebuild x11-drivers/nvidia-drivers-340.76 but that fails with
/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.c:38:5: error: implicit declaration of function ‘read_cr4’ [-Werror=implicit-function-declaration]
*cr4 = read_cr4();
/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.c:39:5: error: implicit declaration of function ‘write_cr4’ [-Werror=implicit-function-declaration]
if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
cc1: some warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.o' failed
Is this because of gentoo-sources being too new, or GCC, or something else? Can I turn that error back into just a warning?
emerge -pqv '=x11-drivers/nvidia-drivers-340.76::gentoo'
[ebuild R ] x11-drivers/nvidia-drivers-340.76 USE="X acpi multilib tools uvm -pax_kernel"
Created attachment 403474 [details]
emerge --info '=x11-drivers/nvidia-drivers-340.76::gentoo'
Created attachment 403476 [details]
I'm not sure why you don't get this warning, but 340.76 is only for kernels <3.18:
if use kernel_linux && kernel_is ge 3 18 ; then
ewarn "Gentoo supports kernels which are supported by NVIDIA"
ewarn "which are limited to the following kernels:"
ewarn "You are free to utilize epatch_user to provide whatever"
ewarn "support you feel is appropriate, but will not receive"
ewarn "support as a result of those changes."
ewarn "Do not file a bug report about this."
For kernal 4.0.3, try 346.59 or above, which are for kernels <4.1. I'm currently running 349.16 on kernel 4.0.2-hardened-r1.
In general, the Nvidia drivers often break with kernel updates, so you probably always want to upgrade them at the same time as your kernel.
I did get the warning, but I've been using nvidia-drivers-340.76 with gentoo-sources-3.18.11 (>3.18) without issues, and this specific failure does not look like something related to the kernel version, ergo the report.
I cannot use 346.59 or anything over 340.* as support for the driver has ceased and it's on life support until 2016.
(In reply to DrSlony from comment #4)
> I did get the warning, but I've been using nvidia-drivers-340.76 with
> gentoo-sources-3.18.11 (>3.18) without issues, and this specific failure
> does not look like something related to the kernel version, ergo the report.
I'd say this looks exactly like the sort of API change you can expect between kernel versions. A quick look in Linus' git tree says it is: read_cr4() and write_cr4() were removed by commit 1e02ce4cccdcb9688386e5b8d2c9fa4660b45389, between 3.19-rc7 and 4.0-rc1.
Ah ok, thank you and sorry for the false report.
Could you link me to 1e02ce4cccdcb9688386e5b8d2c9fa4660b45389 ?
(In reply to DrSlony from comment #6)
> Could you link me to 1e02ce4cccdcb9688386e5b8d2c9fa4660b45389 ?
*** Bug 553194 has been marked as a duplicate of this bug. ***
I posted this on bug #553194, can we please re-open this and apply the patch (https://553194.bugs.gentoo.org/attachment.cgi?id=405702) to the effected versions? I believe this would be <347.0.
I should have named the file something like nvidia-drivers-nv-pat.c.patch.
Oh crap, I just saw the message about Gentoo not supporting nvidia on kernels past 3.18, sorry.
hmm, I guess this actually might still be a valid bug since the older driver doesn't support my hardware, so upgrading isn't an option for me (although downgrading my kernel is).
Many people are in this boat - stuck with 340.* because support for their hardware was dropped from >=341.* upwards.
(In reply to Daniel Santos from comment #11)
> hmm, I guess this actually might still be a valid bug since the older driver
> doesn't support my hardware, so upgrading isn't an option for me (although
> downgrading my kernel is).
Yes. It isn't invalid, you're just reporting the bug in the wrong place. Only Nvidia can fix the blobs. In the mean time you'll be stuck with an older kernel.
*** Bug 556282 has been marked as a duplicate of this bug. ***