[lfs-support] Bk7.1_Ch6.17 GCC-4.6.2 search order of 'include directories'

Bruce Dubbs bruce.dubbs at gmail.com
Sat Apr 28 15:06:32 PDT 2012


pete Spam-Avoider wrote:
>   Hi, 
> 
>   I'm building stable book 7.1 (Bk-7.1) using a stable 
>   book 6.8 (Bk-6.8) system which meets all the
>   "Host System Requirement" of Bk-7.1.
> 
>   I've followed the book to the letter. All commands have
>   been taken from the text of Bk-7.1 by cutting and pasting text
>   from a lynx browser.
> 
>   So far I've reached Bk-7.1_Ch-6.17, GCC-4.6.2, which has been
>   compiled, tested and installed.  No unexpected failures
>   occurred during 'make -k check'.  I've halted further
>   progress past this chapter to see if I can get some input
>   concerning the difference between the expected output of
>   Bk-7.1_Ch-6.17's command:
> 
>      'grep -B4 '^ /usr/include' dummy.log'
> 
>   and the actual output I received.  A similar problem was
>   described in a post to this list on Jan. 17, 2012 by Ronnie van Aarle
>   with a response each from jasonpsage and emteeoh.
>  
>   The expected output is:
> 
> #include <...> search starts here:
>  /usr/local/include
>  /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include
>  /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include-fixed
>  /usr/include
> 
>   The output from my system is:
> 
> #include <...> search starts here:
>  /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include
>  /usr/local/include
>  /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include-fixed
>  /usr/include
> 
> 
>   My concern is to have the correct 'include directory' search
>   order.
> 
>   All of the other commands in Ch-6.17 for testing the installation of
>   gcc-4.6.2 produced the example outputs as presented in the chapter.
> 
>   Am I looking at an 'include directory' search order problem?

What you have matches what I have.  We haven't looked at that particular section 
is a while and gcc may have changed the order internally.

Generally the order won't matter.  If you have a file do something like:

#include <abc.h>

It will look in the above directories in the order specified and use the first 
one it finds.  The only problem is if there is a name conflict between header 
files in /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include and /usr/local/include. 
In LFS, /usr/local/include is almost always empty.

Looking at /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/include, headers like 
stddef.h are there and you certainly would not want a file in /usr/local/include 
overriding that.

On an older version of gcc, /usr/local/include is first and there is no 
include-fixed directory.

   -- Bruce



More information about the lfs-support mailing list