Differences between revisions 2 and 9 (spanning 7 versions)
Revision 2 as of 2010-12-05 18:00:34
Size: 3682
Comment:
Revision 9 as of 2019-08-20 22:40:23
Size: 7185
Editor: nodiscc
Comment: add CategoryPackaging
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
 * '''Contributors''': DmitrijsLedkovs  * '''Contributors''': DmitrijsLedkovs, StephenKitt
Line 12: Line 12:
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. 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.
Line 14: Line 14:
Multiarch/Spec covers installation of shared libraries, but doesn't discuss -dev packages. [[Multiarch/Spec]] covers installation of shared libraries, but doesn't discuss -dev packages.
Line 20: Line 20:
[[http://www.mingw.org/wiki/RelocatableHOWTOforMinGW|Relocation HOWTO]] is also of interest. A guide how to create relocatable MinGW toolchain.

[[https://wiki.linaro.org/CrossBuilding| Linaro CrossBuilding]] wiki page sheds a lot of light into current state of cross-compiling.
Line 22: Line 26:
  * Bob is a maintainer of upstream project. He get a lot of request to create native Windows install files. Bob uses mingw-w64 toolchain in debian to cross-compile his app and create nsis installer for it.
  * Wine packaging uses mingw-w64 toolchain in Debian to compile wine-gecko.
  * Bob is a maintainer of an upstream project. He gets a lot of request to create native Windows install files. Bob uses the mingw-w64 toolchain in Debian to cross-compile his app and create an nsis installer for it.
  * Wine packaging uses the mingw-w64 toolchain in Debian to compile wine-gecko and eventually wine-mono.
  * LibreOffice packaging uses the mingw-w64 toolchain to build a Windows DLL for its SDK.
  * A number of Debian packages use the mingw-w64 toolchain to build Windows tools for the Windows-based installer.
Line 41: Line 47:
Diagram below is a modified version from [[http://fedoraproject.org/wiki/Packaging/MinGW|Fedora MinGW SIG]] under license Attribution-Share Alike 3.0 Unported.
Line 42: Line 49:
This is the current (non Multiarch) layout:
Line 43: Line 51:
{{{
 [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
}}}
Line 55: Line 136:

==== 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 [[http://bugs.debian.org/606825|#606825]].

==== cross-build-essential ====

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

 * changing gcc-mingw-w64 to provide gcc-i486-w64-mingw32 and g++-i486-w64-mingw32 (and likewise for x86_64)
 * changing mingw-w64 to build libc6-dev:mingw64-i386 and libc6-dev:mingw64-amd64
 * providing pkg-config-i486-w64-mingw32 and pkg-config-x86_64-w64-mingw32
 * enabling mingw64-i386 and mingw64-amd64 in cross-build-essential
Line 74: Line 168:
CategorySpec
CategorySpec CategoryPackaging

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

  • Bob is a maintainer of an upstream project. He gets a lot of request to create native Windows install files. Bob uses the mingw-w64 toolchain in Debian to cross-compile his app and create an nsis installer for it.
  • Wine packaging uses the mingw-w64 toolchain in Debian to compile wine-gecko and eventually wine-mono.
  • LibreOffice packaging uses the mingw-w64 toolchain to build a Windows DLL for its SDK.

  • A number of Debian packages use the mingw-w64 toolchain to build Windows tools for the Windows-based installer.

Scope

The scope of this spec covers:

  • cross-compilers to x86 and x86_64 Windows platforms, i.e. binutils, gcc, mingw-w64 runtime and headers
  • Packaging and cross-compilation guidelines to x86 and x86_64 Windows platforms

Design

  • Biarch is not ready - two single-arch toolchains
  • Co-installable multiple gcc versions
  • No sysroot, because single mingw include dir is not x86_64 aware
  • Where to install cross-compiled packages
  • Naming scheme for the packages.

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

  • changing gcc-mingw-w64 to provide gcc-i486-w64-mingw32 and g++-i486-w64-mingw32 (and likewise for x86_64)
  • changing mingw-w64 to build libc6-dev:mingw64-i386 and libc6-dev:mingw64-amd64
  • providing pkg-config-i486-w64-mingw32 and pkg-config-x86_64-w64-mingw32
  • enabling mingw64-i386 and mingw64-amd64 in cross-build-essential

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 CategoryPackaging