Cross-compilers.

Ralf Corsepius rc040203 at freenet.de
Mon Sep 18 15:23:11 UTC 2006


On Mon, 2006-09-18 at 09:56 +0100, David Woodhouse wrote:
> On Mon, 2006-09-18 at 10:23 +0200, Ralf Corsepius wrote:

> > > > Few packages do support mixed native/cross compilation and even less do
> > > > support multi-target configurations.
> > > > 
> > > > > Packages in _general_ won't cross-compile.
> > > > Yes, because many packagers don't test it and because rpm doesn't
> > > > support it.
> > > 
> > > I've spent a lot of time attempting to cross-build the distribution.
> > > RPM actually handles it just fine -- the problems were mostly caused by
> > > the (possibly incorrect) use of autotools in the package itself.
> > 
> > Well, this is NOT my experience.
> > 
> > RPM doesn't even get the target/host/build-tuple right for native noarch
> > building.
> 
> You mean in %configure?
Yes.

>  I don't recall it screwing that up, but again I
> haven't tried this recently. If it broke, file a bug. I suspect it's a
> problem with redhat-rpm-config instead of rpm itself.
%configure passes --target=noarch-redhat-linux to configure for noarch
packages - The issue is known to RH developers for quite a while, but
has been ignored so far (I don't know if there is a PR on this.)

> > Building cross-compilers (Note: These are native apps!) is PITA,
> because
> > RPM doesn't handle foreign binaries correctly (stripping, debug info
> > etc. all are treated as <native>-elf).
> 
> I have a vague recollection of overriding %strip. But binutils-multi
> would also help with this.
Nope, it would not help us much.

1. We are using patched binutils and rely upon canonicalized binutils.
Therefore, non-canonicalized tools builts from HJLu's sources or vanilla
FSF sources don't help us much.

2. Cross-built rpms consist of both target and native binaries.
RPM treats all of them as native. We need to patch the scripts to use
the correct search path.

> > Cross building (rpmbuild --target= ...) isn't even close to be be
> > functional, because rpm screws up various target/host/build platforms
> > setting (e.g. %rpmopt), and doesn't properly distinguish between
> > target/host/build and contain many hard-coded redhat specifics (We are
> > cross building cross-toolchain rpms to mingw, cygwin and solaris).
> 
> I haven't looked at cross-building to non-Linux RPMs. I can well believe
> that it's more problematic, but certainly I've had reasonable success
> with cross-building _Linux_ RPMs. As I said, the majority of failures I
> saw were with autotools being used to do the wrong thing.

Probably because you either
* use ancient autotools
* mix up on --host/--build/--target
* are not applying canonicalization
* rely upon config.cache, or worse config.site.
...

>  Not really with RPM itself.
Conversely for me.

Ralf





More information about the fedora-devel-list mailing list