|
From: Jeroen N. W. <jn...@xs...> - 2004-08-17 23:20:04
|
During configuration of valgrind from CVS on debian sarge (the upcoming 3.1 release) I ran into the same problem with linux/mii.h Sefer Tov mentions at the bottom of http://article.gmane.org/gmane.comp.debugging.valgrind/1549/match=+mii and Nicholas Nethercote in http://lists.gnu.org/archive/html/bug-autoconf/2004-06/msg00056.html using kernel 2.4.26-1-386 and gcc version 3.3.4 (Debian 1:3.3.4-6sarge1). FWIW, I think this is a kernel header bug; file linux/mii.h does not #define __KERNEL__ before including file linux/types.h, or should use __u16 instead of u16. Compilation results in: In file included from /home/jeroen/projects/valgrind/coregrind/vg_unsafe.h:56, from /home/jeroen/projects/valgrind/coregrind/vg_syscalls.c:35: /usr/include/asm/ipc.h:10: error: field `__user' has incomplete type /usr/include/asm/ipc.h:10: error: parse error before '*' token /usr/include/asm/ipc.h:12: error: parse error before '}' token These can be fixed with the patch below. This has been tested only on one debian sarge system. Jeroen. Index: configure.in =================================================================== RCS file: /home/kde/valgrind/configure.in,v retrieving revision 1.115 diff -u -r1.115 configure.in --- configure.in 14 Aug 2004 18:52:26 -0000 1.115 +++ configure.in 17 Aug 2004 17:25:59 -0000 @@ -331,7 +331,7 @@ # Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h sys/statfs.h sys/time.h sys/endian.h endian.h termios.h unistd.h u time.h linux/fb.h linux/mii.h mqueue.h]) +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h sys/statfs.h sys/time.h sys/endian.h endian.h termios.h unistd.h u time.h linux/fb.h linux/mii.h mqueue.h linux/compiler.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_UID_T Index: coregrind/vg_unsafe.h =================================================================== RCS file: /home/kde/valgrind/coregrind/vg_unsafe.h,v retrieving revision 1.32 diff -u -r1.32 vg_unsafe.h --- coregrind/vg_unsafe.h 16 Aug 2004 19:46:55 -0000 1.32 +++ coregrind/vg_unsafe.h 17 Aug 2004 17:26:00 -0000 @@ -50,11 +50,11 @@ #include <net/if.h> /* for struct ifreq et al */ #include <net/if_arp.h> /* for struct arpreq */ #include <net/route.h> /* for struct rtentry */ -#ifdef KERNEL_2_6 +#include <linux/msg.h> /* for struct msgbuf */ +#ifdef HAVE_LINUX_COMPILER_H #include <linux/compiler.h> /* for __user definition */ #endif #include <asm/ipc.h> /* for struct ipc_kludge */ -#include <linux/msg.h> /* for struct msgbuf */ #include <linux/sem.h> /* for struct sembuf */ #include <scsi/sg.h> /* for the SG_* ioctls */ |