Bug 238018 - [PATCH] x11/nvidia-driver: fails to build on head r347988
Summary: [PATCH] x11/nvidia-driver: fails to build on head r347988
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords: patch
: 238024 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-21 10:35 UTC by Guido Falsi
Modified: 2019-05-22 07:54 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments
patch (2.45 KB, patch)
2019-05-21 10:35 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Falsi freebsd_committer freebsd_triage 2019-05-21 10:35:40 UTC
Created attachment 204505 [details]
patch

Hi,

The nvidia driver fails to build for me on head r347988 in poudriere with the error at the end of the message (full log available if needed).

I have fixed with the simple attached patch, and it works fine here, although I'm not sure it's the correct patch to apply for everyone.


===> src/nvidia-modeset (all)
--- machine ---
--- x86 ---
--- machine ---
machine -> /usr/src/sys/amd64/include
--- x86 ---
x86 -> /usr/src/sys/x86/include
--- nvidia-modeset-freebsd.o ---
cc  -O2 -pipe -march=nehalem -fno-strict-aliasing -DNV_VERSION_STRING=\"390.87\" -Werror=undef -march=nehalem  -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -Imachine -I/usr/src/sys/sys -I../common/inc -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include     -MD  -MF.depend.nvidia-modeset-freebsd.o -MTnvidia-modeset-freebsd.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c nvidia-modeset-freebsd.c -o nvidia-modeset-freebsd.o
nvidia-modeset-freebsd.c:233:5: error: implicit declaration of function 'mtx_lock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    mtx_lock(&popen->events.lock);
    ^
nvidia-modeset-freebsd.c:233:5: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
nvidia-modeset-freebsd.c:239:5: error: implicit declaration of function 'mtx_unlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    mtx_unlock(&popen->events.lock);
    ^
nvidia-modeset-freebsd.c:239:5: note: did you mean 'mtx_lock'?
nvidia-modeset-freebsd.c:233:5: note: 'mtx_lock' declared here
    mtx_lock(&popen->events.lock);
    ^
nvidia-modeset-freebsd.c:239:5: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    mtx_unlock(&popen->events.lock);
    ^
nvidia-modeset-freebsd.c:257:9: error: implicit declaration of function 'mtx_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        mtx_init(&ref_ptr->lock, "nvkms-ref-ptr-lock", NULL, MTX_SPIN);
        ^
nvidia-modeset-freebsd.c:257:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
nvidia-modeset-freebsd.c:257:62: error: use of undeclared identifier 'MTX_SPIN'
        mtx_init(&ref_ptr->lock, "nvkms-ref-ptr-lock", NULL, MTX_SPIN);
                                                             ^
nvidia-modeset-freebsd.c:276:5: error: implicit declaration of function 'mtx_lock_spin' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    mtx_lock_spin(&ref_ptr->lock);
    ^
nvidia-modeset-freebsd.c:276:5: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
nvidia-modeset-freebsd.c:278:5: error: implicit declaration of function 'mtx_unlock_spin' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    mtx_unlock_spin(&ref_ptr->lock);
    ^
nvidia-modeset-freebsd.c:278:5: note: did you mean 'mtx_lock_spin'?
nvidia-modeset-freebsd.c:276:5: note: 'mtx_lock_spin' declared here
    mtx_lock_spin(&ref_ptr->lock);
Comment 1 Alexey Dokuchaev freebsd_committer freebsd_triage 2019-05-21 14:55:41 UTC
*** Bug 238024 has been marked as a duplicate of this bug. ***
Comment 2 Guido Falsi freebsd_committer freebsd_triage 2019-05-22 07:10:36 UTC
A similar patch has been proposed in phabricator:

https://reviews.freebsd.org/D20350
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-05-22 07:49:47 UTC
A commit references this bug:

Author: danfe
Date: Wed May 22 07:49:41 UTC 2019
New revision: 502258
URL: https://svnweb.freebsd.org/changeset/ports/502258

Log:
  Unbreak the build after base (src) r347984.

  PR:	238018
  Differential Revision:	https://reviews.freebsd.org/D20350

Changes:
  head/x11/nvidia-driver/Makefile
Comment 4 Alexey Dokuchaev freebsd_committer freebsd_triage 2019-05-22 07:54:26 UTC
Fix had been committed as ports r502258, thank you.