LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 06-21-2018, 03:38 PM   #1
Unturned3
Member
 
Registered: Jan 2018
Posts: 39

Rep: Reputation: Disabled
Why is glibc built again in chapter 6.9?


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!
 
Old 06-22-2018, 02:44 AM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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.
 
Old 06-22-2018, 09:58 AM   #3
RoLoR
Member
 
Registered: Feb 2018
Posts: 60

Rep: Reputation: Disabled
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
 
Old 06-22-2018, 12:07 PM   #4
Unturned3
Member
 
Registered: Jan 2018
Posts: 39

Original Poster
Rep: Reputation: Disabled
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?

Thanks a lot!
 
Old 06-22-2018, 12:55 PM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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.

Last edited by spiky0011; 06-22-2018 at 12:59 PM.
 
  


Reply

Tags
compile, glibc, lfs



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Glibc-2.23 (chapter 6.9) zoelee4 Linux From Scratch 40 09-28-2018 12:28 PM
Chapter 5 glibc configure: as and ld too old? Linux_ftw Linux From Scratch 2 12-10-2009 05:16 AM
glibc in chapter 6: not use locales? davemar Linux From Scratch 5 04-20-2004 05:15 AM
glibc problem in chapter 6 alaios Linux From Scratch 5 04-04-2004 04:27 AM
Chapter 6 glibc-2.3.1 install gabebster Linux From Scratch 14 09-24-2003 10:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 06:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration