Non-standard LFS v5-chap6: redefinition of `struct timespec´ compiling sysklogd-1.4.1
Duarte.Cordeiro at cm-lisboa.pt
Mon Jan 5 14:14:58 PST 2004
first the apologies: sorry for the long post and for my english :)
I've been following the guide, and until now eveything went smooth or was
solved by visiting the wiki or hints pages.
I have all standard packages except for kernel-2.6.0 and module-init-tools
While trying to compile sysklogd-1.4.1 I get the following error:
gcc -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce -DFSSTND -c
In file included from /usr/include/linux/timex.h:186,
/usr/include/linux/time.h:9: error: redefinition of `struct timespec'
/usr/include/linux/time.h:15: error: redefinition of `struct timeval'
In file included from /usr/include/linux/jiffies.h:6,
And so on.
I googled it and it's because I'm compiling it against kernel-2.6 headers.
But now I'm puzzled.
In the book I read the part that talks about:
Why we copy the kernel headers and don't symlink them
and that makes sense.
But in the post that I found, it goes like this:
You've got /usr/src/linux-2.6.0-test7/include/linux as
/usr/include/linux ? There's your problem, don't do that.
There's only one app that has any business looking at kernel headers,
and that's glibc. Even with glibc there's some debate as to whether it
should be allowed to do so. When you compile glibc, configure it using
--with-kernel=2.6.0 (I think that's the option) and tell it where to
find the headers for your 2.6 kernel. That'll make you a glibc that's
not backward compatible with anything prior to 2.6. Then the userspace
headers it installs should be suitable for all your 2.6 compatible needs.
Kernel people are most unforgiving of people who try to use the kernel
headers in userspace and wind up with problems. Just ask google.
Who's right ? Who's wrong? Both rigth?
And the question is: how can I solve this ?
More information about the lfs-support