From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N9d7L-0000Vl-5j for mharc-grub-devel@gnu.org; Sun, 15 Nov 2009 06:18:03 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9d7I-0000UN-3h for grub-devel@gnu.org; Sun, 15 Nov 2009 06:18:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9d7C-0000TB-Nd for grub-devel@gnu.org; Sun, 15 Nov 2009 06:17:59 -0500 Received: from [199.232.76.173] (port=42318 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9d7C-0000T0-40 for grub-devel@gnu.org; Sun, 15 Nov 2009 06:17:54 -0500 Received: from moutng.kundenserver.de ([212.227.126.188]:60310) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9d7B-0003Kx-Ke for grub-devel@gnu.org; Sun, 15 Nov 2009 06:17:54 -0500 Received: from [85.180.43.63] (e180043063.adsl.alicedsl.de [85.180.43.63]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MIAjy-1N5n5l34nu-0044So; Sun, 15 Nov 2009 12:17:51 +0100 From: Felix Zielcke To: The development of GNU GRUB In-Reply-To: <20091115110458.GA25752@thorin> References: <20091026161638.GA9371@thorin> <20091028231622.GA19287@thorin> <20091029101433.GA8145@thorin> <20091029103618.GA10006@thorin> <1257331694.5000.34.camel@fz.local> <1258233405.2749.8.camel@fz.local> <20091115110458.GA25752@thorin> Content-Type: text/plain; charset="UTF-8" Date: Sun, 15 Nov 2009 12:17:50 +0100 Message-ID: <1258283870.2822.8.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1/TRYB3iBgX9Q5fdGjr5ecgT++Ej38HsgSd7cK i6sY+3vUoVNXevL6/Mu5c0PEAyw3nnXGIJOmk7O8spvlJM/vwM aQYxPQbCTyYzE8jzqY5nA== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Add -nostdinc to TARGET_CFLAGS X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2009 11:18:00 -0000 Am Sonntag, den 15.11.2009, 12:04 +0100 schrieb Robert Millan: > On Sat, Nov 14, 2009 at 10:16:45PM +0100, Felix Zielcke wrote: > > Am Mittwoch, den 04.11.2009, 11:48 +0100 schrieb Felix Zielcke: > > > > > > Thanks to the hint from rubisher I looked now at Linux Makefiles. > > > They use this: > > > > > > NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) > > > > > > # ls $(gcc-4.4 -print-file-name=include)/stdarg.h > > > /usr/lib/gcc/x86_64-linux-gnu/4.4.2/include/stdarg.h > > > > > > > Robert? > > IMO this makes at least more sense then what we have now > > and I just tested this now with and without a seperate build directory > > with experimental branch and it works > > TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -nostdinc -isystem $(shell $(CC) > > -print-file-name=include) -I$(srcdir)/include -I$(builddir) > > -I$(builddir)/include -Wall -W > > What's the advantage? > 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 $ cat test.c #include #include 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 -- Felix Zielcke Proud Debian Maintainer and GNU GRUB developer