Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 549714 - x11-drivers/nvidia-drivers-340.76 fails to compile with " error: implicit declaration of function ‘read_cr4’ " and 'write_cr4'
Summary: x11-drivers/nvidia-drivers-340.76 fails to compile with " error: implicit dec...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords:
: 553194 556282 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-05-17 12:19 UTC by DrSlony
Modified: 2015-08-03 14:03 UTC (History)
4 users (show)

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


Attachments
emerge --info '=x11-drivers/nvidia-drivers-340.76::gentoo' (emerge_info.txt,6.50 KB, text/plain)
2015-05-17 12:20 UTC, DrSlony
Details
build.log (build.log,66.96 KB, text/plain)
2015-05-17 12:21 UTC, DrSlony
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DrSlony 2015-05-17 12:19:21 UTC
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?

Reproducible: Always





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"
Comment 1 DrSlony 2015-05-17 12:20:15 UTC
Created attachment 403474 [details]
emerge --info '=x11-drivers/nvidia-drivers-340.76::gentoo'
Comment 2 DrSlony 2015-05-17 12:21:55 UTC
Created attachment 403476 [details]
build.log
Comment 3 Karl-Johan Karlsson 2015-05-17 12:50:14 UTC
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 "<sys-kernel/gentoo-sources-3.18"
           ewarn "<sys-kernel/vanilla-sources-3.18"
           ewarn ""
           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 ""
           ewarn "Do not file a bug report about this."
   fi

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.
Comment 4 DrSlony 2015-05-17 14:07:04 UTC
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.
http://en.wikipedia.org/wiki/GeForce_200_series#Discontinued_support
Comment 5 Karl-Johan Karlsson 2015-05-17 14:39:13 UTC
(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.
Comment 6 DrSlony 2015-05-17 14:51:26 UTC
Ah ok, thank you and sorry for the false report.
Could you link me to 1e02ce4cccdcb9688386e5b8d2c9fa4660b45389 ?
Comment 7 Karl-Johan Karlsson 2015-05-17 14:57:32 UTC
(In reply to DrSlony from comment #6)
> Could you link me to 1e02ce4cccdcb9688386e5b8d2c9fa4660b45389 ?

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1e02ce4cccdcb9688386e5b8d2c9fa4660b45389
Comment 8 Mike Gilbert gentoo-dev 2015-06-29 02:14:27 UTC
*** Bug 553194 has been marked as a duplicate of this bug. ***
Comment 9 Daniel Santos 2015-06-30 22:27:58 UTC
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.
Comment 10 Daniel Santos 2015-06-30 22:36:16 UTC
Oh crap, I just saw the message about Gentoo not supporting nvidia on kernels past 3.18, sorry.
Comment 11 Daniel Santos 2015-06-30 22:37:44 UTC
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).
Comment 12 DrSlony 2015-07-01 16:16:12 UTC
Many people are in this boat - stuck with 340.* because support for their hardware was dropped from >=341.* upwards.
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2015-07-02 04:01:32 UTC
(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.
Comment 14 Pacho Ramos gentoo-dev 2015-08-03 14:03:46 UTC
*** Bug 556282 has been marked as a duplicate of this bug. ***