building x86_64 using lsflivecd-86_64

Aleksandar Kuktin akuktin at gmail.com
Sat Nov 14 13:54:49 PST 2009


First off, I understand that in newer versions of LFS book, the build
process changed, so that GCC and binutils are built together. I still
use the old method, in which binutils and GCC are build separately.
This is reflected in this e-mail, so don't let that confuse you.

>On Sat, 14 Nov 2009 09:56:44 -0800 (PST)
>Lapohos Tibor <tibor.lapohos at rogers.com> wrote:
> 
> Hello All,
>  
> I the the 6.4 book thourgh, and it worked out very nicely. Now I need
> a 64 bit version. I am aware that the support for 64 bit systems is
> only about to come in a future release of LFS, but I would like to
> give it a shot somehow, since that is what I need. In order to do
> this, one needs a 64-bit compiler and kernel, which the
> x86_64 lsflivecd has, at least in my understanding. Having said that,
> I would like to ask a few questions:
> 
> 1) For now, I am booting off the x86_64 lsflivecd, and I am following
> the CLFS way to build a 64-bit multilib system, although
> pure 64 would suffice, and somehow I find it unnatural that one would
> need to cross-compile, while building for the host, on the host
> itself. It just doesn't feel right. Or am I completelly wrong?

This depends on the target capabilities. I have successfully built and
am running/depending on a pure 64-bit system, and in my experience, for
a pure 64-bit, no cross-compilers are necessary (apart from the first,
which catapults your userland & kernel from x86 to x86_64). However,
for a multilib, a 32-bit compiler is a requirement (which should be
logical - you want to be able to build x86 binaries, right?). Thus -
CLFS.

If you opt for a 64-bit only, however, the stock LFS commands should do
the trick (I myself use ones from CLFS-1.0.0-x86_64-64, adapted for my
versions of packages/patches).
However, toolchain commands need to be tweaked, in the following way:
1) --disable-multilib needs to be passed to all binutils and GCCs (ie.
everytime either is configured - first toolchain, second toolchain,
system - it needs to be passed). Otherwise, make tries to build a
cross-compiler.*
2) the "gcc-x.y.z-pure64-1.patch" (for system and first toolchain GCC)
and "gcc-x.y.z-pure64_specs-1.patch" (for second toolchain GCC) from
CLFS need to be applied. Look in them for details on what they do.

[*] Apparently, I have repetadely built my second toolchain binutils
without this switch, so I guess that one doesn't need it.

Additionally, I now see I compiled "system coreutils" with environment
variable CC set to "gcc -m64". But I don't know why I put it there, the
"toolchain coreutils" builds without it.  O_o

> 2) While on the x86_64 lsflivecd platform, by following the LSF 6.5
> instructions one should, more or less, be able to build a 64 bit
> system. A few parameters would need to be modified only, right? For
> example, having --target=x86_64-unknown-linux-gnu among the
> compilation parameters, should on its own invoke 64-bit output
> generation. A few settings could also be borrowed from the CLFS book,
> in order to get 64-bit generation enabled, right? By the way, would
> that not be the default gcc setting on a 64-bit platform? I mean,
> automatically?

I have no experience running or building a multilib system, so I can't
be of much help on that. :(

On a pure-64, you can do almost everything you want (some programs and
packages just can't/won't build - most notably kaffe ).
No special tweaks needed - my system looks exactly as it looked when I
was 32-bit.

> 3) The lsflivecd (x86_64) site mentions an unofficial
> version of the, I suppose, 64-bit version book, that I hope would
> contain some pointers for me to start with, but neither could I find
> it in the mounted CD iso image nor on the webpages. Is such thing
> really available? A pointer to any version or draft would be highly
> appreciated.
> 
> Thank you All in advance,
> Tibor

Hope I was helpful. :)
-Aleksandar Kuktin



More information about the lfs-support mailing list