public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Question about include path
@ 2011-02-01 10:13 yann
  2011-02-01 19:47 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: yann @ 2011-02-01 10:13 UTC (permalink / raw)
  To: gcc-help

Hi,

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 ?

Thank you.

Yann Le Doaré

***************************************

my test.c :

#include "limits.h"

int main()
{
}

*******************************************************************
strace -f -e open -o logs gcc -I/LFS2011/include test.c
bash-3.2# grep limits.h logs
5469  open("limits.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or 
directory)
5469  
open("/LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include/limits.h", 
O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
5469  
open("/LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include-fixed/limits.h", 
O_RDONLY|O_NOCTTY) = 4

*****************************************************

strace -f -e open -o logs gcc -I/tmp test.c

grep limits.h logs
5460  open("limits.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or 
directory)
5460  open("/tmp/limits.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such 
file or directory)
5460  
open("/LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include/limits.h", 
O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
5460  
open("/LFS2011/bin/../lib/gcc/i586-pc-linux/4.5.2/include-fixed/limits.h", 
O_RDONLY|O_NOCTTY) = 4

*******************************************************

The options to build gcc (from LFS script) :

*********************************************
    --prefix=/LFS2011 \
    --with-local-prefix=/LFS2011 --enable-clocale=gnu \
    --enable-shared --enable-threads=posix \
    --enable-__cxa_atexit --enable-languages=c,c++ \
    --disable-libstdcxx-pch --disable-multilib \
    --disable-bootstrap --disable-libgomp \
    --with-gmp=/LFS2011 --with-mpfr=/LFS2011 --with-mpc=/LFS2011 \
    --without-ppl --without-cloog --target=$LFS_TGT --host=$LFS_TGT 
--build=$LFS_TGT

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-04  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 10:13 Question about include path yann
2011-02-01 19:47 ` Ian Lance Taylor
2011-02-03 14:31   ` yann
2011-02-03 18:23     ` Jonathan Wakely
2011-02-04 10:47       ` yann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).