Am Freitag, den 01.05.2020, 15:53 +0200 schrieb Pierre Labastie via lfs-dev: > Hi, > > I propose a new way to build LFS, which removes the need for the /tools > symlink, and decreases the number of tweaks needed when building gcc. > > The current build builds a cross-compiler in pass1, and uses it as a > native compiler in pass2. This needs to use a non standard directory > (/tools) to host the toolchain and insulate it from the build machine. > > The modified build uses the cross compiler to cross compile packages > that need themselves to be rebuilt, thus insulating them automatically > from the host, without the need for a non standard directory layout. > Chroot is entered as soon as possible, and the remaining chapter 5 > packages are built in chroot.
Wow, quite interesting! I'd vote to have a deeper look to that mechanism. > This is WIP: the text must be improved at several places, bison and > flex may be moved to after chroot (to be tested). But the commands seem > to produce an acceptable system, with almost clean ICA. > > You can view it at [1], only for sys V since I have not tested systemd > yet (I do not expect many changes). > > There are pros and cons compared to the current method: > > pros: no /tools symlink, no need to tweak gcc sources, no need to > build twice ld in binutils-pass2, no need to readjust the toolchain > after chapter 6 glibc, no need to tweak the gcc specs, no need to > reinstall kernel headers in chapter 6. The less we have to tweak core packages (and gcc is for sure one of them), the better. I would see that as a great benefit. > > cons: chroot is entered in the middle of chapter 5 (maybe chapter 5 > should be split), the debug sections of several packages reference > x86_64-lfs-linux-gnu instead of x86_64-pc-linux-gnu, binutils-pass2 > needs "enable-shared". Ok, here is the "traditional" separation of Chapter 5 (as run with host tools) and the Chapter 6 (running previously built tools in chroot) in danger. But at the end, its just a naming issue. With your method we have kinda Chapter 5a building core tools, a Chapter 5b building toolchain for full build using 5a in chroot and finally the well-known Chapter 6. For the cost of entering the chroot in the middle of chap5, we got rid of the adjusting which sometimes causes trouble for newbies. This knot is simply untied. > Another pro, not tried, is that some simple packages built in chapter 5 > may be built only once if testing them is not required. > > Comments and suggestions for improvement (there's a lot of room for > improvement) welcome. Its great! I'd see that as a big evolution step in the LFS ecosystem. I see a restart to continue not more complicated as it is now. When continuing an interrupted build in chap5 now, user has also to prepare the environment carefully. Same in new chapter 5a so no change here. Continuing in chap 5b, only need to reenter the chroot, this not any different to want currently has to be done while it comes a few steps earlier. Maybe the new Chapter 5 should end with leaving the chroot environment with unmounting the virtFS. It could be a proper end to chap5 as at this stage, a backup of the system might be recommended (as a hint for the user). The new chapter 6 should then reenter the chroot env again. IMHO this would make the differentiation of chap5 and 6 a bit easier. -- Thomas > > Regards > Pierre > > > [1] http://www.linuxfromscratch.org/~pierre/lfs-modified/index.html > -- http://lists.linuxfromscratch.org/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
