Fedora and Cross Compiling

Brendan Conoboy blc at redhat.com
Wed Jun 13 21:46:10 UTC 2007


Ralf Corsepius wrote:
> Nah, wrt. to cross linux toolchains there are other ways.

Well, if you want to be pedantic, sure.  To be more precise, it is, at 
present, the only way to get from nothing but sources to having fully 
functional binaries.  If you already have binaries that's another matter.

> 1. If a native target distro exists, one can repackage the target's
> glibc binaries into a <target>-sys-root rpm, and then build gcc against
> this glibc. It's what I do in my toolchain packages. Some people hate it
> because "I don't build everything from scratch", but it has tremendous
> advantages.

You can, but you end up with binaries for one arch inside an rpm 
designated for another.  I'm hoping to take this to the point where you 
can bring in rpms from one arch to cross build another another.  This 
makes a mismatched target-sys-root rpm very undesirable as it's going in 
the wrong direction.  The target sys-root should be provided by the 
build system for use by the the cross compiler.

> 3. Build incrementally. All you need to is to once insert a glibc
> sys-root binary into the buildsystem (by "bootstrap" or 1. or 2.), then
> subsequently build gcc and glibc from source.
> Some people also hate this, but it's essentally the same approach as
> glibc and gcc are being built on Fedora.

I think of this as The Fedora Way (tm).  After discussing with dwmw2 
some more, there are still some drawbacks wrt gcc for my own goals: We 
actually want to produce gcc support libraries for the target in an rpm 
for the target arch.  If there is indeed a strong resistance to having 
rpm emit multiple arches from a single build, two builds are required 
(One to make the cross compiler, another to make the target libraries 
perhaps in the form a cross compiled cross compiler:-).  Though not 
insurmountable, it does mean duplicate copies of the target libraries- 
one for the host to use, one for the native.

-- 
Brendan Conoboy / Red Hat, Inc. / blc at redhat.com




More information about the fedora-devel-list mailing list