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]

Re: Trouble with gcc -B option


On Sun, Sep 16, 2012 at 11:55 AM, Feuerbacher, Alan
<AFeuerbacher@allegromicro.com> wrote:
>> Normally if you configure GCC and the binutils with the exact same
>> prefix, and install both, then GCC will use the ld  built by the
>> binutils.
>
> This seems to be not the case for me. Any idea why?

No.  If you run "gcc -print-search-dirs" it will print the directories
it searches for programs.  One of those directories ought to contain a
binary named "ld" installed by the GNU binutils.

>> >   /home/afbacher/LFS71/lfs84/usr/bin/gcc dummy.c
>> > -B/home/afbacher/LFS71/lfs84/usr/ -v -Wl,--verbose >| dummy.log 2>&1
>>
>> The -B option has to name the directory where ld is found.  In this
>> case it seems that that should be /home/afbacher/LFS71/lfs84/usr/bin/
>> , which is not what you show here.
>
> This worked for my simple test case (thanks!), but not for my main application.
>
> But now I'm really confused. The gcc manual says:
>
> #######
> This option specifies where to find the executables, libraries, include files, and data files of the compiler itself.
>
> The compiler driver program runs one or more of the subprograms cpp, cc1, as and ld. It tries prefix as a prefix for each program it tries to run, both with and without `machine/version/' (see Target Options).
> #######
>
> The executable, library, include and data files are in ..../bin, ..../lib, ..../include and so forth. How does specifying ..../usr/bin allow gcc to find the stuff in lib, include and so forth?

The lib, include, etc., directories are compiled into GCC as offsets
from the bin directory, using appropriate numbers of ../.. in the path
name.

Ian


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