cross-compiling LFS

Adam Trilling agt10 at
Sun Mar 2 18:18:12 PST 2003

As I mentioned on Friday, I attempted to cross-compile an LFS system using
OpenBSD as a host.  I didn't get very far.

The problem is this:  in order to build gcc as a cross-compiler, you need
to have a compiled glibc.  In order to compile glibc on a non-linux host,
you need a cross-compiler.

Attempting to build gcc on a system that does not have glibc will cause
the build to fail because ld can't find crti.o.

Attempting to configure glibc on a system that does not have a gcc capable
of producing *-*-linux-gnu code will also fail.

Of course, using a linux host, we could add an extra stage to pure-lfs
that builds a cross-compiling toolchain rather than just a cross-linking
toolchain.  But this doesn't expand the set of host distros that can
build LFS, and I can't see any reason why it would increase the purity of
the resulting LFS.

The only workaround I can think of is to provide a package with
pre-compiled crt*.o (these are startup files that are linked into every
linux application, or so I gathered from the reading I did).  This seems
like cheating in an LFS context.

So does anyone have any better ideas?

And is this too off-topic for lfs-dev?

Adam Trilling
agt10 at
Unsubscribe: send email to listar at
and put 'unsubscribe lfs-dev' in the subject header of the message

More information about the lfs-dev mailing list