I am trying to follow the LFS book, and couldn't get my mind around this question: we built the GCC compiler in chapter 5 in the target partition, why do we do that again after entering the chroot mode? what's the point, why not use the previous build. Same thing for the GlibC.
Why install gcc again in chapter 6 linux from scratch
linux;gcc;lfs
I believe that the build in the chroot would check to see that all of the ancillary files and programs to build GCC and GlibC are present, and independent of the build system. Compiling a compiler isn't simple at all, usually. I believe that GCC will require bison and flex and all kinds of header files, config files and who knows what else. The chroot build is just an intermediate step between the build system (which is not LFS) and the final LFS installation, which is supposed to be self-hosting.Because the run-time environment of GCC is complicated (PATH, LD_LIBRARY_PATH and other configuration items) it's also possible that some side effects will leak through from the initial GCC compiler. I cannot find the paper, but I recall that it can take as many as 5 generations of compiling a compiler with the previously-compiled generation to get all the weird bugs and dependencies to surface.