On 5/1/20 8:53 AM, Pierre Labastie via lfs-dev wrote:
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.

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.

   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".

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.

Regards
Pierre


[1] http://www.linuxfromscratch.org/~pierre/lfs-modified/index.html

It's an interesting idea, but generally I'm in the "If it's not broke, don't fix it." camp. What we have is a very well tested system. The current way we isolate /tools as user lfs in Chapter 5 and then go into chroot in Chapter 6 seems to encapsulate each chapter well.

There are always multiple ways to accomplish a complex goal like LFS. To me the advantages of the proposal are relatively minor and my initial reaction is to leave things the way they are.

  -- Bruce


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

Reply via email to