NetBSD Problem Report #42852

From www@NetBSD.org  Sat Feb 20 12:02:28 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 03C3763B8DE
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 20 Feb 2010 12:02:28 +0000 (UTC)
Message-Id: <20100220120227.A5B3763B11D@www.NetBSD.org>
Date: Sat, 20 Feb 2010 12:02:27 +0000 (UTC)
From: kordex@gmail.com
Reply-To: kordex@gmail.com
To: gnats-bugs@NetBSD.org
Subject: x11/libdrm-2.4.13 fails to compile on Solaris 10
X-Send-Pr-Version: www-1.0

>Number:         42852
>Category:       pkg
>Synopsis:       x11/libdrm-2.4.13 fails to compile on Solaris 10
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    solaris-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 20 12:05:00 +0000 2010
>Closed-Date:    
>Last-Modified:  Wed Jan 05 22:01:58 +0000 2011
>Originator:     Mikko Kortelainen
>Release:        -
>Organization:
xnet.fi
>Environment:
SunOS flexnet 5.10 Generic sun4u sparc SUNW,Netra-T4

>Description:
flexnet:~/pkgsrc/x11/libdrm> bmake
=> Bootstrap dependency digest>=20010302: found digest-20080510
=> Bootstrap dependency tnftp-[0-9]*: found tnftp-20070806
===> Skipping vulnerability checks.
WARNING: No /export/home/kordex/pkg/var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/export/home/kordex/pkg/sbin/pkg_admin -K /export/home/kordex/pkg/var/db/pkg fetch-pkg-vulnerabilities'.
===> Building for libdrm-2.4.13
--- all-recursive ---
Making all in libdrm
--- all ---
/export/home/kordex/pkg/bin/bmake  all-recursive
--- all-recursive ---
Making all in .
--- xf86drm.lo ---
--- xf86drmMode.lo ---
--- xf86drm.lo ---
/export/home/kordex/pkg/bin/pdksh ../libtool --tag=CC    --mode=compile gcc -DHAVE_CONFIG_H -I.     -I../shared-core -O -MT xf86drm.lo -MD -MP -MF .deps/xf86drm.Tpo -c -o xf86drm.lo xf86drm.c
--- xf86drmMode.lo ---
/export/home/kordex/pkg/bin/pdksh ../libtool --tag=CC    --mode=compile gcc -DHAVE_CONFIG_H -I.     -I../shared-core -O -MT xf86drmMode.lo -MD -MP -MF .deps/xf86drmMode.Tpo -c -o xf86drmMode.lo xf86drmMode.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../shared-core -O -MT xf86drmMode.lo -MD -MP -MF .deps/xf86drmMode.Tpo -c xf86drmMode.c  -fPIC -DPIC -o .libs/xf86drmMode.o
--- xf86drm.lo ---
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../shared-core -O -MT xf86drm.lo -MD -MP -MF .deps/xf86drm.Tpo -c xf86drm.c  -fPIC -DPIC -o .libs/xf86drm.o
--- xf86drmMode.lo ---
xf86drmMode.c: In function `drmModeGetResources':
xf86drmMode.c:140: error: syntax error before "struct"
xf86drmMode.c:152: error: syntax error before "struct"
xf86drmMode.c:154: error: label `err_allocs' used but not defined
xf86drmMode.c: At top level:
xf86drmMode.c:162: error: syntax error before "if"
xf86drmMode.c:181: error: syntax error before '(' token
xf86drmMode.c:181: error: syntax error before '.' token
xf86drmMode.c:182: error: syntax error before '(' token
xf86drmMode.c:182: error: syntax error before '.' token
xf86drmMode.c:183: error: syntax error before '(' token
xf86drmMode.c:183: error: syntax error before '.' token
xf86drmMode.c: In function `drmModeAddFB':
xf86drmMode.c:202: error: syntax error before "struct"
xf86drmMode.c:202: error: syntax error before ')' token
xf86drmMode.c: In function `drmModeRmFB':
xf86drmMode.c:211: error: syntax error before "uint32_t"
xf86drmMode.c: In function `drmModeGetFB':
xf86drmMode.c:223: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeGetCrtc':
xf86drmMode.c:252: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeSetCrtc':
xf86drmMode.c:292: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeSetCursor':
xf86drmMode.c:309: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeMoveCursor':
xf86drmMode.c:321: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeGetEncoder':
xf86drmMode.c:337: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeGetConnector':
xf86drmMode.c:372: error: syntax error before "struct"
xf86drmMode.c:386: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeAttachMode':
xf86drmMode.c:430: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeDetachMode':
xf86drmMode.c:440: error: syntax error before "struct"
xf86drmMode.c: In function `drmModeGetProperty':
xf86drmMode.c:456: error: syntax error before "struct"
xf86drmMode.c:470: error: syntax error before "struct"
xf86drmMode.c:472: error: label `err_allocs' used but not defined
xf86drmMode.c: At top level:
xf86drmMode.c:475: error: syntax error before "if"
xf86drmMode.c:492: error: syntax error before '->' token
xf86drmMode.c:492: error: conflicting types for 'strncpy'
xf86drmMode.c:492: error: conflicting types for 'strncpy'
xf86drmMode.c:492: warning: data definition has no type or storage class
xf86drmMode.c:493: error: syntax error before '->' token
xf86drmMode.c:497: error: syntax error before '(' token
xf86drmMode.c:497: error: syntax error before '.' token
xf86drmMode.c: In function `drmModeGetPropertyBlob':
xf86drmMode.c:521: error: syntax error before "struct"
xf86drmMode.c:527: error: syntax error before "struct"
xf86drmMode.c:529: error: label `err_allocs' used but not defined
xf86drmMode.c: At top level:
xf86drmMode.c:532: error: syntax error before "if"
xf86drmMode.c: In function `drmModeConnectorSetProperty':
xf86drmMode.c:563: error: syntax error before "struct"
xf86drmMode.c:563: error: syntax error before ')' token
xf86drmMode.c: In function `drmModeCrtcGetGamma':
xf86drmMode.c:644: error: syntax error before "struct"
xf86drmMode.c:644: error: syntax error before ')' token
xf86drmMode.c: In function `drmModeCrtcSetGamma':
xf86drmMode.c:662: error: syntax error before "struct"
xf86drmMode.c:662: error: syntax error before ')' token
*** [xf86drmMode.lo] Error code 1
--- xf86drm.lo ---
xf86drm.c: In function `drmGetVersion':
xf86drm.c:748: error: syntax error before "struct"
xf86drm.c: At top level:
xf86drm.c:753: error: syntax error before "if"
xf86drm.c:762: warning: parameter names (without types) in function declaration
xf86drm.c:762: error: conflicting types for 'drmFreeKernelVersion'
xf86drm.c:687: error: previous definition of 'drmFreeKernelVersion' was here
xf86drm.c:762: warning: data definition has no type or storage class
xf86drm.c:763: error: syntax error before "return"
xf86drm.c:771: error: invalid type argument of `unary *'
xf86drm.c:771: warning: initialization makes integer from pointer without a cast
xf86drm.c:771: error: initializer element is not constant
xf86drm.c:771: warning: data definition has no type or storage class
xf86drm.c:772: warning: parameter names (without types) in function declaration
xf86drm.c:772: error: conflicting types for 'drmCopyVersion'
xf86drm.c:708: error: previous definition of 'drmCopyVersion' was here
xf86drm.c:772: warning: data definition has no type or storage class
xf86drm.c:773: warning: parameter names (without types) in function declaration
xf86drm.c:773: warning: data definition has no type or storage class
xf86drm.c:774: error: syntax error before "return"
xf86drm.c: In function `drmGetBusid':
xf86drm.c:846: error: syntax error before "struct"
xf86drm.c:849: error: syntax error before "struct"
xf86drm.c: In function `drmSetBusid':
xf86drm.c:876: error: syntax error before "struct"
xf86drm.c: In function `drmGetMagic':
xf86drm.c:887: error: syntax error before "struct"
xf86drm.c: In function `drmAuthMagic':
xf86drm.c:898: error: syntax error before "struct"
xf86drm.c: In function `drmAddMap':
xf86drm.c:963: error: syntax error before "struct"
xf86drm.c: In function `drmRmMap':
xf86drm.c:976: error: syntax error before "struct"
xf86drm.c: In function `drmAddBufs':
xf86drm.c:1009: error: syntax error before "struct"
xf86drm.c: In function `drmMarkBufs':
xf86drm.c:1022: error: syntax error before "struct"
xf86drm.c:1031: error: syntax error before "struct"
xf86drm.c: At top level:
xf86drm.c:1037: error: syntax error before "for"
xf86drm.c:1042: error: syntax error before '.' token
xf86drm.c:1042: error: conflicting types for 'drmFree'
xf86drm.c:157: error: previous definition of 'drmFree' was here
xf86drm.c:1042: warning: data definition has no type or storage class
xf86drm.c:1046: error: syntax error before '.' token
xf86drm.c:1046: warning: data definition has no type or storage class
xf86drm.c: In function `drmFreeBufs':
xf86drm.c:1072: error: syntax error before "struct"
xf86drm.c: In function `drmGetBufInfo':
xf86drm.c:1161: error: syntax error before "struct"
xf86drm.c:1168: error: syntax error before "struct"
xf86drm.c: At top level:
xf86drm.c:1185: error: syntax error before "return"
xf86drm.c: In function `drmMapBufs':
xf86drm.c:1212: error: syntax error before "struct"
xf86drm.c:1221: error: syntax error before "struct"
xf86drm.c: At top level:
xf86drm.c:1226: error: redefinition of 'retval'
xf86drm.c:771: error: previous definition of 'retval' was here
xf86drm.c:1226: error: invalid type argument of `unary *'
xf86drm.c:1226: warning: initialization makes integer from pointer without a cast
xf86drm.c:1226: error: initializer element is not constant
xf86drm.c:1226: warning: data definition has no type or storage class
xf86drm.c:1227: error: syntax error before '->' token
xf86drm.c:1236: error: syntax error before '.' token
xf86drm.c:1236: warning: data definition has no type or storage class
xf86drm.c: In function `drmDMA':
xf86drm.c:1297: error: syntax error before "struct"
xf86drm.c: In function `drmGetLock':
xf86drm.c:1336: error: syntax error before "struct"
xf86drm.c: In function `drmUnlock':
xf86drm.c:1359: error: syntax error before "struct"
xf86drm.c: In function `drmGetReservedContextList':
xf86drm.c:1371: error: syntax error before "struct"
xf86drm.c:1385: error: syntax error before "struct"
xf86drm.c: In function `drmCreateContext':
xf86drm.c:1424: error: syntax error before "struct"
xf86drm.c: In function `drmSwitchToContext':
xf86drm.c:1435: error: syntax error before "struct"
xf86drm.c: In function `drmSetContextFlags':
xf86drm.c:1456: error: syntax error before "struct"
xf86drm.c: In function `drmGetContextFlags':
xf86drm.c:1467: error: syntax error before "struct"
xf86drm.c: In function `drmDestroyContext':
xf86drm.c:1498: error: syntax error before "struct"
xf86drm.c: In function `drmCreateDrawable':
xf86drm.c:1506: error: syntax error before "struct"
xf86drm.c: In function `drmDestroyDrawable':
xf86drm.c:1516: error: syntax error before "struct"
xf86drm.c: In function `drmUpdateDrawableInfo':
xf86drm.c:1532: error: syntax error before "struct"
xf86drm.c: In function `drmAgpEnable':
xf86drm.c:1593: error: syntax error before "struct"
xf86drm.c: In function `drmAgpAlloc':
xf86drm.c:1624: error: syntax error before "struct"
xf86drm.c: In function `drmAgpFree':
xf86drm.c:1651: error: syntax error before "struct"
xf86drm.c: In function `drmAgpBind':
xf86drm.c:1676: error: syntax error before "struct"
xf86drm.c: In function `drmAgpUnbind':
xf86drm.c:1700: error: syntax error before "struct"
xf86drm.c: In function `drmAgpVersionMajor':
xf86drm.c:1721: error: syntax error before "struct"
xf86drm.c: In function `drmAgpVersionMinor':
xf86drm.c:1742: error: syntax error before "struct"
xf86drm.c: In function `drmAgpGetMode':
xf86drm.c:1763: error: syntax error before "struct"
xf86drm.c: In function `drmAgpBase':
xf86drm.c:1784: error: syntax error before "struct"
xf86drm.c: In function `drmAgpSize':
xf86drm.c:1805: error: syntax error before "struct"
xf86drm.c: In function `drmAgpMemoryUsed':
xf86drm.c:1826: error: syntax error before "struct"
xf86drm.c: In function `drmAgpMemoryAvail':
xf86drm.c:1847: error: syntax error before "struct"
xf86drm.c: In function `drmAgpVendorId':
xf86drm.c:1868: error: syntax error before "struct"
xf86drm.c: In function `drmAgpDeviceId':
xf86drm.c:1889: error: syntax error before "struct"
xf86drm.c: In function `drmScatterGatherAlloc':
xf86drm.c:1901: error: syntax error before "struct"
xf86drm.c: In function `drmScatterGatherFree':
xf86drm.c:1913: error: syntax error before "struct"
xf86drm.c: In function `drmWaitVBlank':
xf86drm.c:1942: error: syntax error before "union"
xf86drm.c: In function `drmCtlInstHandler':
xf86drm.c:2004: error: syntax error before "struct"
xf86drm.c: In function `drmCtlUninstHandler':
xf86drm.c:2027: error: syntax error before "struct"
xf86drm.c: In function `drmFinish':
xf86drm.c:2044: error: syntax error before "struct"
xf86drm.c: In function `drmGetInterruptFromBusID':
xf86drm.c:2070: error: syntax error before "struct"
xf86drm.c: In function `drmAddContextPrivateMapping':
xf86drm.c:2112: error: syntax error before "struct"
xf86drm.c: In function `drmGetContextPrivateMapping':
xf86drm.c:2124: error: syntax error before "struct"
xf86drm.c: In function `drmGetMap':
xf86drm.c:2139: error: syntax error before "struct"
xf86drm.c: In function `drmGetClient':
xf86drm.c:2156: error: syntax error before "struct"
xf86drm.c: In function `drmGetStats':
xf86drm.c:2171: error: syntax error before "struct"
xf86drm.c: In function `drmSetInterfaceVersion':
xf86drm.c:2313: error: syntax error before "struct"
xf86drm.c: At top level:
xf86drm.c:2317: error: syntax error before '->' token
xf86drm.c: In function `drmCommandRead':
xf86drm.c:2370: error: `DRM_IOC_READ' undeclared (first use in this function)
xf86drm.c:2370: error: (Each undeclared identifier is reported only once
xf86drm.c:2370: error: for each function it appears in.)
xf86drm.c: In function `drmCommandWrite':
xf86drm.c:2399: error: `DRM_IOC_WRITE' undeclared (first use in this function)
xf86drm.c: In function `drmCommandWriteRead':
xf86drm.c:2428: error: `DRM_IOC_READ' undeclared (first use in this function)
xf86drm.c:2428: error: `DRM_IOC_WRITE' undeclared (first use in this function)
*** [xf86drm.lo] Error code 1
2 errors

bmake: stopped in /export/home/kordex/pkgsrc/x11/libdrm/work/libdrm-2.4.13/libdrm
*** [all-recursive] Error code 1
1 error

bmake: stopped in /export/home/kordex/pkgsrc/x11/libdrm/work/libdrm-2.4.13/libdrm
*** [all] Error code 2
1 error

bmake: stopped in /export/home/kordex/pkgsrc/x11/libdrm/work/libdrm-2.4.13/libdrm
*** [all-recursive] Error code 1
1 error

bmake: stopped in /export/home/kordex/pkgsrc/x11/libdrm/work/libdrm-2.4.13
*** Error code 2

Stop.
bmake: stopped in /export/home/kordex/pkgsrc/x11/libdrm
*** Error code 1

Stop.
bmake: stopped in /export/home/kordex/pkgsrc/x11/libdrm
flexnet:~/pkgsrc/x11/libdrm>

>How-To-Repeat:
cd x11/libdrm && bmake
>Fix:
well i don't really know if libdrm is needed on solaris to build modular-xorg-server.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Sat, 20 Feb 2010 12:40:18 +0000
Responsible-Changed-Why:
Solaris pkgsrc problem.


From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/42852: x11/libdrm-2.4.13 fails to compile on Solaris 10
Date: Sat, 20 Feb 2010 20:31:36 +0000

 On Sat, Feb 20, 2010 at 12:05:00PM +0000, kordex@gmail.com wrote:
  > --- xf86drmMode.lo ---
  > xf86drmMode.c: In function `drmModeGetResources':
  > xf86drmMode.c:140: error: syntax error before "struct"

 What's this tripping on?

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->feedback
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Tue, 01 Jun 2010 02:33:26 +0000
State-Changed-Why:
is this still a problem with libdrm 2.4.20?  thanks.


With 2.4.20 I get it to build with a couple patches... but I have no way to test beyond that...

--- libkms/linux.c.orig 2011-01-05 15:52:30.829525400 -0600
+++ libkms/linux.c      2011-01-05 15:53:35.148593300 -0600
@@ -39,6 +39,9 @@
 #include <unistd.h>

 #include <sys/stat.h>
+#ifdef __sun
+#include <sys/sysmacros.h>
+#endif

 #include "internal.h"


--- Makefile    2 May 2010 22:24:38 -0000       1.14
+++ Makefile    5 Jan 2011 21:17:14 -0000
@@ -13,7 +13,7 @@
 PKG_DESTDIR_SUPPORT=   user-destdir

 ONLY_FOR_PLATFORM=     NetBSD-*-* DragonFly-*-* FreeBSD-*-* OpenBSD-*-* \
-                       Linux-*-* 
+                       Linux-*-* SunOS-*-*


Plus add this to the existing xf86drm.h patch (patch-ac):

+#if defined(__sun) && !defined(_IOC)
+#define _IOC(dir, group, nr, size)                             \
+    (dir == DRM_IOC_READWRITE ? _IOWRN(group, nr, size) :      \
+      (dir == DRM_IOC_WRITE ? _IOWN(group, nr, size) :         \
+       /* dir == DRM_IOC_READ */  _IORN(group, nr, size) ))
+#endif


This last is from patches found at:
 http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg35327.html
There are more patches there that may be needed to make things actually work...
but the above is enough to get it to compile.

State-Changed-From-To: feedback->open
State-Changed-By: tez@NetBSD.org
State-Changed-When: Wed, 05 Jan 2011 22:01:58 +0000
State-Changed-Why:
feedback provided


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.