|
|
This document describes the infrastructure for maintaining GHC's mingw64/mingw32 toolchain tarballs for Windows.
|
|
|
|
|
|
# Why
|
|
|
|
|
|
On Windows, GHC binary distributions ship with a full C compiler/linker toolchain targetting the host platform. These tarballs are generated by the `make sdist` build rules and are derived from mingw toolchains built by the [msys2 project](https://www.msys2.org/). Unfortunately, GHC must patch around a variety of limitations of this toolchain to ensure reliable operation (specifically, working around the `MAX_PATH` limitation). For this, @Phyx has developed a [patch utility](https://github.com/Mistuke/ghc-jailbreak).
|
|
|
|
|
|
# Building the jailbreak utility
|
|
|
|
|
|
The following assumes a Windows machine with both `msys32` and msys64` installed, each with a GCC toolchain:
|
|
|
```
|
|
|
MSYSTEM=MINGW64 PATH=/mingw64/bin:$PATH bash -c "pacman -Suy mingw-w64-x86_64-gcc"
|
|
|
MSYSTEM=MINGW32 PATH=/mingw32/bin:$PATH bash -c "pacman -Suy mingw-w64-i686-gcc"
|
|
|
```
|
|
|
|
|
|
In an msys2 shell
|
|
|
|
|
|
1. `git clone https://github.com/Mistuke/ghc-jailbreak`
|
|
|
2. `cd ghc-jailbreak`
|
|
|
3. `PATH=/mingw64/bin:$PATH bash -c make`
|
|
|
4. `PATH=/mingw32/bin:$PATH bash -c make`
|
|
|
|
|
|
# Building the toolchain tarballs
|
|
|
|
|
|
There are two pieces necessary to generate a toolchain tarball |
|
|
\ No newline at end of file |