in LFS book I see no specific mention of creating a cross-platformLFS system

John Gay johngay at eircom.net
Thu Jan 15 07:31:42 PST 2004


On Wed 14 Jan 2004 16:09, Meher Khiari wrote:
> > Hi;
> >
> >   I've searched through and browsed (not read every page) of
> > the LFS on-line
> > book.  I see no specific mention of how LFS could be used to create a
> > cross-platform system although I see on the LFS website that
> > there are
> > several people who use LFS to create a cross-platform embedded Linux
> > environment. I would like to consider using the LFS approach
> > in creating an
> > embedded Linux target environment for the arm platform using
> > a pc linux host.
> >
> >   Please point me to places in the LFS book were this is
> > mentioned since I
> > must have missed it.  If this does not exist, I am pleading
> > for somebody to
> > create a document explaining how to use LFS to create an embedded
> > cross-platform Linux environment.
> >
Ken, 

The LFS book is targeted mainly, though not exclusively, at building a Linux 
system from scratch on an x86 platform. This helps keep it within a 
reasonable size. Your plan is beyond the limits of the book, so you need to 
look beyond just the book. The hints pages and these forums are a good place 
to start.

> >   I suppose that I could read between the lines and guess
> > what I need to do by
> > looking at other open source cross-platform embedded Linux
> > procedures (which
> > I have looked at, don't understand and have failed at implementing)...
>

Having looked, and failed is the right time to ask for such help. Yes, you 
could read between the lines and apply other projects to what you are doing, 
but from your comments, this seems a bit beyond your capability. But you have 
shown that you've put in a bit of time and effort to answer your own 
questions.

> In the LFS hints there is one which adapts to cross-compiling between x86
> platforms so it don't apply for your case (and that's what all people think
> when saying cross compiling).

Meher, this is what some people think of when they say cross-compiling, 
including many on this list, but not all. Let's not generalise. 
Cross-compiling can have many different meaning.

many on this list want to install a Linux system on older hardware but don't 
want to wait for the old hardware to compile it, so they use a faster system 
to compile to an older target, using the cross-compiling hint you mention.

I also know that there are people on this and other LFS lists who run non-x86 
hardware, and even some who've played with installing LFS onto various PDA's, 
which sounds very similar to what Ken is asking. I also know that I once 
raised this same issue quite some time ago, and was given a pointer to a 
personal web page that included considerable details for exactly this type of 
cross-compiling; from one arch to a different arch. Unfortunately, I no 
longer have access to those mails, and this list was changed since, so I 
don't know if my mail is still available.

Finally, there is a third type of cross-compiling that many don't even think 
about. GCC, et-all, being such general purpose tools, can use libraries for 
any arch, or even O/S when creaating binaries, so it is possible to 
cross-compile from a Linux box to produce a binary that will run on a 
different O/S like WindowsXP, Solaris, UNIX or Mac. I know that I once 
compiled a simple OpenGL program on my Linux box into a Win32 binary that ran 
perfectly on a Windows98 box

> So you can't compile the LFS in an x86 system because while compiling the
> toolchain, the book uses the binaries compiled for that architecture and
> will not, then, function !!

If the book is blindly followed. but there are ways around this. I know there 
are people on this and the chat list with experience, and even some with 
patches, scripts and helpful info.

The GCC home page contains some good info regarding most types of 
cross-compiling. There is also the UcLinux and UcSimm project that is 
specifically aimed at embedded platform cross-compiling. Also, check other 
embedded system sites, as most use Linux and provide good info.

Finally, keep the rest of us up-to-date with the info, as many here can 
benefit from what is found and offer help along the way.

Cheers,

	John Gay



More information about the lfs-support mailing list