|
From: Sefer T. <se...@ho...> - 2004-07-19 06:09:15
|
Hi,
apparently one of the recent commits to the CVS has broken coregrind, the
issue also appears in the 2.1.2 release (I have mentioned this before, but
got no comments).
Apparently in some Linux configurations (using Mandrake cooker), the
definition of "nlmsghdr" is not provided in the same header files. For
example, in mine it appears in "linux/netlink.h" which does not get included
by the other include files.
Making the following change had resolved the problem for me (can you please
verify that this works for others too and possibly commit this change).
Add to "vg_unsafe.h" the following include entry
#include <linux/netlink.h>
just prior to this one
#include <linux/fs.h>
And valgrind seems to compile happily afterwards.
Here's the compilation error I'm getting:
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I./demangle -I../include -I../include
-I./x86 -DVG_LIBDIR="\"/opt/valgrind/lib/valgrind"\" -Winline -Wall
-Wshadow -O -fno-omit-frame-pointer -mpreferred-stack-boundary=2 -g
-DELFSZ=32 -MT vg_syscalls.o -MD -MP -MF ".deps/vg_syscalls.Tpo" \
-c -o vg_syscalls.o `test -f 'vg_syscalls.c' || echo './'`vg_syscalls.c; \
then mv -f ".deps/vg_syscalls.Tpo" ".deps/vg_syscalls.Po"; \
else rm -f ".deps/vg_syscalls.Tpo"; exit 1; \
fi
In file included from /usr/include/linux/msg.h:5,
from vg_unsafe.h:57,
from vg_syscalls.c:35:
/usr/include/linux/list.h:685:2: warning: #warning "don't include kernel
headers in userspace"
In file included from /usr/include/linux/fs.h:22,
from vg_unsafe.h:67,
from vg_syscalls.c:35:
/usr/include/linux/audit.h:101: error: field `nlh' has incomplete type
make[4]: *** [vg_syscalls.o] Error 1
make[4]: Leaving directory `/home/zvi/t/valgrind/coregrind'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/zvi/t/valgrind/coregrind'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/zvi/t/valgrind/coregrind'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zvi/t/valgrind'
make: *** [all] Error 2
-- Sefer.
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
|
|
From: Igmar P. <mai...@jd...> - 2004-07-19 12:53:32
Attachments:
vg-audit-hack.patch
|
> Apparently in some Linux configurations (using Mandrake cooker), the > definition of "nlmsghdr" is not provided in the same header files. It's actually a 2.6 kernel specific problem. > For > example, in mine it appears in "linux/netlink.h" which does not get included > by the other include files. One could argue if this is a bug in the kernel include files. > Add to "vg_unsafe.h" the following include entry > #include <linux/netlink.h> > just prior to this one > #include <linux/fs.h> Attached patch should make it work in all cases. Untested however :) Regards, Igmar |
|
From: Tom H. <th...@cy...> - 2004-07-19 23:15:14
|
In message <Pin...@jd...>
Igmar Palsenberg <mai...@jd...> wrote:
> > Apparently in some Linux configurations (using Mandrake cooker), the
> > definition of "nlmsghdr" is not provided in the same header files.
>
> It's actually a 2.6 kernel specific problem.
But not on all 2.6 kernels it seems. My Fedora Core 2 box is fine.
> > For
> > example, in mine it appears in "linux/netlink.h" which does not get
> > included by the other include files.
>
> One could argue if this is a bug in the kernel include files.
It certainly looks like one to me.
> > Add to "vg_unsafe.h" the following include entry
> > #include <linux/netlink.h>
> > just prior to this one
> > #include <linux/fs.h>
>
> Attached patch should make it work in all cases. Untested however :)
I'd rather not make it conditional on a specific kernel verion. If the
header might not always exist then configure should check it explicitly.
That said, every system I have looked at (back to RedHat 6.1) has that
header anyway, so it probably doesn't need a guard.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Igmar P. <mai...@jd...> - 2004-07-28 09:12:03
|
> > > Apparently in some Linux configurations (using Mandrake cooker), the > > > definition of "nlmsghdr" is not provided in the same header files. > > > > It's actually a 2.6 kernel specific problem. > > But not on all 2.6 kernels it seems. My Fedora Core 2 box is fine. With a RH kernel / includes ? RH usually has lots of patches in there. Someone needs to check one a 'by default working 2.6 install' if the extra include brakes things. > I'd rather not make it conditional on a specific kernel verion. If the > header might not always exist then configure should check it explicitly. > > That said, every system I have looked at (back to RedHat 6.1) has that > header anyway, so it probably doesn't need a guard. My concern was that the include might break things on a 2.4 box. If it doesn't, and it doesn't brake vanilla 2.6 kernels, the #ifdef could go away. > Tom Igmar |