From Fedora Project Wiki
(Feature was accepted for F17 in the 2012-03-12 FESCO meeting (#820))
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Cross Compiler Framework =
= Mingw-w64 cross compiler =


== Summary ==
== Summary ==
Introduce a set of packages and RPM macros to help building binaries for multiple targets.
Use the mingw-w64 cross compiler toolchain to build binaries for both Win32 and Win64 targets
Initially, support for Win32 and Win64 will be added, but adding support for other targets (like Mac OS X) in the future will become quite easy


== Owner ==
== Owner ==
Line 9: Line 8:


<!-- Include you email address that you can be reached should people want to contact you about helping with your feature, status is requested, or  technical issues need to be resolved-->
<!-- Include you email address that you can be reached should people want to contact you about helping with your feature, status is requested, or  technical issues need to be resolved-->
* Email: epienbro@fedoraproject.org
* Email: epienbro @ fedoraproject.org
* IRC: epienbro @ irc.freenode.net #fedora-mingw
* IRC: epienbro @ irc.freenode.net #fedora-mingw
* Mailing list: mingw@lists.fedoraproject.org
* Mailing list: [https://admin.fedoraproject.org/mailman/listinfo/mingw mingw@lists.fedoraproject.org]


== Current status ==
== Current status ==
* Targeted release: [[Releases/15 | Fedora 15 ]]  
* Targeted release: [[Releases/17 | Fedora 17 ]]  
* Last updated: Jan 29 2011
* Last updated: March 11 2012
* Percentage of completion: 40%
* Percentage of completion: 100%


== Detailed Description ==
== Detailed Description ==
Several Fedora releases ago support was added to build binaries for the Win32 target using the mingw.org toolchain ([[Features/Windows_cross_compiler]]). At the moment there are about 96 packages in Fedora which make use of this toolchain (the mingw32-* packages). There has been some demand to also add support for building binaries for the Win64 target as well as the Mac OS X target. In order to build binaries for the Win64 target we have to switch from
Several Fedora releases ago support was added to build binaries for the Win32 target using the mingw.org toolchain ([[Features/Windows_cross_compiler]]). At the moment there are over 110 packages in Fedora which make use of this toolchain (the mingw32-* packages). There has been a demand to also add support for building binaries for the Win64 target. In order to build binaries for the Win64 target we have to switch from the [http://www.mingw.org/ mingw.org] toolchain to the (much better maintained and more complete) [http://mingw-w64.sourceforge.net/ mingw-w64] toolchain
the mingw.org toolchain to the (much better maintained and complete) mingw-w64 toolchain


In the past there has been a successful attempt to building binaries for the Mac OS X on a Fedora host. However, it but can't be added to Fedora at the moment because some binary blobs were used and several file are licensed under a [[Licensing:Main#Bad_Licenses|forbidden license]]. If we really want to have Mac OS X support in Fedora in the future we should try to get these issues resolved first
In order to make it easy for packagers to build binaries for multiple targets (from a single source rpm) several RPM macros have been developed. These RPM macros are an attempt to reduce the amount of duplication of .spec files to a minimum and are bundled in the mingw-filesystem package (which will replace mingw32-filesystem). All these macros are explained in the updated MinGW packaging guidelines: [[Packaging:MinGW_Future]]. These new packaging guidelines are already approved by the FPC


In order to make it easy for packagers to build binaries for multiple targets (from a single source rpm) several RPM macros have been developed. These RPM macros are an attempt to reduce the amount of duplication of .spec files to a minimum and are bundled in the cross-filesystem package (which will replace mingw32-filesystem). All these macros are explained at the [[MinGW/CrossCompilerFramework]] page. Several RPM packages have been developed like cross-binutils, cross-gcc, mingw-headers and mingw-crt containing all pieces belonging to the mingw-w64 toolchain (which can build binaries for both Win32 as well as Win64)
Several RPM packages have been developed like mingw-binutils, mingw-gcc, mingw-headers and mingw-crt containing all pieces belonging to the mingw-w64 toolchain (which can build binaries for both Win32 as well as Win64). These new packages will replace the current mingw32 toolchain packages: mingw32-filesystem, mingw32-binutils, mingw32-gcc, mingw32-w32api and mingw32-crt


With this framework we'll also be building binaries for the Win32 target using the mingw-w64 toolchain (instead of the mingw.org one).
With this framework we will also be able to build binaries for the Win32 target using the mingw-w64 toolchain (instead of the mingw.org one).
Most packages compile fine out of the box against the mingw-w64 toolchain. All packages which require some patching have been identified
Most packages compile fine out of the box against the mingw-w64 toolchain. All packages which require some patching have been identified
and have already been made operational in a testing repository
and have already been made operational in a testing repository
This testing repository has already been available for about a year and various members from the Fedora MinGW SIG already
contributed patches and improvements to it. As we were waiting on legal approval for the introduction of mingw-w64 in Fedora
we had to do all development and testing work in this testing repository. As the legal approval arrived at February 22 2012
we can now merge back all the changes from this testing repository back to Fedora after which the testing repository will disappear


== Benefit to Fedora ==
== Benefit to Fedora ==
This feature makes it easier for packagers to build packages for multiple targets (Win32+Win64 initially). Regular developers can also use the tools from this framework to build binaries (and test these using wine) for multiple targets
This feature makes it easier for packagers to cross-compile packages for both the Win32 and the Win64 targets. Developers can also use the tools from this framework to cross-compile binaries (and test these using wine) for the Win32 and Win64 targets


== Scope ==
== Scope ==
Before this feature can land in Fedora several tasks have to be done:
Before this feature can land in Fedora several tasks have to be done:
* Develop a set of RPM macros to reduce duplication in .spec files
* Develop a set of RPM macros to reduce duplication in .spec files <b>done</b>
* Package the mingw-w64 toolchain
* Package the mingw-w64 toolchain <b>done</b>
* Rebuild all mingw32-* packages against the mingw-w64 toolchain
* Rebuild all mingw32-* packages against the mingw-w64 toolchain <b>done</b>
* Patch all mingw32-* packages which failed to build against the mingw-w64 toolchain
* Patch all mingw32-* packages which failed to build against the mingw-w64 toolchain <b>done</b>
* Port the most important mingw32-* packages to use the new set of RPM macros so that binaries get build for Win32 and Win64
* Port the most important mingw32-* packages to use the new set of RPM macros so that binaries get build for Win32 and Win64 <b>done</b>
* Package the darwinx (Mac OS X) toolchain and integrate it in a separate tree
* Publish testing repositories for the Win32+Win64 tree <b>done</b>
* Make sure that the mingw32-* packages which were ported earlier can also build with darwinx support with minimal changes
* Write a porting guide <b>done</b>
* Publish testing repositories for both the Win32+Win64 tree and the Win32+Win64+Darwinx tree (the packages from the first tree are targeted for Fedora 15)
* Rewrite the Fedora MinGW packaging guidelines <b>done</b>
* Write a porting guide
* Let the updated packaging guidelines be approved <b>done</b>
* Rewrite the Fedora MinGW packaging guidelines
* Put the 3 toolchain packages (mingw-filesystem, mingw-headers and mingw-crt) up for review <b>done</b>
* Let the updated packaging guidelines be approved
* Wait for the 3 toolchain packages to be reviewed and approved <b>done</b>
* Put the 5 toolchain packages (cross-filesystem, cross-binutils, cross-gcc, mingw-headers and mingw-crt) up for review
* Have FE-Legal approve the use of the mingw-w64 toolchain <b>done</b>
* Have FE-Legal approve the use of the mingw-w64 toolchain
* Bootstrap the toolchain for the win32 target <b>done</b>
* Once these 5 packages have been approved, import the packages, bootstrap the toolchain and rebuild all mingw32-* packages in a separate Koji buildroot
* Rebuild all current mingw32 packages against the new mingw-w64 based toolchain <b>done</b>
* Port the individual mingw32-* packages to use this new framework (not required to be completed for Fedora 15)
* Introduce the mingw-gcc and mingw-binutils packages <b>done</b>
* Bootstrap the toolchain for the win64 target <b>done</b>
 
These tasks are not required to be completed for Fedora 17, but are related to this feature:
* Perform a mass rename of all mingw32-* packages to mingw-* as used by the new MinGW packaging guidelines <b>done</b>
* Import the renamed mingw-* packages in Fedora 17 <b>done</b>
* Port the individual mingw-* packages to use this new framework <b>about 70% of all mingw32-* packages are already ported in the testing repository</b>
* Merge all ported packages from the testing repository back to Fedora <b>in progress</b>


Most of the steps required to get this in Fedora are also explained at the [[MinGW/CrossCompilerFramework#Roadmap|roadmap]] page
Most of the steps required to get this in Fedora are also explained at the [[MinGW/CrossCompilerFramework#Roadmap|roadmap]] page


== How To Test ==
== How To Test ==
<!-- This does not need to be a full-fledged document.  Describe the dimensions of tests that this feature is expected to pass when it is done.  If it needs to be tested with different hardware or software configurations, indicate them.  The more specific you can be, the better the community testing can be.


Remember that you are writing this how to for interested testers to use to check out your feature - documenting what you do for testing is OK, but it's much better to document what *I* can do to test your feature.
The Win32 part of the mingw-w64 toolchain is already part of the Fedora 17 repositories.
The exact same RPM macros and wrapper scripts (like mingw32-configure) as used in the MinGW
toolchain in earlier Fedora releases can be used to cross-compile packages against this toolchain.
The cross-compiled binaries can be tested using wine
 
Until the remaining packages belonging to the new Fedora MinGW packaging guidelines are imported in Fedora people interested can test this feature using a testing repository. Details about this can be found at the [[MinGW/CrossCompilerFramework#Development_and_testing_repository|testing repository]] page. Once you install the yum .repo file belonging to the testing repository and perform a 'yum update' any mingw32-* packages which you might have already installed will be replaced by ones produced using the mingw-w64 toolchain


A good "how to test" should answer these four questions:
If you want to test building packages for the Win64 target you can install the 'mingw64-gcc' package. Once the compiler is installed you can build binaries for the Win64 target using commands like 'i686-w64-mingw32-gcc'. Also note that the name of the gcc command for the Win32 target has been changed from 'i686-pc-mingw32' to 'i686-w64-mingw32-gcc' and that all files which used to be in /usr/i686-pc-mingw32/ have now been moved to /usr/i686-w64-mingw32/


0. What special hardware / data / etc. is needed (if any)?
Generated binaries for the Win64 target can be tested using the x86_64 version of wine
1. How do I prepare my system to test this feature? What packages
need to be installed, config files edited, etc.?
2. What specific actions do I perform to check that the feature is
working like it's supposed to?
3. What are the expected results of those actions?
-->


== User Experience ==
== User Experience ==
<!-- If this feature is noticeable by its target audience, how will their experiences change as a result?  Describe what they will see or notice. -->
Developers using Fedora can now build binaries for both the Win32 as well as the Win64 target


== Dependencies ==
== Dependencies ==
<!-- What other packages (RPMs) depend on this package?  Are there changes outside the developers' control on which completion of this feature depends?  In other words, completion of another feature owned by someone else and might cause you to not be able to finish on time or that you would need to coordinate?  Other upstream projects like the kernel (if this is not a kernel feature)? -->
* The 3 toolchain packages (mingw-filesystem, mingw-headers and mingw-crt) are new packages and have to pass the package review process <b>done</b>
* The mingw-headers and mingw-crt packages have to be cleared by FE-Legal <b>done</b>
* The Fedora MinGW Packaging guidelines have to be updated and approved <b>done</b>


== Contingency Plan ==
== Contingency Plan ==
<!-- If you cannot complete your feature by the final development freeze, what is the backup plan?  This might be as simple as "None necessary, revert to previous release behaviour."  Or it might not.  If you feature is not completed in time we want to assure others that other parts of Fedora will not be in jeopardy.  -->
If the 3 toolchain packages can't be approved in time we can stick with the current mingw32-* packages and move this feature to the next Fedora release


== Documentation ==
== Documentation ==
<!-- Is there upstream documentation on this feature, or notes you have written yourself?  Link to that material here so other interested developers can get involved. -->
All documentation about the use of the mingw-w64 toolchain to generate binaries for Win32 and Win64 can be found at [[Packaging:MinGW_Future]], [[MinGW/CrossCompilerFramework]] and on the [https://admin.fedoraproject.org/mailman/listinfo/mingw mingw@lists.fedoraproject.org] mailing list
*


== Release Notes ==
== Release Notes ==
<!-- The Fedora Release Notes inform end-users about what is new in the release.  Examples of past release notes are here: http://docs.fedoraproject.org/release-notes/ -->
This release of Fedora contains the [http://mingw-w64.sourceforge.net/ mingw-w64] cross compiler toolchain which makes it easier for packagers and developers to build binaries for both the Win32 and the Win64 targets
<!-- The release notes also help users know how to deal with platform changes such as ABIs/APIs, configuration or data file formats, or upgrade concerns.  If there are any such changes involved in this feature, indicate them here.  You can also link to upstream documentation if it satisfies this need.  This information forms the basis of the release notes edited by the documentation team and shipped with the release. -->
*


== Comments and Discussion ==
== Comments and Discussion ==
* See [[Talk:Features/YourFeatureName]] <!-- This adds a link to the "discussion" tab associated with your page. This provides the ability to have ongoing comments or conversation without bogging down the main feature page -->
* See [[Talk:Features/Mingw-w64_cross_compiler]]
 
* [http://lists.fedoraproject.org/pipermail/mingw/2011-January/003285.html Announcement on the mingw@lists.fedoraproject.org mailing list]
* [http://lists.fedoraproject.org/pipermail/legal/2011-November/001754.html Status update request on the legal@lists.fedoraproject.org mailing list]
* [http://lists.fedoraproject.org/pipermail/mingw/2012-February/004533.html Announcement about the legal approval]
* [http://lists.fedoraproject.org/pipermail/mingw/2012-February/004552.html Status update February 25 2012]
* [http://lists.fedoraproject.org/pipermail/mingw/2012-March/004657.html Status update March 3 2012]
* [http://article.gmane.org/gmane.linux.redhat.fedora.mingw/4498 Status update March 6 2012]
* [http://article.gmane.org/gmane.linux.redhat.fedora.mingw/4807 Status update March 7 2012]


[[Category:FeaturePageIncomplete]]
[[Category:FeatureAcceptedF17]]
<!-- When your feature page is completed and ready for review -->
<!-- When your feature page is completed and ready for review -->
<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->
<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->
<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->
<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->
<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->
<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->

Latest revision as of 00:35, 17 March 2012

Mingw-w64 cross compiler

Summary

Use the mingw-w64 cross compiler toolchain to build binaries for both Win32 and Win64 targets

Owner

Current status

  • Targeted release: Fedora 17
  • Last updated: March 11 2012
  • Percentage of completion: 100%

Detailed Description

Several Fedora releases ago support was added to build binaries for the Win32 target using the mingw.org toolchain (Features/Windows_cross_compiler). At the moment there are over 110 packages in Fedora which make use of this toolchain (the mingw32-* packages). There has been a demand to also add support for building binaries for the Win64 target. In order to build binaries for the Win64 target we have to switch from the mingw.org toolchain to the (much better maintained and more complete) mingw-w64 toolchain

In order to make it easy for packagers to build binaries for multiple targets (from a single source rpm) several RPM macros have been developed. These RPM macros are an attempt to reduce the amount of duplication of .spec files to a minimum and are bundled in the mingw-filesystem package (which will replace mingw32-filesystem). All these macros are explained in the updated MinGW packaging guidelines: Packaging:MinGW_Future. These new packaging guidelines are already approved by the FPC

Several RPM packages have been developed like mingw-binutils, mingw-gcc, mingw-headers and mingw-crt containing all pieces belonging to the mingw-w64 toolchain (which can build binaries for both Win32 as well as Win64). These new packages will replace the current mingw32 toolchain packages: mingw32-filesystem, mingw32-binutils, mingw32-gcc, mingw32-w32api and mingw32-crt

With this framework we will also be able to build binaries for the Win32 target using the mingw-w64 toolchain (instead of the mingw.org one). Most packages compile fine out of the box against the mingw-w64 toolchain. All packages which require some patching have been identified and have already been made operational in a testing repository

This testing repository has already been available for about a year and various members from the Fedora MinGW SIG already contributed patches and improvements to it. As we were waiting on legal approval for the introduction of mingw-w64 in Fedora we had to do all development and testing work in this testing repository. As the legal approval arrived at February 22 2012 we can now merge back all the changes from this testing repository back to Fedora after which the testing repository will disappear

Benefit to Fedora

This feature makes it easier for packagers to cross-compile packages for both the Win32 and the Win64 targets. Developers can also use the tools from this framework to cross-compile binaries (and test these using wine) for the Win32 and Win64 targets

Scope

Before this feature can land in Fedora several tasks have to be done:

  • Develop a set of RPM macros to reduce duplication in .spec files done
  • Package the mingw-w64 toolchain done
  • Rebuild all mingw32-* packages against the mingw-w64 toolchain done
  • Patch all mingw32-* packages which failed to build against the mingw-w64 toolchain done
  • Port the most important mingw32-* packages to use the new set of RPM macros so that binaries get build for Win32 and Win64 done
  • Publish testing repositories for the Win32+Win64 tree done
  • Write a porting guide done
  • Rewrite the Fedora MinGW packaging guidelines done
  • Let the updated packaging guidelines be approved done
  • Put the 3 toolchain packages (mingw-filesystem, mingw-headers and mingw-crt) up for review done
  • Wait for the 3 toolchain packages to be reviewed and approved done
  • Have FE-Legal approve the use of the mingw-w64 toolchain done
  • Bootstrap the toolchain for the win32 target done
  • Rebuild all current mingw32 packages against the new mingw-w64 based toolchain done
  • Introduce the mingw-gcc and mingw-binutils packages done
  • Bootstrap the toolchain for the win64 target done

These tasks are not required to be completed for Fedora 17, but are related to this feature:

  • Perform a mass rename of all mingw32-* packages to mingw-* as used by the new MinGW packaging guidelines done
  • Import the renamed mingw-* packages in Fedora 17 done
  • Port the individual mingw-* packages to use this new framework about 70% of all mingw32-* packages are already ported in the testing repository
  • Merge all ported packages from the testing repository back to Fedora in progress

Most of the steps required to get this in Fedora are also explained at the roadmap page

How To Test

The Win32 part of the mingw-w64 toolchain is already part of the Fedora 17 repositories. The exact same RPM macros and wrapper scripts (like mingw32-configure) as used in the MinGW toolchain in earlier Fedora releases can be used to cross-compile packages against this toolchain. The cross-compiled binaries can be tested using wine

Until the remaining packages belonging to the new Fedora MinGW packaging guidelines are imported in Fedora people interested can test this feature using a testing repository. Details about this can be found at the testing repository page. Once you install the yum .repo file belonging to the testing repository and perform a 'yum update' any mingw32-* packages which you might have already installed will be replaced by ones produced using the mingw-w64 toolchain

If you want to test building packages for the Win64 target you can install the 'mingw64-gcc' package. Once the compiler is installed you can build binaries for the Win64 target using commands like 'i686-w64-mingw32-gcc'. Also note that the name of the gcc command for the Win32 target has been changed from 'i686-pc-mingw32' to 'i686-w64-mingw32-gcc' and that all files which used to be in /usr/i686-pc-mingw32/ have now been moved to /usr/i686-w64-mingw32/

Generated binaries for the Win64 target can be tested using the x86_64 version of wine

User Experience

Developers using Fedora can now build binaries for both the Win32 as well as the Win64 target

Dependencies

  • The 3 toolchain packages (mingw-filesystem, mingw-headers and mingw-crt) are new packages and have to pass the package review process done
  • The mingw-headers and mingw-crt packages have to be cleared by FE-Legal done
  • The Fedora MinGW Packaging guidelines have to be updated and approved done

Contingency Plan

If the 3 toolchain packages can't be approved in time we can stick with the current mingw32-* packages and move this feature to the next Fedora release

Documentation

All documentation about the use of the mingw-w64 toolchain to generate binaries for Win32 and Win64 can be found at Packaging:MinGW_Future, MinGW/CrossCompilerFramework and on the mingw@lists.fedoraproject.org mailing list

Release Notes

This release of Fedora contains the mingw-w64 cross compiler toolchain which makes it easier for packagers and developers to build binaries for both the Win32 and the Win64 targets

Comments and Discussion