LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Toolchain (https://www.linuxquestions.org/questions/linux-from-scratch-13/toolchain-4175456477/)

c129084 04-02-2013 03:52 AM

Toolchain
 
Working trough the LFS guide I had a question about the toolchain.

I've already read this thread:
http://www.linuxquestions.org/questi...lchain-520503/

Why do I need a new, 'clean' toolchain to build a new linux system. Why can't I just compile (for instance) kernel and busybox and then boot it up?

After it has been compiled (and necessary libraries are present) it should work, right?

pan64 04-02-2013 04:05 AM

I assume the tools are not perfect. They may fail in case of some strange "circumstances", so if the production environment contained some aliens. You can never guarantee all the tools work in all cases. The most secure solution whould be to use a new, fresh, clean and unused environment.
Remember, you will have no chance to recover such errors in a running system.

c129084 04-02-2013 04:35 AM

Quote:

Originally Posted by pan64 (Post 4923329)
They may fail in case of some strange "circumstances".

Is there a high risk of this happening (assuming I'm going to compile this on my relatively normal workstation)? Or is this a "well, in the 0.02% chance something might be wrong, better build a clean toolchain"

Keith Hedger 04-02-2013 08:01 AM

The idea of building the toolchain is to stop cross contamination from the host system, ie you don't want programs linked to library's that are on the host that may not be on the destination system, and don't forget that some libs are linked to other libs and so on, compiling the toolcain is fairly painless IF YOU STICK TO THE BOOK, at least for the first few times, once you have a built and working toolchain you can always save it for future use so you don't have to rebuild from scratch every time, although for your first couple of builds I would build the toolchain from scratch every time as its good practice.

c129084 04-02-2013 08:19 AM

Quote:

Originally Posted by Keith Hedger (Post 4923448)
The idea of building the toolchain is to stop cross contamination from the host system, ie you don't want programs linked to library's that are on the host that may not be on the destination system, and don't forget that some libs are linked to other libs and so on.

Then again, does this happen fast/often, is this a high risk?

Quote:

Originally Posted by Keith Hedger (Post 4923448)
compiling the toolcain is fairly painless IF YOU STICK TO THE BOOK, at least for the first few times

It wasn't very difficult (when following the book), but how could a sane person know all the little tweaks and adjustments that (need to) happen here and there??? :scratch:

Quote:

Originally Posted by Keith Hedger (Post 4923448)
once you have a built and working toolchain you can always save it for future use so you don't have to rebuild from scratch every time, although for your first couple of builds I would build the toolchain from scratch every time as its good practice.

Very good advise :p, I will definitely follow it.

Keith Hedger 04-02-2013 08:30 AM

Quote:

Originally Posted by c129084 (Post 4923464)
...Then again, does this happen fast/often, is this a high risk?...

Yes just do ldd on random system libs/apps to see how many libs they are linked against.

Quote:

Originally Posted by c129084 (Post 4923464)
...It wasn't very difficult (when following the book), but how could a sane person know all the little tweaks and adjustments that (need to) happen here and there???...

Experience and ask on this forum if you get stuck, also the book does ( mostly ) explain why certain otions/patches are used.


All times are GMT -5. The time now is 04:32 PM.