Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,269
    • Issues 4,269
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 413
    • Merge Requests 413
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Wiki
    • Working conventions
  • windows toolchain

Last edited by Ben Gamari Jan 17, 2020
Page history New page

windows toolchain

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. 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.

Building the jailbreak utility

The following assumes a Windows machine with 32- and 64-bit toolchains installed:

$ MSYSTEM=MINGW64 bash --login -c "pacman -Suy mingw-w64-x86_64-gcc"
$ MSYSTEM=MINGW32 bash --login -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. In a mingw64 shell: make
  4. In a mingw32 shell: make
  5. tar -czf ghc-jailbreak.tar.gz x86_64 i686

Building the toolchain tarballs

GHC's source tree contains a script, mk/get-win32-tarballs.sh, which is used to build and fetch GHC's toolchain tarballs. To build the toolchain tarballs,

$ mk/get-win32-tarballs.sh grab all
$ rm -f ghc-tarballs/mingw-w64/*/*-phyx.*
$ mk/get-win32-tarballs.sh patch
$ mk/get-win32-tarballs.sh hash > mk/win32-tarballs.md5sum
$ vim mk/get/win32-tarballs.sh
# [edit download_tarballs() to reflect the new version numbers]
Clone repository

GHC Home
GHC User's Guide

Joining In

Newcomers info
Mailing Lists & IRC
The GHC Team

Documentation

GHC Status Info
Working conventions
Building Guide
Debugging
Commentary

Wiki

Title Index
Recent Changes