On 21/07/2017 06:29, Michael Shell wrote:
> [...] 
> And watch out that in GCC pass 2 you started with a fresh unpacking
> of the gcc tarball. (We have to do this, right?) After all, in the
> Libstdc++-7.1.0 a ../libstdc++-v3/configure --disable-libstdcxx-threads
> had been done in the pass 1 tarball's libstdc++-v3 subdirectory. Does
> anyone know if those libstdc++ configure settings will remain or be
> properly overridden if gcc's main directory configure is run - e.g.,
> what if the LFS builder attempts to start gcc pass 2 with the existing
> unpacked gcc tar ball from pass 1?
> 

I'd say it is enough to remove the "build" directory. But if you keep the
"build" directory, i'd say you are calling for trouble.

> 
> A question I now have is: At what point in the build process can
> the LFS system (i.e., gcc) be expected to be able to compile the
> thread.cc test above?
> 
> Is it after GCC-7.1.0 Pass 2, or is it only after the final build
> of GCC?

Good question. I've not tried yet, but I'd say it should be after GCC pass 2.
> 
> If the former is true, then how can GCC-7.1.0 Pass 2 have thread
> support when Glibc-2.25+adc7e06 has not yet been rebuilt (since
> just after Pass 1, and libstdc++ could not be enabled with thread
> support under that glibc)?

The beginning of chapter 1 tries to solve a (double) chicken and egg problem:

We do not want a GCC, which uses the host glibc (because it will not be
available in chroot). So we want to compile glibc in /tools before GCC. But we
want glibc to be compiled with the GCC from the book, not the one from the
host, to be sure to insulate the host from our LFS system... That's the first
chicken and egg.

So, the LFS path is to do the following: GCC pass 1 is compiled using host
tools and libraries. Then glibc using GCC pass 1, then GCC pass2 using the
just built glibc (and pass 1 tools). However, GCC source is written in C++, so
GCC needs libstdc++. But libstdc++ needs glibc. Second chicken and egg...

That's why libstdcc++ compilation for pass1 is deferred to after glibc build.
But note that the just built glibc *has* all the libraries for thread support.
It is only GCC pass1 that does not have the ability to generate code
supporting threads, so that --disable-threads needs to be passed to libstdc++
pass 1.

Now what happens for GCC pass 2? At that stage, libstdc++ and all the other
GCC support libraries are built (they use the just built glibc). The compiler
*code* does not use threads (because it was generated by GCC pass 1, which has
no thread capabilities, but the compiler *can* generate code using threads.

> And if the latter is true, how can the
> final build of glibc be expected to pass make check if doing so
> requires thread support in gcc/libstdc++ ?

I hope it is clear from the above, that the former is true.

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

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to