Bug 181840 - x11/nvidia-driver: nvidia_linux.c:42:37: error: incompatible integer to pointer conversion passing 'unsigned long long' to parameter of type 'cap_rights_t *' (aka 'struct cap_rights *') [-Werror,-Wint-conversion] if ((error = fget(td
Summary: x11/nvidia-driver: nvidia_linux.c:42:37: error: incompatible integer to point...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-05 16:50 UTC by O. Hartmann
Modified: 2013-09-06 06:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2013-09-05 16:50:00 UTC
With several changes coming into CURRENT after r255211, port x11/nvidia-driver fails to update/build due to the error shown below.


[...]

cc -O2 -pipe -O3 -fstrict-aliasing -march=native -fno-strict-aliasing -O3 -fstrict-aliasing -march=native -DNV_VERSION_STRING=\"325.15\" -D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -O3 -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_os.c
--- nvidia_linux.o ---
nvidia_linux.c:42:37: error: incompatible integer to pointer conversion passing 'unsigned long long' to parameter of type 'cap_rights_t *' (aka 'struct cap_rights *') [-Werror,-Wint-conversion]
    if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0)
                                    ^~~~~~~~~
@/sys/capability.h:197:20: note: expanded from macro 'CAP_IOCTL'
#define CAP_IOCTL               CAPRIGHT(1, 0x0000000000000080ULL)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@/sys/capability.h:53:28: note: expanded from macro 'CAPRIGHT'
#define CAPRIGHT(idx, bit)      ((1ULL << (57 + (idx))) | (bit))
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@/sys/file.h:220:51: note: passing argument to parameter 'rightsp' here
int fget(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp);
                                                  ^
1 error generated.
*** [nvidia_linux.o] Error code 1

[...]
Comment 1 Edwin Groothuis freebsd_committer 2013-09-05 16:50:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->danfe

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2013-09-06 06:07:22 UTC
Author: danfe
Date: Fri Sep  6 05:07:15 2013
New Revision: 326460
URL: http://svnweb.freebsd.org/changeset/ports/326460

Log:
  Unbreak the build on recent -CURRENT (after cap_rights_t type was changed
  from uint64_t to a structure in r255219).
  
  PR:	ports/181840

Modified:
  head/x11/nvidia-driver/Makefile

Modified: head/x11/nvidia-driver/Makefile
==============================================================================
--- head/x11/nvidia-driver/Makefile	Fri Sep  6 04:30:35 2013	(r326459)
+++ head/x11/nvidia-driver/Makefile	Fri Sep  6 05:07:15 2013	(r326460)
@@ -154,6 +154,12 @@ post-patch: .SILENT
 	${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} > 1000051
+	${REINPLACE_CMD} -e 's/u_long cmd;/& cap_rights_t rights;/ ; \
+		s/CAP_IOCTL/cap_rights_init(\&rights, &)/' \
+			${WRKSRC}/src/nvidia_linux.c
+.endif
 # Fix stack buffer overflow in nvidia_sysctl_bus_type()
 .if ${NVVERSION} < 3192300
 	${REINPLACE_CMD} -E '/bus_type\[4\]/d ; \
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Alexey Dokuchaev freebsd_committer 2013-09-06 06:08:31 UTC
State Changed
From-To: open->closed

Should be fixed in r326460, thanks for the report!