Maurice Leclaire wrote:
> Hi,
>
> I am new to LFS. During chapter 5 GCC pass 2 I stumbled across the
> following issue:
>
> Building with the instructions from the book just worked, but I thought
> instead of specifying all programs on the command line, configuring
> binutils pass 2 and gcc pass 2 with
>
> --target=$LFS_TGT --host=$LFS_TGT --build=$([...]/config.guess)
>
> could be a good idea as gcc pass 1 is a cross compiler. Indeed, this did
> the expected changes in the Makefile, but ...
> GCC (more precisely libstdc++-v3) failed to compile.

We have just released LFS-7.3 and will wait until gcc-4.8 to address 
building with g++.  At that time, the fixes to the .texi files should 
already be incorporated.

> This shows that libstdc++-v3 needs a C++ compiler, which obviously
> cannot be found in this case. I assume that when using the book
> instructions the C++ compiler of the host system is used, but wouldn't
> that defeat the goal of leaving the host system?
>
> I actually wanted to use these configure switches (maybe this is just
> personal preference) and ensure that no host compiler is used at this
> point. After I already solved this, I found the following thread on a
> related topic.
> http://thread.gmane.org/gmane.linux.lfs.devel/13574
> It explains two possible ways of building GCC with C++. Because both
> methods have a few drawbacks, I thought of posting my solution, too.
>
> This solution involves a bit more compile time, but I think it is a
> fairly clean way of leaving the host system behind.
>
> 1. Binutils pass 1, GCC pass 1, Linux headers and Glibc are built as
>     instructed in the book.
>
> 2. A second cross GCC is built this time with C++ enabled, linking
>     already against the new Glibc.
>
> 3. Binutils and GCC are built both with the --target,--host,--build
>     configure switches (obsoleting the environment variables and
>     --disable-bootstrap).
>
> This worked quite well for me until the end of chapter 6 (all I did up
> to now).
>
> Just wanted to let you know of this possible (probably harmless)
> contamination of the toolchain through the C++ compiler of the host.

Your changes are probably fine as building inside a chroot will isolate 
everything from the host to what is in /tools.

   -- Bruce

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

Reply via email to