Summary

This specification describes the way we would like to package i686-w64-mingw32 and x86_64-w64-mingw32 toolchains.

Rationale

While Multiarch/Spec provides starting ideas it is not clear, what is the correct procedure to package mingw cross-compilation environment. Currently such environments are implemented in Fedora by Mingw SIG, openSUSE derives from that effort in OBS project. Additionally there is documentation created by mingw.org.

Multiarch/Spec covers installation of shared libraries, but doesn't discuss -dev packages.

Fedora MinGW SIG packaging guidelines deal with installing any cross-compiled packages, but it is not x86_64 aware.

Futher discussion of multiarch in debian is also of interest.

Relocation HOWTO is also of interest. A guide how to create relocatable MinGW toolchain.

Linaro CrossBuilding wiki page sheds a lot of light into current state of cross-compiling.

Use Cases

Scope

The scope of this spec covers:

Design

Filesystem layout

Diagram below is a modified version from Fedora MinGW SIG under license Attribution-Share Alike 3.0 Unported.

This is the current (non Multiarch) layout:

 [root]
   |
   +- usr
       |
       +- bin
       |   |
       |   +- i686-w64-mingw32-cpp
       |   +- i686-w64-mingw32-gcc
       |   +- i686-w64-mingw32-g++
       |   +- i686-w64-mingw32-strip
       |   +- i686-w64-mingw32-ld
       |   +- ... etc..
       |   +- x86_64-w64-mingw32-cpp
       |   +- x86_64-w64-mingw32-gcc
       |   +- x86_64-w64-mingw32-g++
       |   +- x86_64-w64-mingw32-strip
       |   +- x86_64-w64-mingw32-ld
       |   +- ... etc..
       |
       +- lib
       |    |
       |    +- gcc - (cross-compiler)
       |         |
       |         +-i686-w64-mingw32
       |         +-x86_64-w64-mingw32
       |
       +- i686-w64-mingw32  - root of x86 toolchain and binaries
       |    |
       |    +- lib  - Cross compiler toolchain support libraries / files
       |    |
       |    +- include  - Cross compiler toolchain support headers / files
       |
       +- x86_64-w64-mingw32  - root of x86_64 toolchain and binaries (same layout as for x86)

This is the future layout once dpkg knows about the architecture:

 [root]
   |
   +- usr
       |
       +- bin
       |   |
       |   +- i686-w64-mingw32-cpp
       |   +- i686-w64-mingw32-gcc
       |   +- i686-w64-mingw32-g++
       |   +- i686-w64-mingw32-strip
       |   +- i686-w64-mingw32-ld
       |   +- ... etc..
       |   +- x86_64-w64-mingw32-cpp
       |   +- x86_64-w64-mingw32-gcc
       |   +- x86_64-w64-mingw32-g++
       |   +- x86_64-w64-mingw32-strip
       |   +- x86_64-w64-mingw32-ld
       |   +- ... etc..
       |
       +- include
       |   |
       |   +- i686-w64-mingw32 - x86-specific headers
       |   +- x86_64-w64-mingw32 - x64-specific headers
       |
       +- lib
       |    |
       |    +- gcc - (cross-compiler)
       |    |    |
       |    |    +-i686-w64-mingw32
       |    |    +-x86_64-w64-mingw32
       |    |
       |    +- i686-w64-mingw32 - x86 libraries
       |    +- x86_64-w64-mingw32 - x64 libraries

Rationale

This should be the description of why this spec is being defined.

Scope and Use Cases

While not always required, but in many cases they bring much better clarity to the scope and scale of the specification than could be obtained by talking in abstract terms.

Implementation Plan

This section is usually broken down into subsections, such as the packages being affected, data and system migration where necessary, user interface requirements and pictures (photographs of drawings on paper work well).

Targets in dpkg

MinGW-w64 targets need to be added to dpkg for Multiarch and cross-building using sbuild to work. This is tracked in #606825.

cross-build-essential

Once the architectures exist, cross-build-essential can be used to tell sbuild what to do; this requires

Implementation

To implement a specification, the developer should observe the use cases carefully, and follow the design specified. He should make note of places in which he has strayed from the design section, adding rationale describing why this happened. This is important so that next iterations of this specification (and new specifications that touch upon this subject) can use the specification as a reference.

The implementation is very dependent on the type of feature to be implemented. Refer to the team leader for further suggestions and guidance on this topic.

Outstanding Issues

The specification process requires experienced people to drive it. More documentation on the process should be produced.

The drafting of a specification requires english skills and a very good understanding of the problem. It must also describe things to an extent that someone else could implement. This is a difficult set of conditions to ensure throughout all the specifications added.

There is a lot of difficulty in gardening obsolete, unwanted and abandoned specifications in the Wiki.

BoF agenda and discussion

Possible meetins where this specification will be discussed.


CategorySpec