nholland at tisys.org nholland at tisys.org
Wed Nov 27 11:21:15 PST 2002

Hallo everybody,

there are a few things that I'm not entirely sure about, so I thought I'd
post a short question here.

Well, imagine I want to build a LFS system that will run on a wide range of
machines, let's say from genuine Pentium machines to everything up to AMD
Athlons. Let's furthermore asume that the machine I use for building the
stuff is an AMD Athlon box. Now, I basically wonder what that would mean
for the build process.

Look at GCC for example. When I run the ./configure script, it will detect
three things automatically: --build, --host and --target. These will be set
to the value corresponding to the machine I am building on (in case of an
Athlon, this would be i686-pc-linux-gnu). While --build and --target are of
lesser interest here, I wonder if --host=i686-pc-linux-gnu actually means
that GCC would be optimized for running on i686 class machines, which would
mean that I could probably not simply put it on a i586 machine later on.
*Or* does the --build variable not really have any influence on that, so
that I could simply let GCC's configure auto-detect everything as
i686-pc-linux-gnu and then still let it run on an i586 machine later?

While we're at it, there's another thing: I can, if I wanted to, set my
CFLAGS to something like "-O2 -march=k6", which would, to my understanding,
produce code optimized for AMD K6 machines. The question is: Does GCC
always produce i386 code by default unless I set something else, or is it
probably so that a GCC that has been build with configure
--host=i686-pc-linux-gnu would produce i686 optimized code unless
instructed otherwise?

These two rather long questions can probably be summed up like this: If I
build a LFS system on an Athlon box and never manually specify anything for
--build, nor manually set -march, what kind of code do I get? i386
optimized code, which would work fine on other machines, or i686 code, which
would only run on my build machine (or other i686-class machines)?

I've been wondering about this quite a bit lately and have not yet been
able to find anything that clarifies this properly for me, so I hope that
someone can give me some short information ;-)


Nils Holland <nholland at tisys.org> 
*Ti Systems - Linux in Tiddische, Germany - Since 1996*
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message

More information about the lfs-support mailing list