This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: 2.95.3 destruction in Linux header
- To: <moshier at moshier dot ne dot mediaone dot net>
- Subject: Re: 2.95.3 destruction in Linux header
- From: Bernd Schmidt <bernds at redhat dot com>
- Date: Tue, 27 Mar 2001 13:10:57 +0100 (BST)
- Cc: Geoff Keating <geoffk at redhat dot com>, <drepper at redhat dot com>,<gcc-bugs at gcc dot gnu dot org>
On Mon, 26 Mar 2001, Stephen L Moshier wrote:
>
>
> > I'm not entirely sure yet what's going on, but I believe the problem is
> > that you're compiling a piece of kernel code, but not using
> > "-I /path-to-linux/include". This means when one of the kernel headers
> > tries to include <asm/posix_types.h>, it doesn't use the one from the
> > kernel tree, but rather takes gcc's fixincluded one. This in turn uses
> > features.h, which is a libc header file. This sort of mixup can lead to
> > strange effects.
> >
> > I think you need to set the include path properly for this to work.
>
>
> Well, I agree that this is what is happening, but I don't agree
> that it ought to be happening. I'm merely trying to install a
> device driver that builds fine with earlier versions of gcc.
> This file,
> /usr/lib/gcc-lib/i486-linux/2.95.3/include/asm/posix_types.h
> breaks a program that used to work. Moreover, this file causes a
> general header file system meltdown. Surely it is a bad design, to
> have header files that self-destruct. It would be a bad policy to say
> it is OK to design headers so that they self-destruct.
As I see it, the problem is that a user program's (the kernel's) header
file has the same name as a system header file. Since you want the device
driver to pick up the right one, you need to give it the correct path.
> You seem to be telling me to use a workaround for buggy header files,
I don't think the header file is buggy. If it's included normally as a
system header from anything except kernel code, it doesn't blow up, does
it?
Bernd