Subject: qemu build error in sys/lock.h
To: None <pkgsrc-users@netbsd.org>
From: Oliver Gould <ogould@olix0r.net>
List: pkgsrc-users
Date: 04/21/2007 13:59:53
Hello-

I'm getting the following error building qemu on netbsd-4.99.16.
CC_VERSION, in this case, is gcc-3.3.5 (from pkgsrc), as specified in
the Makefile.

  ===> Building for qemu-0.8.2nb2
  gcc -DQEMU_TOOL -O2 -I/usr/pkg/include -DGLX_GLXEXT_LEGACY
  -I/usr/include -Wall -O2 -fno-strict-aliasing -I.
  -L/usr/pkg/gcc3/lib/gcc-lib/i386--netbsdelf2.0/3.3.5
  -Wl,-R/usr/pkg/gcc3/lib/gcc-lib/i386--netbsdelf2.0/3.3.5
  -L/usr/pkg/gcc3/lib -Wl,-R/usr/pkg/gcc3/lib -L/usr/pkg/lib
  -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -L/usr/X11R6/lib
  -Wl,-R/usr/X11R6/lib -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
  -D_LARGEFILE_SOURCE -o qemu-img qemu-img.c block.c block-cow.c
  block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c
  block-bochs.c block-vpc.c block-vvfat.c -lz 
  In file included from /usr/include/sys/disk.h:92,
                   from block.c:33:
  /usr/include/sys/lock.h:117: error: parse error before "pri_t"
  /usr/include/sys/lock.h:132: error: parse error before '}' token
  /usr/include/sys/lock.h:151: error: parse error before '}' token

I've looked through sys/lock.h, sys/disk.h, and sys/types.h (where pri_t
is defined), and everything looks okay to me:

---- work/qemu-0.8.2/block.c:
27  #ifdef _BSD
28  #include <sys/types.h>
29  #include <sys/stat.h>
30  #include <sys/ioctl.h>
31  #include <sys/queue.h>
32  #ifndef __DragonFly__
33  #include <sys/disk.h>
34  #endif
35  #endif

---- /usr/include/sys/lock.h:
  1  /*      $NetBSD: lock.h,v 1.70 2007/03/12 16:31:54 ad Exp $ */
...
 96  struct lock {
...
110          union {
111                  struct {
112                          /* pid of exclusive lock holder */
113                          pid_t lk_sleep_lockholder;
114                          lwpid_t lk_sleep_locklwp;
115
116                          /* priority at which to sleep */
117                          pri_t lk_sleep_prio;
118
119                          /* maximum sleep time (for tsleep) */
120                          int lk_sleep_timo;
121
122                          /* lock taking over this lock */
123                          struct lock *lk_newlock;
124                  } lk_un_sleep;
125                  struct {
126                          /* CPU ID of exclusive lock holder */
127                          cpuid_t lk_spin_cpu;
128  #if defined(LOCKDEBUG)
129                          _TAILQ_ENTRY(struct lock, volatile) lk_spin_list;
130  #endif
131                  } lk_un_spin;
132          } lk_un;
...
151  };
...

Any ideas?

  - Oliver