# nvidia-driver-304 error



## ruthr (Oct 1, 2013)

Hello,

My system is 10.0-ALPHA-3 and *I* have a roblem compiling the driver.


```
root@brzi:/usr/ports/x11/nvidia-driver-304 # uname -a
FreeBSD brzi 10.0-ALPHA3 FreeBSD 10.0-ALPHA3 #0 r255930M: Mon Sep 30 17:40:44 CEST 2013     root@brzi:/usr/obj/usr/src/sys/PILA  amd64
root@brzi:/usr/ports/x11/nvidia-driver-304 # make
===>  Building for nvidia-driver-304.88_1
--- all ---
===> src (all)
--- nvidia_subr.o ---
--- nvidia_sysctl.o ---
--- nvidia_subr.o ---
cc -O2 -pipe -fno-strict-aliasing -DNV_VERSION_STRING=\"304.88\" -D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I. -I@ -I@/contrib/altq -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality  -c nvidia_subr.c
--- nvidia_sysctl.o ---
cc -O2 -pipe -fno-strict-aliasing -DNV_VERSION_STRING=\"304.88\" -D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I. -I@ -I@/contrib/altq -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality  -c nvidia_sysctl.c
--- nvidia_subr.o ---
nvidia_subr.c:1071:46: error: too few arguments to function call, expected 10, have 9
            (VM_PROT_READ | VM_PROT_WRITE), 0);
                                             ^
@/vm/vm_map.h:368:1: note: 'vm_map_find' declared here
int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t,
^
1 error generated.
*** [nvidia_subr.o] Error code 1

make[3]: stopped in /usr/ports/x11/nvidia-driver-304/work/NVIDIA-FreeBSD-x86_64-304.88/src
1 error

make[3]: stopped in /usr/ports/x11/nvidia-driver-304/work/NVIDIA-FreeBSD-x86_64-304.88/src
*** [all] Error code 2

make[2]: stopped in /usr/ports/x11/nvidia-driver-304/work/NVIDIA-FreeBSD-x86_64-304.88
1 error

make[2]: stopped in /usr/ports/x11/nvidia-driver-304/work/NVIDIA-FreeBSD-x86_64-304.88
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11/nvidia-driver-304
*** Error code 1

Stop.
make: stopped in /usr/ports/x11/nvidia-driver-304
root@brzi:/usr/ports/x11/nvidia-driver-304 #
```

Platform is amd64.

Beri


----------



## tyson (Oct 1, 2013)

Update your ports tree. There was change in vm_map_find() in CURRENT, but it is fixed in nvidia-driver already.


----------



## ruthr (Oct 1, 2013)

tyson said:
			
		

> Update your ports tree. There was change in vm_map_find() in CURRENT, but it is fixed in nvidia-driver already.



Ports and source are updated.


```
root@brzi:/usr/ports # date
Tue Oct  1 21:28:08 CEST 2013
root@brzi:/usr/ports # portsnap fetch
Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
Latest snapshot on server matches what we already have.
No updates needed.
root@brzi:/usr/ports #
```


----------



## fernandel (Oct 1, 2013)

ruthr said:
			
		

> ports are upated and src to ..
> 
> 
> ```
> ...



I think you need to use svn for update ports on FreeBSD CURRENT.


----------



## ruthr (Oct 1, 2013)

fernandel said:
			
		

> I think you need to use svn for update ports on FreeBSD CURRENT.



The same error.


```
root@brzi:/usr/ports # svn info
Path: .
Working Copy Root Path: /usr/ports
URL: http://svn.freebsd.org/ports/head
Relative URL: ^/head
Repository Root: http://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 328986
Node Kind: directory
Schedule: normal
Last Changed Author: marino
Last Changed Rev: 328986
Last Changed Date: 2013-10-01 21:35:00 +0200 (Tue, 01 Oct 2013)

root@brzi:/usr/ports #
```


----------



## tyson (Oct 1, 2013)

Just curious ... you wiped you /usr/ports when making svn checkout ? I think maybe your workdir wasn't clean and didnt get patches.


----------



## ruthr (Oct 1, 2013)

tyson said:
			
		

> Just curious ... you wiped you /usr/ports when making svn checkout ? I think maybe your workdir wasn't clean and didnt get patches.



Fresh SVN checkout. Do u have nvidia card ??? If yes pls test ..

Do you have an Nvidia card? If yes, please test.


----------



## tyson (Oct 1, 2013)

Here it builds just fine. Anyway I use x11/nvidia-driver (modified to version 319.60 by Me).


----------



## ruthr (Oct 1, 2013)

tyson said:
			
		

> Here it builds just fine. Anyway I use x11/nvidia-driver (modified to version 319.60 by Me).



amd64 or i386?


----------



## tyson (Oct 1, 2013)

Sorry *I* forgot to add it, Im I'm running *amd64* 10-ALPHA4 
	
	



```
tyson% uname -a
FreeBSD tyson.x64.me 10.0-ALPHA4 FreeBSD 10.0-ALPHA4 #0 r255947: Mon Sep 30 08:51:47 CEST 2013 root@tyson.x64.me:/usr/obj/usr/src/sys/tyson amd64
```
Anyway this driver should compile just fine on yours too because both ports share Makefile, so it*'*s a very strange error. Maybe something in make.conf breaks it for you?


----------



## ruthr (Oct 1, 2013)

```
root@brzi:/usr/ports/x11/nvidia-driver-304 # svn info
Path: .
Working Copy Root Path: /usr/ports
URL: http://svn.freebsd.org/ports/head/x11/nvidia-driver-304
Relative URL: ^/head/x11/nvidia-driver-304
Repository Root: http://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 328986
Node Kind: directory
Schedule: normal
Last Changed Author: bapt
Last Changed Rev: 327777
Last Changed Date: 2013-09-21 01:43:19 +0200 (Sat, 21 Sep 2013)

root@brzi:/usr/ports/x11/nvidia-driver-304 # svn log
------------------------------------------------------------------------
r327777 | bapt | 2013-09-21 01:43:19 +0200 (Sat, 21 Sep 2013) | 2 lines

Add NO_STAGE all over the place in preparation for the staging support (cat: x11)

------------------------------------------------------------------------
r316497 | danfe | 2013-04-25 04:52:29 +0200 (Thu, 25 Apr 2013) | 7 lines

- Fix stack buffer overflow in nvidia_sysctl_bus_type()
- While here, install nvidia-bug-report.sh per popular demand and assume
  that everyone now has sed(1) that supports "addr1,+N" range syntax
- Spell X as X11 in port description

Submitted by:	glebius

------------------------------------------------------------------------
r315761 | danfe | 2013-04-08 15:41:57 +0200 (Mon, 08 Apr 2013) | 6 lines

Update NVidia drivers vulnerable to GPU driver ARGB cursor buffer overflow
in "NoScanout" mode.

Security:	CVE-2013-0131
Approved by:	portmgr (bapt)

------------------------------------------------------------------------
r312352 | danfe | 2013-02-16 15:09:17 +0100 (Sat, 16 Feb 2013) | 7 lines

- Update mainstream driver version to 310.32, the latest to date
- Unbreak the build on recent -CURRENT (after SVN r246085) [*]
- Move 304.xx driver version to yet another legacy port

PR:		ports/176146 [*]
Submitted by:	bf

------------------------------------------------------------------------
root@brzi:/usr/ports/x11/nvidia-driver-304 #
```

port are up to date .. so i don't know whats going on  .. in make.conf i got only defined ?CPUTYPE=core2 .

Ports are up to date, so I don't know what's going on. In make.conf I have only defined 
	
	



```
CPUTYPE=core2
```


----------



## ruthr (Oct 2, 2013)

I found an immediate solution how to `make` the driver. For some reason the change was not made in nvidia_subr.c and the current solution for me is to comment in the Makefile the .if .endif directive related to vm_map_find() and then changes applied to nvidia_subr.c


```
# Argument count of vm_map_find() changed in FreeBSD src SVN r255426
#.if ${OSVERSION} > 1000054
	${REINPLACE_CMD} -e 's/virtual_address, size,/& 0,/' \
		${WRKSRC}/src/nvidia_subr.c
#.endif
```


----------

