On 08/23/2011 01:03 AM, DJ Lucas wrote:
> On 08/22/2011 04:58 PM, scrat wrote:
>> I am having some issues with building GCC-4.5.2 - Pass 2.
>> I am using Arch linux i686 for the host system and building for i686.
>>
>> When I use the following from the book
>>
>>        CC="$LFS_TGT-gcc -B/tools/lib/" \
>>        AR=$LFS_TGT-ar \
>>        RANLIB=$LFS_TGT-ranlib \
>>        ../$pkgname-$pkgver/configure \
>>        --with-local-prefix=/tools \
>>        --enable-clocale=gnu \
>>        --enable-shared \
>>        --enable-threads=posix \
>>        --enable-__cxa_atexit \
>>        --enable-languages=c,c++ \
>>        --disable-libstdcxx-pch \
>>        --disable-multilib \
>>        --disable-bootstrap \
>>        --disable-libgomp \
>>        --with-gmp-include=$(pwd)/gmp \
>>        --with-gmp-lib=$(pwd)/gmp/.libs \
>>        --without-ppl \
>>        --without-cloog
>>        make -j3
>>
>> I get the following result:
>>
>> /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.5.2/../../../../i686-lfs-linux-gnu/bin/ld:
>> cannot find crti.o: No such file or directory
>> /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.5.2/../../../../i686-lfs-linux-gnu/bin/ld:
>> cannot find -lc
>> /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.5.2/../../../../i686-lfs-linux-gnu/bin/ld:
>> cannot find crtn.o: No such file or directory
>> collect2: ld returned 1 exit status
>> make[3]: *** [libgcc_s.so] Error 1
>> make[3]: Leaving directory
>> `/mnt/lfs/build/tools/gcc-pass-2/gcc-build/i686-pc-linux-gnu/libgcc'
>> make[2]: *** [all-target-libgcc] Error 2
>> make[2]: Leaving directory `/mnt/lfs/build/tools/gcc-pass-2/gcc-build'
>> make[1]: *** [all] Error 2
>> make[1]: Leaving directory `/mnt/lfs/build/tools/gcc-pass-2/gcc-build'
>>
>> crti.o and crtn.o are in the proper place /tools/lib as per ls
>> /tools/lib and yep they are there.
> It seems you have already found the problem....
>
>> I did some looking around and and I see that     CC="$LFS_TGT-gcc
>> -B/tools/lib/" \ should have resulted in those libs being found.
>>
>> When I add  --prefix=/tools \ to the above at the configure step and gcc
>> complied and linked successfully ( as much as I can tell ) .
>> All the chapers leading up to this point are good...I get the result
>> that the book says I should...again as far as I can tell.
> Your command above is not consistent with the book. You were supposed to
> add --prefix=/tools to the configure command if following the book.

Oh i see that now, I cut and pasted the configure line from the html 
version of the book but I must have missed it some how.

>
>> What is the  --with-local-prefix=/tools \ really do, I haven't come to
>> grips with that yet/
> That removes /usr/local/include form the search path.

Ok I can see that as necessary

>
>> I do know what --prefix=/tools is about
>>
>> I am good to go with gcc or did I make a mess?
> Unless you are doing something that is not consistent with the book, for
> whatever reason, you are good.

The only thing I have done is to cut and paste the book contents to a 
bash script file and I build into a different directory that the book 
uses ie I build not in sources but a subdirectory for each step in the 
book.  Then I added a Makefile so if I screw up I only have to fixup my 
screwup , remove everything in the /tools directory and run make again. 
I have also logged then entire process so I can look for problems.


Thanks

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to