From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1498 invoked by alias); 3 Feb 2011 14:31:12 -0000 Received: (qmail 1489 invoked by uid 22791); 3 Feb 2011 14:31:11 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from 25.mail-out.ovh.net (HELO 25.mail-out.ovh.net) (91.121.27.228) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 03 Feb 2011 14:31:06 +0000 Received: (qmail 23040 invoked by uid 503); 3 Feb 2011 14:58:12 -0000 Received: from b9.ovh.net (HELO mail393.ha.ovh.net) (213.186.33.59) by 25.mail-out.ovh.net with SMTP; 3 Feb 2011 14:58:12 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 3 Feb 2011 14:31:03 -0000 Received: from ns0.ovh.net (HELO webmail.ovh.net) (213.186.33.20) by ns0.ovh.net with SMTP; 3 Feb 2011 14:31:03 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: Thu, 03 Feb 2011 14:31:00 -0000 From: To: Ian Lance Taylor Cc: Subject: Re: Question about include path In-Reply-To: References: <7b2b2ac3c8f9606fc239ba6ffe17c996@localhost> Message-ID: <3069ceb8fa5b805f25ec092921b97c4b@localhost> X-Sender: yann@linuxconsole.org User-Agent: RoundCube Webmail/0.4 X-Ovh-Tracer-Id: 13557805203966848983 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00073.txt.bz2 into gcc/incpath.c : into remove_duplicates : /LFS2011/include is removed because "it is a non-system directory that duplicates a system directory" Then the search order is : /LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include /LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include-fixed /LFS2011/include /usr/include the problem is that a "limits.h" is into /LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include-fixed/ The "-I" option should not overwrite search order (and put /LFS2011/include as first directory) ? Thanks very much Yann Le Doaré. On Tue, 01 Feb 2011 11:47:01 -0800, Ian Lance Taylor wrote: > writes: > >> I build gcc (4.5.2) from scratch, and i have a question with include >> path. >> >> when i want to include "limits.h" (the good one is at >> /LFS2011/include/limits.h), gcc uses >> /LFS2011/bin/../lib/gcc/i686-pc-linux-gnu/4.5.1/include-fixed/limits.h >> >> When i add "-I/LFS2011/include" it does not look for >> /LFS2011/include/limits.h (bad ?) but when I add "-I/tmp", it looks >> for /tmp/limits.h (good) >> >> What is wrong, where can i look into gcc source code to debug it ? > > The code in question is in the libcpp directory and in gcc/cppdefault.c. > However, this seems like an unlikely scenario. Are you sure that the > directory /LFS2011/include exists? Also, use the -v option to see the > exact search path that gcc will use. > > Ian