cross-compiling LFS

James Iwanek chthon at
Sun Mar 2 18:35:28 PST 2003

Adam Trilling wrote:

> 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.

is there a binary package for openbsd?

> 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.

which i believe is part of gcc....

> 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.

AFAIK whether or not pure_lfs can crosscompile has nothing todo with the
purity of the finished system (perhaps im missing your point though)

> 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.

just find a binary version of gcc for your system and then you can make a
native glibc and then a native gcc (no point reinventing the wheel)

> So does anyone have any better ideas?

greg please speak up now ;-)

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

its no more off-topic than any other thread so-far ;-)

i suspect you should have posted to though....

> 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