From Fedora Project Wiki

< MinGW

Revision as of 13:02, 11 October 2010 by Epienbro (talk | contribs) (Created page with '= Introduction = One of the new features of F15 will be the introduction of a Cross Compiler Framework. This framework will obsolete the Fedora MinGW toolchain which can be foun...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

One of the new features of F15 will be the introduction of a Cross Compiler Framework. This framework will obsolete the Fedora MinGW toolchain which can be found in current versions of Fedora.

Initially, this framework will have support for building binaries for Win32 and Win64 targets. The mingw-w64 toolchain will be used for this. However support for other targets (like Mac OS X) can be added quite easily.

The goal of this framework is to provide a generic method to cross-compile binaries for multiple targets with as little packaging overhead as possible.

To provide a clean upgrade path and as little breakage as possible the introduction of this framework can be split in several phases.

Development and testing repository

All development of this toolchain is currently being done in a SVN repository at http://svn.openftd.org/svn/fedora_cross (SVNWeb: http://svn.openftd.org/viewvc/Fedora%20Cross%20Compilers%20Environment/) It has anonymous read-only access. For write access, please contact epienbro on FreeNode #fedora-mingw.

A yum testing repository containing (x86_64) binaries for all packages will be published soon. Note that this testing repository will obsolete any mingw32 packages you might have installed!

Phase 1: Get the mingw-w64 toolchain in Fedora

This requires some new packages to be approved using package reviews. The packages which have to be approved are cross-filesystem, cross-binutils, cross-gcc, mingw-crt and mingw-headers

The keep the amount of breakage as low as possible all these 5 packages have to be imported at once.

Phase 2: Bootstrap the mingw-w64 toolchain

Once the 5 packages mentioned in phase 1 are approved they can be imported. In order to bootstrap the mingw-w64 toolchain this has to be done in a specific order.

1. Import the cross-filesystem package, build it and wait for it to enter the buildroot
2. Import the cross-binutils package, build it and wait for it to enter the buildroot
3. Import the mingw-headers package, build it and wait for it to enter the buildroot
4. Import the cross-gcc package, build it (with the %bootstrap flag set to 1) and wait for it to enter the buildroot
5. Import the mingw-crt package, build it and wait for it to enter the buildroot
6. Rebuild the cross-gcc package with the %bootstrap flag set to 0 and wait for it to enter the buildroot

Phase 3: Rebuild all mingw32 packages

The mingw-w64 toolchain is now operational and can build binaries for both Win32 and Win64. As the name of the triplet has been changed (in the cross-filesystem package) from i686-pc-mingw32 to i686-w64-mingw64 as mingw32 packages have to be rebuild. All mingw32 packages should have been using macros like %{_mingw32_bindir} as mentioned in the MinGW Packaging Guidelines. As all these macros have been moved to the cross-filesystem package (and some deprecated macros are kept for backwards compatibility) a plain rebuild should be sufficient to get mingw32 packages built against the new toolchain.

Packages which have the triplet 'i686-pc-mingw32' hardcoded in their .spec files need to updated as they aren't conforming to the packaging guidelines

Phase 4: Rename and port all mingw32-packages