Proposed SIG: Windows MinGW cross-compiler SIG
Richard W.M. Jones
rjones at redhat.com
Fri Jul 11 08:48:13 UTC 2008
On Thu, Jul 10, 2008 at 12:05:02PM +0100, Daniel P. Berrange wrote:
> On Tue, Jul 08, 2008 at 08:32:26PM +0100, Richard W.M. Jones wrote:
> >
> > +%define __os_install_post /usr/lib/rpm/brp-compress %{nil}
> >
> > Using ordinary /usr/bin/strip on MinGW lib*.a files not only doesn't
> > work, but actually corrupts the files. Therefore we must disable
> > stripping. I'd love to know how to force RPM to either ignore files
> > in certain directories, or to call the correct strip binary on them.
> > The original SRPMs that I was working with contained a very long and
> > hairy bit of code which apparently did this, but I wasn't daring
> > enough to include it.
>
> I think that %define will affect the main RPM, as well as mingw
> sub-RPM, so we can't simply set it to %{nil}. Couple of options
> that I see
>
> - Find out what's wrong with strip & fix it
> - Modify the default brp-compress script to avoid mingw files
> - Create a wrapper around default brp-compress script to filer
> mingw files and %define __os_install_post to use that
The original RPMs I'm working with do the latter. Very complicated
but I'll see if it can be simplified somehow :-(
> > +BuildRequires: mingw-gcc
> > +BuildRequires: mingw-binutils
> > +BuildRequires: mingw-libgpg-error
> > +BuildRequires: mingw-libgcrypt
> > +
> > +Requires: mingw-runtime
> > +Requires: mingw-libgpg-error
> > +Requires: mingw-libgcrypt
> >
> > Main package definition. Note that we don't have any automatic
> > find-requires working at the moment, so we need to define dependent
> > packages explicitly.
>
> Doesn't the default ELF find-rquires already discover these ? I thought
> it would look for all ELF files no matter where they were installed ?
They're not ELF binaries, they are Windows binaries which are a
perverted type of COFF. I can't see how one would discover
requirements without specific Windows binutils being installed.
Probably need to have custom find-requires/find-provides as we do with
OCaml.
> > I've split the build by configuring & building in two subdirectories,
> > ie. the general pattern is:
> >
> > pushd build
> > ../configure &c
> > popd
> > pushd i686-pc-mingw32
> > ../configure --host=i686-pc-mingw32 &c
> > popd
> >
> > Note the hack to make %configure work in a subdirectory. Any easier way?
>
> While this works for GNUTLS I don't think we can assume that all libs
> we want will support VPATH builds. IIRC the way the kernel deals with
> this is to have a completely separate source tree per build target.
>
> We could do this by changing
>
> %setup
>
> to
>
> %setup -c
>
> So the sources end up in rpm/BUILD/gnutls-2.4.1/gnutls-2.4.1
OK, fair enough ...
> Oh, we probably also want to have a %define with_mingw at the top of
> the spec files to allow the mingw sub-RPM to be turned on/off easily.
> This will speed up build times during regular package maintainer work.
Yup.
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
Read my OCaml programming blog: http://camltastic.blogspot.com/
Fedora now supports 59 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
More information about the fedora-devel-list
mailing list