grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add -nostdinc to TARGET_CFLAGS


From: Robert Millan
Subject: Re: [PATCH] Add -nostdinc to TARGET_CFLAGS
Date: Sun, 15 Nov 2009 12:35:30 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Nov 15, 2009 at 12:17:50PM +0100, Felix Zielcke wrote:
> 
> The advantage is that this does exatly what we want for the target.
> Remove /usr/include from the include search directories but still keep
> the gcc internal one for e.g. stdarg.h
> As far as I understand the gcc manual, isystem adds this directory to
> the search path and treats all headers there in as system headers.
> And with the = between -isystem and $(srcdir) it actually uses
> ${sysroot}{$srcdir} but we don't use any --sysroot or -isysroot.
> The arguments we currently have there just look wrong with my understand
> of the gcc manual

Ah, I see..

> $ cat test.c
> #include <stdarg.h>
> #include <stdint.h>
> 
> int main (void)
> {
>   return 0;
> }
> 
> $ srcdir=$PWD builddir=$PWD gcc -isystem=$srcdir/include -I$srcdir/include 
> -I$builddir -I$builddir/include test.c -o test && ls test
> test
> $ srcdir=$PWD builddir=$PWD gcc -nostdinc -isystem $(gcc 
> -print-file-name=include) -I$srcdir/include -I$builddir -I$builddir/include 
> test.c 
> test.c:2:20: error: stdint.h: No such file or directory

We used -isystem as a way of excluding system headers but not gcc headers.
With the -print-file-name trick this seems to be no longer necessary, right?

So why not "-nostdinc -I$(gcc -print-file-name=include)" instead?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]