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 Mon, Sep 17, 2012 at 8:41 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.
>
> In the "programs:" list, the path to ld is not listed. It should be something like:
>
> ..../usr/bin/ld
>
> All of the entries are something like this:
>
> ..../usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1

The GNU binutils should install a program named "ld" in a directory
that looks something like PREFIX/TARGET/bin, in addition to the one
installed in PREFIX/bin.  GCC should look in PREFIX/TARGET/bin.


>> > 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.
>
> Ok, that makes sense. But to me, the manual description is quite misleading because it gives no obvious indication that something like this is going on.
>
> Am I missing something obvious, or is this such common knowledge in the user community that it doesn't seem necessary to state? Or should the manual be revised to include what you've told me? If so, how might that be done?

When I look at the docs for -B it appears accurate to me.  I think you
are saying that you found it confusing because you didn't understand
how it worked.  But the fact remains that, as far as I can see, it
does work as the manual describes.  We could extend the manual to
explain how it works, but I suspect that for most users that would be
more confusing than helpful.  Still, better documentation is always
good, so if you have a concrete suggestion that would be great.

Ian


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