Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I'm following the LFS book version 8.2 and I am confused about the way that glibc is built and installed.
Why is glibc re-compiled and installed in chapter 6.9? Isn't it already cross-compiled by the GCC and Binutils built in Pass 1 (chapter 5)?
Thanks!
All packages in ch5 were built into a temp toolcahain "dir /tools" this will be discared so now ch6 builds the actual system to the LFS partition, The toolchain is built so we can build the proper system without Touching the host system.
Indeed Chapter 5 is to make a building independent of host. If you copy version-check.sh to the $LFS/sources you can see how and when parts are taken over from host by running it with
Code:
bash version-check.sh
after every little step you make in chapter 5.
Chapter 6 is the actual build of LFS as said by spiky0011
Last edited by RoLoR; 06-22-2018 at 09:59 AM.
Reason: Typo
Ahh, I see, so all the tools built in chapter 5 are for constructing a temporary & host-independent toolchain that can be used to build other packages in ch6.
But still I find the "Toolchain Technical Notes" section in ch5 quite confusing. At which point does the tools compiled become host-independent? If I use my host compiler to compile a new gcc & bintuils package, and then use the new tools to compile glibc, how is the glibc built here host-independent?
Sorry if this is a silly question; I am quite inexperienced in complicated compiling tasks.
BTW are there any good tutorials/guides on compiling software?
In ch6 chroot your path changes and puts tools last in where it looks "/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin".
Also if you look at where stuff is being installed to, ch5 prefix=/tools, now in ch6 prefix=/usr, then in ch-6.10 things get moved and linked. So then you start by looking at dirs on the partition.
Compiling software is prety much like what you are doing now, yes there are otherways which you will come across later in LFS and then more so in BLFS. If and when you go outside the book, packages have README and INSTALL files in them that you can read.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.