Re: [PATCH] cross-compilation for binutils.

From: Enrico Scholz <enrico scholz informatik tu-chemnitz de>

To: fedora-devel-list redhat com

Subject: Re: [PATCH] cross-compilation for binutils.

Date: Wed, 23 Jul 2008 22:10:28 +0200

David Woodhouse <dwmw2 infradead org> writes:
> But it would be nice if we could have a 'clean' dependency chain along
> the lines of:
>
> cross-gcc --> cross-glibc --> cross-libgcc.so
Not easy with current rpm:
* assuming 'rpm' can extract PROVIDES/NEEDED out of cross built binaries,
you will run into the problem that there are cross and native packages
which are both providing the same 'libc.so.6'. When another native
package requires 'libc.so.6', the cross package might get installed.
RPM would have to annotate these provides/requires.
I hacked around it by disabling automatic dependencies (--> no
--file-requires anymore :( ) and using custom find-provides/requires
scripts. It's very hacky but surprisingly it works since FC-5 till
F-9...
* you have to package cross-glibc as 'noarch' or as the native arch; it
won't be possible to install a package of target arch (at least not
without --ignore-arch).
* 'BuildArch: noarch' does not create -debuginfo packages and that's
very hardcoded into the rpm macros :(
* some post-install scripts (...strip, ...debuginfo) use native binutils
which fail on cross-built binaries. This is easy to workaround as
recent rpm (FC-6+) allows to customize the %__strip and %__objdump
tools
When your ambitions stop at cross-libgcc, you can set manual 'Provides:'
and 'Requires:'. Providing complete cross environments (e.g. for ARM where
you can not/do not want built natively due to hardware restrictions), needs
changes to rpm or lots of %macros.
Enrico