Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116543 - nvidia-kernel-1.0.8174 and nvidia-kernel-1.0.8178 fail to build with gentoo-sources-2.6.14-r5
Summary: nvidia-kernel-1.0.8174 and nvidia-kernel-1.0.8178 fail to build with gentoo-s...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: X11 External Driver Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-23 14:42 UTC by Santtu Pajukanta
Modified: 2006-11-09 02:56 UTC (History)
4 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 Santtu Pajukanta 2005-12-23 14:42:45 UTC
Both nvidia-kernel-1.0.8174 and nvidia-kernel-1.0.8178 fail to build with gentoo-sources-2.6.14-r5. This problem might affect older nvidia-kernel versions, too. 



Output of emerge nvidia-kernel:
===============================

[snip]
  cc -Wp,-MD,/var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/.nv-vm.o.d  -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include -D__KERNEL__ -Iinclude  -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2     -fomit-frame-pointer -pipe -msoft-float -mpreferred-stack-boundary=2 -fno-unit-at-a-time -march=athlon -Iinclude/asm-i386/mach-default -Wdeclaration-after-statement  -I/var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv -Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wparentheses   -Wno-multichar  -Werror -O -fno-common -MD    -Wno-cast-qual -Wno-error -D_LOOSE_KERNEL_NAMES -D__KERNEL__ -DMODULE  -DNTRM -DNVRM -DDYNAMIC_SLI  -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=8178  -UDEBUG -U_DEBUG -DNDEBUG -DNV_SIGNAL_STRUCT_RLIM -DNV_MULTIPLE_BRIDGE_AGPGART_PRESENT -DNV_PCI_GET_CLASS_PRESENT -DNV_SYSCTL_MAX_MAP_COUNT_PRESENT -DNV_PM_MESSAGE_T_PRESENT -DNV_PCI_CHOOSE_STATE_PRESENT -DNV_REMAP_PFN_RANGE_PRESENT -DNV_CHANGE_PAGE_ATTR_PRESENT -DNV_VMAP_2_PRESENT  -DMODULE -DKBUILD_BASENAME=nv_vm -DKBUILD_MODNAME=nvidia -c -o /var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/nv-vm.o /var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/nv-vm.c
/var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/nv-vm.c: In function `nv_vmap':
/var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/nv-vm.c:817: error: too few arguments to function `vmap'
make[3]: *** [/var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv/nv-vm.o] Error 1
make[2]: *** [_module_/var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linux-x86-1.0-8178-pkg1/usr/src/nv] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [mdl] Error 1
make: *** [module] Error 2

!!! ERROR: media-video/nvidia-kernel-1.0.8178 failed.
!!! Function linux-mod_src_compile, Line 505, Exitcode 2
!!! Unable to make                                  IGNORE_CC_MISMATCH=yes V=1 SYSSRC=/usr/src/linux SYSOUT=/usr/src/linux clean module.



Output of emerge info:
======================

Portage 2.0.53 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r4 i686)
=================================================================
System uname: 2.6.14-gentoo-r4 i686 AMD Athlon(TM) XP 2500+
Gentoo Base System version 1.6.13
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.1.3-r1, 2.2.3-r5, 2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.4.19-r1, 2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-ident -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -momit-leaf-frame-pointer -fno-ident -pipe -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 3dnow X aalib acl alsa apache2 apm arts audiofile avi berkdb bitmap-fonts bluetooth bzip2 cdr crypt cups curl dvd dvdr eds emacs emboss encode ethereal exif expat fam ffmpeg flac foomaticdb fortran gcj gd gdbm ggi gif glut gmp gphoto2 gpm gtk gtk2 guile idn ieee1394 imagemagick imlib ipv6 java jpeg junit kde lcms ldap libg++ libwww lua mad matroska mhash mikmod mmx mng motif mozilla mp3 mpeg mysql ncurses network nls nptl nptlonly nvidia ogg oggvorbis openal opengl oss pam pcre pdflib perl png postgres postgresql psql python qt quicktime readline recode samba sdl slang speex spell sqlite sse ssl svga tcltk tcpd tetex theora tiff truetype truetype-fonts type1-fonts udev usb vorbis win32codecs wmf xine xml xml2 xmms xv xvid zlib video_cards_nvidia userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Santtu Pajukanta 2005-12-23 14:47:13 UTC
This looks similar:

http://bugs.gentoo.org/show_bug.cgi?id=105029

But it's with older nvidia-kernel and gentoo-sources.
Comment 2 Jouni Rinne 2005-12-24 00:58:13 UTC
Strange, 1.0.8174 builds and works fine on my very similar (kernel 2.6.14-gentoo-r5, glibc-2.3.5-r3 etc.) system. 1.0.8178 builds but doesn't work, haven't yet figured out why. BTW, why does your emerge-info say that you are running 2.6.14-gentoo-r4 instead of -r5? Have you symlinked the kernel sources correctly?
Comment 3 Tom Simnett 2005-12-24 01:57:34 UTC
I am using 2.6.14-gentoo-r3 and having the same problem. just had to downgrade back to 8174, as 8178 built but when X tried to start, it couldn't find the module.
Comment 4 Santtu Pajukanta 2005-12-24 02:07:43 UTC
/usr/src/linux is correctly symlinked to /usr/src/linux-2.6.14-gentoo-r5. I have successfully configured and compiled gentoo-sources-2.6.14-r5 but I am not currently running it because I don't yet obviously have the nvidia module for that kernel... I'm not that much of a VT freak, I want my KDE :)
Comment 5 Stephen Becker (RETIRED) gentoo-dev 2005-12-26 10:07:01 UTC
I have been experiencing this bug also, starting with 8174, and have noticed some interesting things.  The problem here is that something in the portage environment is causing -DNV_VMAP_2_PRESENT instead of -DNV_VMAP_4_PRESENT in the flags passed to make.  If you cd to $PORTAGE_TMPDIR/nvidia-kernel-<blah>/etc... and run the exact make command which portage is trying to use, then -DNV_VMAP_4_PRESENT is properly set, the module finishes building with no problems, and you can copy the resulting nvidia.ko to /lib/modules/<blah> and it will load just fine.

Furthermore, and probably most interesting, is that if I were to load a working 8174 kernel module, and then try to emerge nvidia-kernel-1.0.8174, then I would have absolutely no problem building the kernel module, and I could emerge it over and over all day long with no problems.  However, trying to subsequently emerge 8178 immediately after this will fail in the exact way which caused this bug report.  Similarly, if I load a working 8178 module and try to build 8174, I also trigger this bug.

FWIW, I encountered this bug with both vanilla-sources-2.6.14.2 and 2.6.15-rc5.
Comment 6 Roger Franz 2005-12-29 12:30:59 UTC
Much the same issue - I emerged 8178, but nvidia thinks it's 8174, and will not start. I look in /var/tmp/portage, and 8178 is not present - 8174-r1 is present for both nvidia-glx and nvidia-kernel. I don't know if that helps, but it definitely appears related.
Comment 7 Roy Bamford gentoo-dev 2006-01-01 08:50:03 UTC
For me this bug shows itself as the nvidia make (the ebuild is fine) failing to identify my kernel with the message :-
1.0-8178-pkg1/usr/src/nv ...
 * Preparing nvidia module
If you are using a Linux 2.4 kernel, please make sure
you either have configured kernel sources matching your
kernel or the correct set of kernel headers installed
on your system.

If you are using a Linux 2.6 kernel, please make sure
you have configured kernel sources matching your kernel
installed on your system. If you specified a separate
output directory using either the "KBUILD_OUTPUT" or
the "O" KBUILD parameter, make sure to specify this
directory with the SYSOUT environment variable or with
the equivalent nvidia-installer command line option.

Depending on where and how the kernel sources (or the
kernel headers) were installed, you may need to specify
their location with the SYSSRC environment variable or
the equivalent nvidia-installer command line option.

*** Unable to determine the target kernel version. ***

A cd to /var/tmp/portage/nvidia-kernel-1.0.8178/work/NVIDIA-Linu x-x86-1.0-8178-pkg1/usr/src/nv and running 
make install
builds and installs it. Then of course nvidia-glx won't build, so you have to add media-video/nvidia-kernel-1.0.8178 to  /etc/make.profile/package.provided
which is really a dirty hack but I don't know enough about ebuilds to fix the ebuild - yet.
Comment 8 Kris Kersey (RETIRED) gentoo-dev 2006-01-11 13:16:46 UTC
Anyone with this problem, give it another shot with the latest 8178-r1 and let me know how it works.  Also, please use a stable kernel.
Comment 9 Tristan Keen 2006-01-11 17:05:31 UTC
I get the same issue with 8178 and 8178-r1 when compiling against 2.6.15-mm2 or -mm3.

The new U011106 patch from Zander at http://www.nvnews.net/vbulletin/showthread.php?t=62021 includes a fix like that suggested in bug #116543 (which may therefore be a duplicate), which fixed the problem for me.
Comment 10 Kris Kersey (RETIRED) gentoo-dev 2006-01-12 06:25:22 UTC
nvidia-kernel-1.0.8178-r2 added to CVS with new Zander patch as suggested.
Comment 11 Santtu Pajukanta 2006-01-12 21:42:17 UTC
Whatever Kris did to the ebuild, it didn't work for me (using gentoo-sources-2.6.15 now). With 8178-r2 I am still getting the same results - NV_VMAP_2_PRESENT is declared instead of NV_VMAP_4_PRESENT, and the build dies a horrible, painful death. :(
Comment 12 Daniel E. Wilson 2006-01-12 23:39:30 UTC
The package nvidia-kernel-1.0.8178-r2 fails for me in exactly the same way.
Here is the result of 'emerge info' for my box in the hope that
it gives someone a hint as to what the problem is.

Portage 2.0.53 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 AMD Athlon(TM) XP 1700+
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=athlon-xp -mfpmath=sse -msse -mmmx -m3dnow -fmove-all-movables"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -mfpmath=sse -msse -mmmx -m3dnow -fmove-all-movables"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://gentoo.mirrors.pair.com/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://open-systems.ufl.edu/mirrors/gentoo http://ftp.gentoo.or.kr/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X alsa apm arts audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr crypt cups curl devmap doc dvd dvdr eds emacs emboss encode esd ethereal exif expat fam ffmpeg flac font-server foomaticdb fortran ftp gd gif gimpprint glut gmp gnome gphoto2 gpm gstreamer gtk gtk2 idn imagemagick imap imlib ipv6 java javascript jpeg junit kde lcms leim libg++ libwww mad maildir mbox mikmod mime ming mmx mng motif mozilla mp3 mpeg mule ncurses nls nptl nptlonly nsplugin nvidia ogg oggvorbis opengl oss pam pcre pdflib perl png posix postgres ppds python qt quicktime readline sasl sdl sockets spell sse ssl svga tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts udev usb vcd vorbis wxwindows x86 xine xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 13 Daniel E. Wilson 2006-01-13 13:17:19 UTC
I have another Gentoo box that does not have this bug.  A look at
the /etc/make.conf file revealed that the ccache feature was not
enabled.  At this point I theorize that this is what is causing the
bug.  After disabling ccache on the box exhibiting the bug I was able
to build the nvidia-kernel package five times in a row with no problems.

I think the following script code is the problem.  I believe that
the compiler cache is allowing the C compiler to generate an output
file for the first case which is causing the script to believe that
the two argument form of vmap is being used.

As I see it there are two ways to fix the ebuild.
  1.  Get the ebuild to disable the use of the ccache feature during
      the build of the nvidia-kernel module.
  2.  Use regular expressions and grep to find the number of arguments in
      the vmap function defined in the vmalloc.h header file.

I hope this helps in fixing the bug.

    vmap_arg_count)
        #
        # Determine, if vmap() is present, and how many arguments
        # it takes.
        #

        echo "#include <linux/vmalloc.h>
        void *nv_vmap(struct page **pg, int cnt) {
            return vmap(pg, cnt);
        }" > conftest$$.c
        $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
        rm -f conftest$$.c

        if [ -f conftest$$.o ]; then
            rm -f conftest$$.o
            echo 2
            exit 0
        fi

        echo "#include <linux/vmalloc.h>
        #include <linux/mm.h>
        void *nv_vmap(struct page **pg, int cnt) {
            return vmap(pg, cnt, 0, PAGE_KERNEL);
        }" > conftest$$.c
        $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
        rm -f conftest$$.c

        if [ -f conftest$$.o ]; then
            rm -f conftest$$.o
            echo 4
        else
            exit 1  # there ain't no vmap()
        fi
    ;;

Portage 2.0.53 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 AMD Athlon(TM) XP 1700+
Gentoo Base System version 1.6.13
ccache version 2.3 [disabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=athlon-xp -mfpmath=sse -msse -mmmx -m3dnow -fmove-all-movables"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -mfpmath=sse -msse -mmmx -m3dnow -fmove-all-movables"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://gentoo.mirrors.pair.com/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://open-systems.ufl.edu/mirrors/gentoo http://ftp.gentoo.or.kr/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X alsa apm arts audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr crypt cups curl devmap doc dvd dvdr eds emacs emboss encode esd ethereal exif expat fam ffmpeg flac font-server foomaticdb fortran ftp gd gif gimpprint glut gmp gnome gphoto2 gpm gstreamer gtk gtk2 idn imagemagick imap imlib ipv6 java javascript jpeg junit kde lcms leim libg++ libwww mad maildir mbox mikmod mime ming mmx mng motif mozilla mp3 mpeg mule ncurses nls nptl nptlonly nsplugin nvidia ogg oggvorbis opengl oss pam pcre pdflib perl png posix postgres ppds python qt quicktime readline sasl sdl sockets spell sse ssl svga tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts udev usb vcd vorbis wxwindows x86 xine xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 14 Santtu Pajukanta 2006-01-15 22:16:02 UTC
Great, Daniel! Disabling ccache made the module build for me, too.
Comment 15 Armando Di Cianno 2006-01-23 08:33:07 UTC
- same issues, running gentoo-sources-2.6.15-r1
- disabling ccache fixed things
- "ditto"
Comment 16 Ortwin Glueck 2006-02-21 15:53:50 UTC
nvidia-kernel-1.0.8178 works very well here with vanilla 2.6.15.4 and 2.6.16-rc4.
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2006-11-09 02:56:01 UTC
Obsolete drivers version that's no longer in the tree, obsolete kernel. Closing a stale bug. For ccache-related issue, see Bug 137000.

Thanks.