From: Russell King <rmk@arm.linux.org.uk>
To: Keith Owens <kaos@ocs.com.au>
Cc: Chris Friesen <cfriesen@nortelnetworks.com>,
linux-kernel@vger.kernel.org
Subject: Re: correct to set -nostdinc and then include <stdarg.h> ?
Date: Mon, 7 Apr 2003 07:47:22 +0100 [thread overview]
Message-ID: <20030407074722.A9367@flint.arm.linux.org.uk> (raw)
In-Reply-To: <23076.1049692512@kao2.melbourne.sgi.com>; from kaos@ocs.com.au on Mon, Apr 07, 2003 at 03:15:12PM +1000
On Mon, Apr 07, 2003 at 03:15:12PM +1000, Keith Owens wrote:
> On Mon, 07 Apr 2003 00:41:22 -0400,
> Chris Friesen <cfriesen@nortelnetworks.com> wrote:
> >
> >I was trying to compile 2.5.66 with gcc 3.2.2. It dies as soon as it tries to
> >compile init/main.c because it is unable to find "stdarg.h" which is included by
> >"include/linux/kernel.h".
stdarg.h is part of the compiler specific includes. We want to pick
up on these, so we use "-iwithprefix include" to add the compiler specific
includes back.
Unfortunately, there seems to be something wrong with GCC's ability to
determine where these includes really reside when GCC is installed in
a different location to the one it was configured with. In other words,
don't do that. Install GCC to the location where you told it to be
installed.
For instance, on a Red Hat machine, try:
# cp /usr/bin/gcc /usr/local/bin
# hash -r
# touch t.c
# gcc -nostdinc -iwithprefix include -v t.c
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
/usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0 -lang-c -nostdinc -v -iprefix
/usr/local/bin/../lib/gcc-lib/i386-redhat-linux/2.96/ -D__GNUC__=2
-D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux
-D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix)
-D__NO_INLINE__ -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__
-D__tune_i386__ -iwithprefix include t.c
GNU CPP version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2) (cpplib)
(i386 Linux/ELF)
ignoring nonexistent directory "/usr/local/lib/gcc-lib/i386-redhat-linux/2.96/include"
#include "..." search starts here:
End of search list.
# rm /usr/local/bin/gcc
# hash -r
and note that it fails.
> Try this:
>From a quick look at the patch, doesn't this mean that we re-evaluate
the search directory each time we build the compiler? Would it not
be better to cache the result ?
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
next prev parent reply other threads:[~2003-04-07 6:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-07 4:41 correct to set -nostdinc and then include <stdarg.h> ? Chris Friesen
2003-04-07 5:15 ` Keith Owens
2003-04-07 6:47 ` Russell King [this message]
2003-04-07 14:08 ` Chris Friesen
2003-04-07 14:16 ` Martin Schlemmer
2003-04-07 14:44 ` Chris Friesen
2003-04-07 23:00 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030407074722.A9367@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=cfriesen@nortelnetworks.com \
--cc=kaos@ocs.com.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox