This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc 4.1.1 --print-search-dirs questions


I'm working a Linux From Scratch build following directions on the 
www.linuxfromscratch.org website.  I'm using gcc 4.1.1.  
gcc gets built several times (per the website directions).  
For the last pass, it was configured with this command:

configure --prefix=/usr --libexecdir=/usr/lib --enable-shared \
	    --enable-threads=posix --enable-__cxa_atexit \
	    --enable-clocale=gnu --enable-languages=c,c++

As I built up more and more packages using my newly compiled gcc 4.1.1,
I started get warnings from "libtool" saying it looked like libraries had moved.

I tracked it down to this:

If I run 

    gcc --print-search-dirs | grep libraries

I get this output:

libraries: =/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/:/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/:/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/4.1.1/:/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/lib/:/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../i686-pc-linux-gnu/4.1.1/:/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../:/lib/i686-pc-linux-gnu/4.1.1/:/lib/:/usr/lib/i686-pc-linux-gnu/4.1.1/:/usr/lib/

Note that if the following directory exists (which is does):

    /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../.. 

then it's the same as:
    
    /usr/lib.

What's happening when libtool runs is that it compares the first directory in the
search path  (/usr/lib/gcc/...) with /usr/lib, they are not exactly the same 
(even though the evaluate to the same directory), and a warning results.

Also note that /usr/lib/gcc/i686-pc-linux-gnu/4.1.1 is listed twice at the beginning
of the search path.

Questions:

    How does gcc figure out the library search path (the output of 
    --print-search-dirs)?   Is it compiled into gcc itself, or 
    is there some kind of spec file somewhere that maybe I could edit?

    What if anything can I do to remove the duplicate and reduntant 
    directories in the library search path?     I'm kind of suspicisous
    of the libexecdir= argument on the configure line...

    Or is this just perhaps a problem with libtool not collapsing the 
    directory path to realize the two paths are in fact the same?


Paul
pdnovak@comcast.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]