Crosscompiling: getting rid of compiler prefix

Ken Moffat ken at
Fri Jul 16 01:40:06 PDT 2004

On Fri, 16 Jul 2004, H. Wiese wrote:

> Hello,
> I just built up an LFS using a crosscompiling documentation that told me to
> add --host="i586-pc-linux-gnu" and --target="i586-pc-linux-gnu" to almost
> every configure I had to run during LFS built. Nearly everything worked fine
> but I got some tools compiled which got a prefix added to its names. Looks
> like this now (ie. modutils):
> i586-pc-linux-gnu-modprobe
> i586-pc-linux-gnu-depmod
> i586-pc-linux-gnu-lsmod
> i586-pc-linux-gnu-rmmod
> and so on. Now how do I get rid of those prefixes while compiling or
> installing? I hope I won't have to install them manually by establishing
> links to all those files or something...
> Thanx in advance...
> Hendrik

 Cross compiling builds tools which execute on one host (the host)
against code for a different machine (the target).  For example, in
~/ppc-tools/ I have a the binaries from binutils and gcc, all prefixed
powerpc-linux- so that I can cross-compile a ppc kernel on i686.  The
configure magic makes it look for $TARGET-{gcc,ar,ld} to use in the
compile, instead of the host's {gcc,ar,ld}.

 My understanding is that you have to then use those tools to build
native tools for the target (I was lucky, I only need the
cross-compiler, the target is already running linux). If that is what
you have already done, and if the documentation was correct and up to
date, then I *guess* you do have to rename them all.  You might want to
check some more documentation, e.g. the hint on building LFS from OSX,
and Ryan's cross-compile scripts.

 However, i586 is an unusual target, many of them are perfectly capable
of building LFS, albeit slowly.  This makes me wonder if you are
compiling on i686 ?  If so, the easier way is to look for the 'uname
hack', there is, or used to be, a hint about building for a lesser x86
processor.  Basically, you wrap uname in a script so that it tricks
callers into believing the the current host is an i586 (or i486, i386) -
you have to do this at the beginning, and again after a real uname is
installed (coreutils, chapters 5 and 6).


 das eine Mal als Tragödie, das andere Mal als Farce

More information about the lfs-support mailing list