An idea: isolate libs [was: Pure LFS]

Jack Brown jbrown at kmts.ca
Sun Feb 9 14:37:09 PST 2003


>> Agreed. But we have to draw the line somewhere. It would be fairly easy
>> to get into an infinite loop rebuilding the Ch 5 toolchain over and
>> over and over and... :-)
>> 
> Agreed, that's why I'm proposing a full 3 pass build of binutils, gcc
> and glibc before building chapter 5.  I have currently done this (to the
> start of chapter 5) following exactly the procedure outlined in my
> purity document.

Ok here's how I see it.

Yes, we do have to draw the line somewhere.

Yes, 3 passes is where that line should be drawn.

My own informal tests show that a 3rd pass produces differences from
stage2 to stage3, but that that after that the changes stop.  When I say
informal I mean it all I did at this point was to compare the size of a
tarball of the whole "stage". like I said stage2 tarbal has a different
file size than the stage3 tarball. stage4 tarball has the same size as a
stage3 tarball..

one thing though is that I am not building gcc, glibc and binutils
before going on to chapter 6. (I'm also not using Greg and Ryans new
stage1).  What I do is build the packages from chapter 5 statically but
place the binaries in the normal locations.

ie. for stage 1 gawk:
LDFLAGS=-static ./configure --disable-nls --prefix=/usr
make
make DESTDIR=/lfs install

then I chroot into stage1 and perform chapter6 up to the end of glibc
installing into the current system (stage1)

This would be end end of "my" version of stage1.

at this point I then start installing all the packages I just installed
(ie chapter5 packages + headers and glibc) dynamically using DESTDIR
(mostly, a couple packages need "make prefix=/lfs/usr install" and glibc
uses it's own thing "make install_root=/lfs install".

so for stage2 gawk:
./configure --prefix=/usr
make
make DESTDIR=/lfs install

then I chroot into stage2 and do the _exact_ same thing over again.

so again for gawk:
./configure --prefix=/usr
make
make DESTDIR=/lfs install

Then once I have reached this point I chroot into the final version of my
"toolchain" (glibc, gcc, binutils and compilation support programs like
make, etc) and I start building the rest of what I need to boot the system
up normally

ie for sysvinit:
make -C src
make -C src install

I like the fact that this produces a 100% self hosted toolchain. all
"dynamicly linked and installed into their final location packages which
were compiled by the sameversion of them selves" are compiled by
"dynamicly linked and installed into their final location packages which
were compiled by the sameversion of them selves"

I can't really see where this would have any pitfalls, with the one
possible exception of the kernel ABI inported into the chrot environment
by the host system. but even that is easialy remidied by booting into the
complete system and then running _just_ stage3 over again (also usefull
if you just want to compile copies of the system.)

Jack Brown
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list