Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Feb 2009 14:12:35 +0300 (MSK)
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        danfe@FreeBSD.org
Subject:   ports/131873: [PATCH] x11/nvidia-driver: fix build on current and fix with recent xorg
Message-ID:  <20090219111235.C0B30108839@hades.panopticon>
Resent-Message-ID: <200902191120.n1JBK0tn053530@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         131873
>Category:       ports
>Synopsis:       [PATCH] x11/nvidia-driver: fix build on current and fix with recent xorg
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 19 11:20:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 8.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Tue Feb 10 23:56:47 MSK 2009
>Description:
1) Due to removeal of minor() on FreeBSD >= 800062 nvidia-driver won't compile any more. Changing minor() to dev2unit() fixes the problem
2) After the latest Xorg update, X server won't start any more with following errors:

(II) Loading /usr/local/lib/xorg/modules//libwfb.so
dlopen: /usr/local/lib/xorg/modules//libwfb.so: Undefined symbol "miZeroLineScreenIndex"
(EE) Failed to load /usr/local/lib/xorg/modules//libwfb.so
(II) UnloadModule: "wfb"
(EE) Failed to load module "wfb" (loader failed, 7) 

This is caused by driver replacing xorg-server's /usr/local/lib/xorg/modules//libwfb.so with it's own.
The fix suggested on nvidia forums is to use xorg-server's libwfb, so make the port not replace the library.

This was tested on CURRENT 800062 with NVidia GeForce 9800 GT.

Port maintainer (danfe@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- nvidia-driver-177.80.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/x11/nvidia-driver/Makefile,v
retrieving revision 1.86
diff -u -u -r1.86 Makefile
--- Makefile	5 Jan 2009 19:42:28 -0000	1.86
+++ Makefile	19 Feb 2009 11:03:47 -0000
@@ -88,6 +88,11 @@
	's/suser(CURTHREAD)/priv_check(CURTHREAD, PRIV_DRIVER)/' \
		${WRKSRC}/src/nvidia_os.c
.endif
+# Removeal of minor()
+.if ${OSVERSION} >= 800062
+	${REINPLACE_CMD} -e 's,minor(,dev2unit(,' \
+		${WRKSRC}/src/nvidia_dev.c ${WRKSRC}/src/nvidia_subr.c
+.endif
.if defined(WITH_FREEBSD_AGP)
${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
	${WRKSRC}/src/nv-freebsd.h
@@ -119,10 +124,10 @@
@${MKDIR} ${PREFIX}/${MODULESDIR}/drivers
# xorg-server-1.4 installs its own ${LOCALBASE}/lib/xorg/modules/libwfb.so,
# so back it up so it can be later restored similarly to what NVidia does:
-.if ${NVVERSION} >= 974600
-	@${MV} -f ${PREFIX}/${MODULESDIR}/libwfb.so \
-		${PREFIX}/${MODULESDIR}/XXX-libwfb.so.%%.${XSERVVERSION}
-.endif
+#.if ${NVVERSION} >= 974600
+#	@${MV} -f ${PREFIX}/${MODULESDIR}/libwfb.so \
+#		${PREFIX}/${MODULESDIR}/XXX-libwfb.so.%%.${XSERVVERSION}
+#.endif

post-install:
# pkg-plist is already overbloated, so use this hack instead of PLIST_SUB's
Index: pkg-plist
===================================================================
RCS file: /home/amdmi3/projects/freebsd/FreeBSD.cvs/ports/x11/nvidia-driver/pkg-plist,v
retrieving revision 1.22
diff -u -u -r1.22 pkg-plist
--- pkg-plist	21 Oct 2008 01:57:21 -0000	1.22
+++ pkg-plist	19 Feb 2009 11:02:54 -0000
@@ -35,8 +35,8 @@
@unexec rm -f %D/lib/libnvidia-tls.so
lib/libXvMCNVIDIA.a
 %%MODULESDIR%%/libnvidia-wfb.so.1
-@exec mv -f %D/%%MODULESDIR%%/libwfb.so %D/%%MODULESDIR%%/XXX-libwfb.so.%%%%.%%XSERVVERSION%% && ln -sf libnvidia-wfb.so.1 %D/%%MODULESDIR%%/libwfb.so
-@unexec mv -f %D/%%MODULESDIR%%/XXX-libwfb.so.%%%%.%%XSERVVERSION%% %D/%%MODULESDIR%%/libwfb.so
+@comment @exec mv -f %D/%%MODULESDIR%%/libwfb.so %D/%%MODULESDIR%%/XXX-libwfb.so.%%%%.%%XSERVVERSION%% && ln -sf libnvidia-wfb.so.1 %D/%%MODULESDIR%%/libwfb.so
+@comment @unexec mv -f %D/%%MODULESDIR%%/XXX-libwfb.so.%%%%.%%XSERVVERSION%% %D/%%MODULESDIR%%/libwfb.so
 %%MODULESDIR%%/drivers/nvidia_drv.o
 %%MODULESDIR%%/drivers/nvidia_drv.so
 %%MODULESDIR%%/extensions/libglx.so.1
--- nvidia-driver-177.80.patch ends here ---

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090219111235.C0B30108839>