NetBSD Problem Report #53258

From www@NetBSD.org  Thu May  3 16:03:10 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 2ED717A167
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  3 May 2018 16:03:10 +0000 (UTC)
Message-Id: <20180503160308.D9E097A1F4@mollari.NetBSD.org>
Date: Thu,  3 May 2018 16:03:08 +0000 (UTC)
From: jake.slazenger@yandex.com
Reply-To: jake.slazenger@yandex.com
To: gnats-bugs@NetBSD.org
Subject: MesaLib does not build on NetBSD-8.0_RC1 with nouveau
X-Send-Pr-Version: www-1.0

>Number:         53258
>Category:       pkg
>Synopsis:       MesaLib does not build on NetBSD-8.0_RC1 with nouveau
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 03 16:05:00 +0000 2018
>Closed-Date:    Fri May 31 08:39:14 +0000 2019
>Last-Modified:  Fri May 31 08:39:14 +0000 2019
>Originator:     Jake Slazenger
>Release:        NetBSD-8.0_RC1, pkgsrc-current-20180502
>Organization:
>Environment:
NetBSD localhost 8.0_RC1 NetBSD 8.0_RC1 (RUSTY) #0: Mon Apr 30 10:08:34 MSK 2018  rusty@localhost:/usr/src/src-8.0_RC1/sys/arch/amd64/compile/RUSTY amd64
>Description:
Build of this package crashing and requiring 'dri3proto' package. 

So I've disabled dri3 option. 

After this change build crashing, but with new error that requires 'libdrm' package. So, I've installed this package and added some libdrm-specific variables to the Makefile for the configure phase.

Build crashing, but with new error:

gmake[5]: Entering directory '/usr/pkgsrc/pkgsrc-current/graphics/MesaLib/work/mesa-11.2.2/src/mesa/drivers/dri/i965'
  CC       brw_binding_tables.lo
In file included from brw_binding_tables.c:42:0:
brw_context.h:41:23: fatal error: intel_aub.h: No such file or directory
compilation terminated.
Makefile:1506: recipe for target 'brw_binding_tables.lo' failed
gmake[5]: *** [brw_binding_tables.lo] Error 1


How I can fix that? I tried to add INTEL_CFLAGS to CFLAGS variable, tried some other things, but it didn't give me any result.

Help me. Please.

Here is all changes that I've added to the package:

Makefile:
--- Makefile.old	2018-05-02 14:41:20.991950472 +0000
+++ Makefile
@@ -68,6 +68,28 @@ CFLAGS.SunOS+=	-D__EXTENSIONS__
 CONFIGURE_ARGS+=	--enable-glx-read-only-text
 .endif

+# Configure-phase variables for libdrm_nouveau
+CONFIGURE_ENV+=		NVVIEUX_CFLAGS="-I${PREFIX}/include \
+			                -I${PREFIX}/include/libdrm \
+			                -I${PREFIX}/include/libdrm/nouveau" 
+CONFIGURE_ENV+=		NVVIEUX_LIBS="-L${PREFIX}/lib -ldrm_nouveau"
+CONFIGURE_ENV+=		NOUVEAU_CFLAGS="-I${PREFIX}/include \
+			                -I${PREFIX}/include/libdrm \
+			                -I${PREFIX}/include/libdrm/nouveau" 
+CONFIGURE_ENV+=		NOUVEAU_LIBS="-L${PREFIX}/lib -ldrm_nouveau"
+
+# Configure-phase variables for libdrm_amdgpu
+CONFIGURE_ENV+=		AMDGPU_CFLAGS="-I${PREFIX}/include \
+			               -I${PREFIX}/include/libdrm"
+CONFIGURE_ENV+=		AMDGPU_LIBS="-L${PREFIX}/lib -ldrm_amdgpu"
+
+# Configure-phase variables for libdrm_intel
+CONFIGURE_ENV+=		INTEL_CFLAGS="-I${PREFIX}/include \
+			              -I${PREFIX}/include/libdrm"
+CONFIGURE_ENV+=		INTEL_LIBS="-L${PREFIX}/lib -ldrm_intel"
+CFLAGS+=		-I${PREFIX}/include 
+CFLAGS+=		-I${PREFIX}/include/libdrm
+
 .if !empty(PKGSRC_COMPILER:Mclang)
 SUBST_CLASSES+=		tr1
 SUBST_STAGE.tr1=	pre-configure
@@ -112,6 +134,8 @@ INSTALLATION_DIRS+=	share/examples/MesaL
 post-install:
 	${INSTALL_DATA} ${WRKSRC}/src/mesa/drivers/dri/common/drirc ${DESTDIR}${PREFIX}/share/examples/MesaLib

+.include "../../x11/libdrm/buildlink3.mk"
+
 .include "../../x11/libX11/buildlink3.mk"
 .include "../../x11/libXext/buildlink3.mk"
 .include "../../x11/libxcb/buildlink3.mk"

options.mk:
--- options.mk.old	2018-05-02 14:19:47.457960459 +0000
+++ options.mk
@@ -33,12 +33,17 @@ PLIST_VARS+=	gbm vaapi vdpau wayland xat

 CONFIGURE_ARGS+=	--enable-dri
 CONFIGURE_ARGS+=	--enable-egl
-.if ${OPSYS} != "Darwin"
+.if ${OPSYS} != "Darwin" || ${OPSYS} != "NetBSD"
 CFLAGS+=		-DHAVE_DRI3
 CONFIGURE_ARGS+=	--enable-dri3
 CONFIGURE_ARGS+=	--enable-gbm
 PLIST.gbm=		yes
 .endif
+
+.if ${OPSYS} == "NetBSD"
+CONFIGURE_ARGS+=	--disable-dri3
+.endif
+
 CONFIGURE_ARGS+=	--enable-gles1
 CONFIGURE_ARGS+=	--enable-gles2
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "matthew green" <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53258 CVS commit: src/sys/external/bsd/drm2/nouveau
Date: Mon, 21 May 2018 08:58:47 +0000

 Module Name:	src
 Committed By:	mrg
 Date:		Mon May 21 08:58:47 UTC 2018

 Modified Files:
 	src/sys/external/bsd/drm2/nouveau: nouveau_pci.c

 Log Message:
 disable drm2 on modern nouveau cards (Pascal-based).

 our older drm doesn't have any support for modern Pascal or
 the second version of Maxwell (but not disabled here yet)
 but the driver tries to attach on any nvidia gpu.

 this should workaround PR#53258, and other issues reported
 with modern nvidia chipsets.

 XXX: pullup-7, pullup-8.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53258 CVS commit: [netbsd-8] src/sys/external/bsd/drm2/nouveau
Date: Fri, 8 Jun 2018 10:08:06 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Jun  8 10:08:06 UTC 2018

 Modified Files:
 	src/sys/external/bsd/drm2/nouveau [netbsd-8]: nouveau_pci.c

 Log Message:
 Pull up following revision(s) (requested by mrg in ticket #851):

 	sys/external/bsd/drm2/nouveau/nouveau_pci.c: revision 1.9-1.11

 disable drm2 on modern nouveau cards (Pascal-based).

 our older drm doesn't have any support for modern Pascal or
 the second version of Maxwell (but not disabled here yet)
 but the driver tries to attach on any nvidia gpu.
 this should workaround PR#53258, and other issues reported
 with modern nvidia chipsets.

 XXX: pullup-7, pullup-8.

 -

 disable matching nouveau on pascal and the second generation of maxwell
 cards that are not supported by this version of drm.
 this should fix various modern systems vs nvidia issues, eg PR 53188.

 XXX: pullup-7, pullup-8.

  -

 the previous change doubled the check for pascal.  fix it so
 that we only check for later maxwell and pascal once each,
 as intended.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.8.10.1 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Sun, 08 Jul 2018 10:39:03 +0000
State-Changed-Why:
There has been a commit and a pull-up. Does this fix the issue at hand


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 31 May 2019 08:39:14 +0000
State-Changed-Why:
feedback timeout, presume fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.