ld can't find stdc++ right after the re-adjustment phase
Angel Tsankov
fn42551 at fmi.uni-sofia.bg
Mon Feb 2 05:23:47 MST 2009
Matthew Burgess wrote:
> On Mon, 2 Feb 2009 12:54:55 +0200, "Angel Tsankov"
> <fn42551 at fmi.uni-sofia.bg> wrote:
>> I'm building a LFS system with binutils version 2.16 and gcc version
>> 4.2.4 and I've just found out that applying the
>> '/\*startfile_prefix_spec:/{n;s at .*@/usr/lib/ @}' sed script to
>> /tools/lib/gcc/i686-pc-linux-gnu/4.2.4/specs (as per the instruction
>> in the
>> re-adjustment phase, section 6.10) prevents ld from finding the
>> stdc++ library (which is located in "/tools/lib"). As a result, C++
>> programs fail
>> to link when I try to compile them with g++. In contrast, they do
>> link when
>> I compile them with gcc. However, I need to compile them with g++
>> because next I want to install GMP and it checks for a C++ compiler
>> by trying to compile a sample C++ program with g++ rather than with
>> gcc. Thus, GMP fails
>> to configure.
>>
>> I also found that "reverting" the changes from the above-mentioned
>> sed script or substituting "/usr/lib/ /tools/lib/" instead of just
>> "/usr/lib/ "
>> both help. However, none of these steps is in the LFS book and I
>> wonder if
>> I have gone wrong somewhere or I just need a more recent version of
>> binutils
>> or of gcc. Or could it be something else?
>
> It's hard to say, but binutils-2.16 is rather old. Is there a
> particular reason why you're sticking with that particular
> combination of Binutils & GCC?
>
No. It's just an old LFS that I'm trying to upgrade. I should probably try
upgrading Binutils next and see if the problem still exists.
By the way, can anyone tell how ld finds the stdc++ library (which is
located in /tools/lib) right before installing GMP in section 6.12 of LFS
6.4?
--Angel
More information about the lfs-chat
mailing list