ports/188393: [patch] x11/nvidia-driver: unbreak build with 337.12

Jan Beich jbeich at tormail.org
Wed Apr 9 09:00:00 UTC 2014


>Number:         188393
>Category:       ports
>Synopsis:       [patch] x11/nvidia-driver: unbreak build with 337.12
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 09 09:00:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Jan Beich
>Release:        FreeBSD 11.0-CURRENT amd64
>Organization:
>Environment:
>Description:

>How-To-Repeat:
$ make DISTVERSION=337.12 DISABLE_MAKE_JOBS= NO_CHECKSUM=
===>  Building for nvidia-driver-337.12
===> src (all)
cc -O2 -pipe -DNV_VERSION_STRING=\"337.12\" -D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O2 -fno-strict-aliasing -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 -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 -Wno-unused-function   -c nvidia_linux.c
nvidia_linux.c:45:30: error: redefinition of 'rights'
    u_long cmd; cap_rights_t rights;
                             ^
nvidia_linux.c:43:18: note: previous definition is here
    cap_rights_t rights;
                 ^
1 error generated.
*** Error code 1

>Fix:
--- nvidia-driver_337.12.fix.diff begins here ---
Index: x11/nvidia-driver/Makefile
===================================================================
--- x11/nvidia-driver/Makefile	(revision 350670)
+++ x11/nvidia-driver/Makefile	(working copy)
@@ -136,13 +137,13 @@ post-patch: .SILENT
 		${WRKSRC}/src/nvidia_linux.c
 .endif
 # Adjust Linux headers #include's after FreeBSD src SVN r246085
-.if ${OSVERSION} > 1000027 && ${NVVERSION} >= 964323
+.if ${OSVERSION} > 1000027 && ${NVVERSION} >= 964323 && ${NVVERSION} < 3371200
 	${REINPLACE_CMD} -E '/#include "machine\/\.\.\/linux(32)?\/linux.h"/ \
 		{ x ; s/.*/#include "machine\/..\/..\/compat\/linux\/linux_ioctl.h"/ ; H ; x ; }' \
 			${WRKSRC}/src/nvidia_linux.c
 .endif
 # Adjust vm_object locking after FreeBSD src SVN r248084
-.if ${OSVERSION} > 1000029
+.if ${OSVERSION} > 1000029 && ${NVVERSION} < 3371200
 	${REINPLACE_CMD} -e '/#include <vm\/vm_object.h>/ \
 		{ x ; s/.*/#include <sys\/rwlock.h>/ ; G ; }' \
 			${WRKSRC}/src/nv-freebsd.h
@@ -150,18 +151,18 @@ post-patch: .SILENT
 		${WRKSRC}/src/nvidia_subr.c
 .endif
 # Adjust kmem(9) calls after FreeBSD src SVN r254025
-.if ${OSVERSION} > 1000040
+.if ${OSVERSION} > 1000040 && ${NVVERSION} < 3371200
 	${REINPLACE_CMD} -e '/kmem_/s/kernel_map/kernel_arena/' \
 		${WRKSRC}/src/nvidia_subr.c
 .endif
 # Adopt to cap_rights_t type change in FreeBSD src SVN r255219
-.if ${OSVERSION} > 1000052
+.if ${OSVERSION} > 1000052 && ${NVVERSION} < 3371200
 	${REINPLACE_CMD} -e 's/u_long cmd;/& cap_rights_t rights;/ ; \
 		s/CAP_IOCTL/cap_rights_init(\&rights, &)/' \
 			${WRKSRC}/src/nvidia_linux.c
 .endif
 # Argument count of vm_map_find() changed in FreeBSD src SVN r255426
-.if ${OSVERSION} > 1000054
+.if ${OSVERSION} > 1000054 && ${NVVERSION} < 3371200
 	${REINPLACE_CMD} -e 's/virtual_address, size,/& 0,/' \
 		${WRKSRC}/src/nvidia_subr.c
 .endif
--- nvidia-driver_337.12.fix.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list