Fedora and Cross Compiling
jsacco at gnome.org
Sat Jun 9 11:22:41 UTC 2007
On Sat, 2007-06-09 at 09:20 +0100, David Woodhouse wrote:
> On Fri, 2007-06-08 at 13:56 -0600, Brendan Conoboy wrote:
> > Building a cross binutils requires kernel headers for the target
> > architecture. Building gcc requires kernel headers and glibc. There
> > are scripts to solve the initial chicken/egg problem of where to get
> > that glibc for a new arch. At some point in the future gcc might not
> > require glibc to build, but we aren't there yet.
> Before we get to actually cross-compiling something for release, it
> would be good to get cross-compilers into Fedora.
> Making a cross-binutils package isn't hard; it's a relatively
> modification to our existing binutils package to make it build for
> multiple %targets.
> Making a cross-gcc package which targets linux-elf is harder, because of
> the evil recursive dependencies to which you refer above. It would be
> good if we could get that working though.
> Unfortunately the scripts to which you refer just 'solve' the problem by
> throwing everything together into one huge lump and building gcc, then
> glibc, then rebuilding gcc again. That's not really very useful for us
> when we want the compiler and glibc to be entirely separate packages --
> and in fact glibc would be a .$TARGET.rpm to be installed into the
> sysroot, while the compiler is a native package.
> I haven't looked at this for a while, but IIRC we can build gcc and
> libgcc.a directly, using 'only' header files which can be provided in
> advance. The problem is that we have to dynamically link libgcc.so with
> libc.so? We don't actually need a _real_ libc.so for that though, do we?
> We could just make a dummy DSO with the functions we want, and link
> against that? If we do that, what else still has recursive dependencies?
[bottom post :-)]
Building cross toolchains is a common exercise in the embedded systems
world. Take a look at Dan Kegel's "crosstools"
which is RPM based and extensible. crosstools "auto-magically" handles
the recursive dependency problems that you mention
If you are seeking an entire cross tool chain development environment,
take a look at two open source offerings from the embedded systems
* Embedded Linux Development Kit
* Linux Target Image Builder
Both are RPM based and extensible.
jsacco [at] gnome [dot] org
More information about the fedora-devel-list