Proposed SIG: Windows MinGW cross-compiler SIG

Daniel P. Berrange berrange at redhat.com
Thu Jul 10 11:05:02 UTC 2008


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


>   +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 ?

> 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

Then in the %build seciton we can copy the source tree for
mingw

   cp -a %{name}-%{version} %{name}-%{version}-mingw
   pushd %{name}-%{version}
   %configure
   make 
   popd
   pushd %{name}-%{version}
   %configure --host=i686-pc-mingw32
   make 
   popd

Takes extra disk space during the build of course,but none of the things
we're looking at are particularly large.


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.

Regards,
Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the fedora-devel-list mailing list