PDA

View Full Version : 7.0-BETA2 nvidia-driver signedness compilation issues


sarumont
11-15-07, 08:11 PM
Has anyone seen anything like the following when compiling nvidia-driver under 7.0-BETA2? The only remotely close references I can find are from the Linux nvidia-driver and are a few years old. Thanks.

cc1: note: obsolete option -I- used, please use -iquote instead
cc1: warnings being treated as errors
nvidia_os.c: In function 'os_dbg_init':
nvidia_os.c:370: warning: pointer targets in passing argument 3 of 'rm_read_registry_dword' differ in signedness
nvidia_os.c:370: warning: pointer targets in passing argument 4 of 'rm_read_registry_dword' differ in signedness
nvidia_os.c: In function 'os_string_compare':
nvidia_os.c:510: warning: pointer targets in passing argument 1 of 'strcmp' differ in signedness
nvidia_os.c:510: warning: pointer targets in passing argument 2 of 'strcmp' differ in signedness
nvidia_os.c: In function 'os_string_copy':
nvidia_os.c:518: warning: pointer targets in passing argument 1 of 'strcpy' differ in signedness
nvidia_os.c:518: warning: pointer targets in passing argument 2 of 'strcpy' differ in signedness
nvidia_os.c:518: warning: pointer targets in return differ in signedness
nvidia_os.c: In function 'os_string_length':
nvidia_os.c:523: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
*** Error code 1

Stop in /usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86-100.14.19/src.
*** Error code 1

Stop in /usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86-100.14.19.
*** Error code 1

Stop in /usr/ports/x11/nvidia-driver.
*** Error code 1

Stop in /usr/ports/x11/nvidia-driver.

zander
11-15-07, 08:51 PM
I hadn't seen this before, but will take a closer look. Does this happen outside of the ports/ tree? The simplest workaround for now probably is to add '-Wno-sign-compare' to the CFLAGS of the NVIDIA kernel module Makefile.

sarumont
11-16-07, 09:19 AM
I get the same results in ports and with the tarball from the downloads section. Also, -Wno-sign-compare did not have any effect. :-\

sarumont
11-16-07, 11:01 PM
Looking at it a bit more closely, -Werror is in the cc command. I can't figure out where it is being added to my CFLAGS, though. It's present in both the port and the source version.

zander
11-17-07, 08:40 PM
@ sarumont: the only way I could make this happen on FreeBSD 7.0-BETA2 was by editing /usr/share/mk/bsd.sys.mk and explicitely adding '-Wpointer-sign' to CWARNFLAGS; you may be able to fix your problem by editing the same file and making sure that '-Wno-pointer-sign' is added to CWARNFLAGS last.

sarumont
11-19-07, 09:51 AM
Zander: Thanks a lot! -Wno-pointer-sign was being added conditionally ( if GCC3 ). I moved it to be added unconditionally, and nvidia-driver builds. I won't be able to test it until tonight, but I don't anticipate any problems.

Thanks for throwing some time at this.

sarumont
11-21-07, 12:57 PM
Unfortunately, no testing is required. kldload fails stating that there is no such file or directory as nvidia, but I suspect the real problem is what ends up in my logs:

Nov 21 10:38:39 illusion kernel: link_elf: symbol cv_wait undefined

The only things I've been able to find referring to cv_wait and the FreeBSD nvidia-driver were those related to it being called with the wrong mutex. I also tried the beta drivers you posted, but I had the same results.

Any ideas on this one?

zander
11-21-07, 02:17 PM
cv_wait() didn't go away, as far as I know, and the right set of header files should be included. Can you post the complete set of build time messages?

sarumont
11-21-07, 07:24 PM
Sure thing. I'm attaching the build output from the ports version and the beta.

sarumont
11-27-07, 10:36 AM
Call off the hounds! In attempting to determine was up with the (apparent) linking problem, I thought to update and rebuild my world. I had been building in /usr/7.0/src rather than /usr/src. Moving to /usr/src seems like it has fixed something.

Mergemaster was noisier this time around, and I finally saw the "FreeBSD version not supported" error when compiling the beta drivers. Now, though, everything builds, installs, loads and runs. I've never been more delighted to see the nVidia splash screen. :)

Looking back at it, though, I think that everything stemmed from me not using the -m option to mergemaster. I guess I expected it to automagically determine from whence my sources came. Moving them to /usr/src and rebuilding accomplished the same thing as mergemaster -m /usr/7.0/src (only with a lot more time and headaches).

Thanks for your time, zander. Sorry for wasting it due to my oversight. :)

P.S - Hope you had a good Thanksgiving.

zander
11-27-07, 12:43 PM
That's good to hear; thanks for the update!