LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   HLFS or CLFS? (https://www.linuxquestions.org/questions/linux-from-scratch-13/hlfs-or-clfs-4175550327/)

Jerasmussen 08-09-2015 04:35 PM

HLFS or CLFS?
 
Hiya:

Linux from Scratch is a new adventure for me, something to do before the savings run out and I become homeless or, abrupt climate change puts an end to western civilization. You know, whichever comes first.

Anyway, I've been reading through the books while doing practice compilations and one thing has me confused. Can someone please confirm the following?

The HLFS book talks about cross-linking but, this is not the same as the cross compiling described in the CLFS book. Thus, an HLFS build produces a system that runs on the same architecture as the host, regardless of what -march or -mtune flags are given. The only way to build a 32 bit system on a 64 bit host is the method described in the CLFS book.

Do I have that right?

Regards,
James Rasmussen

weibullguy 08-10-2015 01:19 PM

Using the LFS instructions, you can build a pure 32-bit system on a 64-bit (x86_64) machine. Thus, you can build a 32-bit system on a 64-bit host using LFS instructions.

The HLFS instructions are modified version of the LFS instructions to create a hardened system (hence the H). Thus, you can build a 32-bit system on a 64-bit host using HLFS instructions.

If you want a multilib system (32-bit AND 64-bit libraries and apps), you need to use the instructions in CLFS. The CLFS instructions also provide for a pure 32-bit or a pure 64-bit system on a 64-bit host. Thus, you can build a pure 32-bit, pure 64-bit, or multilib system on a 64-bit host using CLFS instructions.

re_nelson 08-10-2015 03:23 PM

Quote:

Originally Posted by Jerasmussen (Post 5403549)
Hiya:
Linux from Scratch is a new adventure for me, something to do before the savings run out and I become homeless or, abrupt climate change puts an end to western civilization. You know, whichever comes first.

Well expressed James and your creative wording brought a smile. As one who's been using an LFS system as my primary working environment for over a dozen years, my suggestion is to stick with a pure LFS/BLFS using the most recent version (not the cutting-edge SVN variety). For your first go-around, avoid the variants such as HLFS, CLFS or any of the others.

And I can't stress the following enough: Follow the book verbatim! Treat it as if it's enscribed on golden plates and handed down from the mountain after being written by a wise oracle. If you have a 64-bit platform, then don't even give a second thought, at this early stage, to a multilib system (with 32-bit apps and libraries). I opted for 32-bit and 64-bit only after several years. Even now, what bits and pieces there are using 32-bits are few and far between.

Believe in the book and follow it all the days of your life! :)

Jerasmussen 08-10-2015 06:32 PM

Thanks Weibullguy and re_nelson;

When "playing around" with HLFS on my 64 bit Debian box, readelf -l a.out | grep ': /tools' always came back with the x86_64 linker and the triplet was always x86_64-lfs-linux-gnu. it didn't seem to mater what I set for -march= or -mtune= and believe me, I tried some crazy stuff just to see what would happen.

The HLFS book also seems to play "fast and loose" with some of the terminology, using cross-linked and cross-compiled in non-specific contexts. I guess that makes sense though, if as you say HLFS is intended for Bodhisattvas.

BTW, the aforementioned Debian box is a xen cloud platform host, so I can spin up different hardware/software profiles in minutes. Quite useful actually: I can create monstrosities that would turn Dr. Frankenstein green with envy, watch them crash into deranged snippets of broken code, and the "real" computer sails on without a hiccup.

Regards,
James Rasmussen


All times are GMT -5. The time now is 05:38 PM.