This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 2.95.3 destruction in Linux header


On Sun, 25 Mar 2001, Stephen L Moshier wrote:

>
> > tst.c:
> > #include <linux/fs.h>
> >
> > i486-linux-2.95.3-gcc -D__KERNEL__ -c tst.c
> > (hundreds of errors)
>
> Here is where the path of header file self-destruction apparently starts.
> On linux, gcc-2.95.3 has a newly invented private header file
>     /usr/lib/gcc-lib/i486-linux/2.95.3/include/asm/posix_types.h
> that references /usr/include/features.h.  Upon commenting out that
> reference to features.h, the errors go away.
>
> Whatever problem this header file is supposed to solve,
> I think the inclusion of a system header should not be part of
> the supposed solution.  Perhaps, if it is fixing a linux header,
> it could get the information it needs from some other linux header?

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.


Bernd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]