[ANN] GHCup 0.1.50.2 release (LD breakage)

The main point of this release is the following ticket: Disable GHCs aggressive selection of `ld.gold` · Issue #1032 · haskell/ghcup-hs · GitHub

Context

GHCs bindist configure script probes for different linker binaries (ld.bfd, ld.gold and ld.lld) and has a fixed order of which to prefer. That means you will get ld.gold on most systems if it is installed. This will then be hardcoded into the GHC settings file (e.g. on unix that’s ~/.ghcup/ghc/9.12.2/lib64/ghc-9.12.2/lib/settings).

We have been arguing that this is bad practice to begin with for several reasons:

  • GHC should just honor wherever ld points to (it’s usually a symlink)… this is the least surprising behavior for end users
  • gold has seen way less activity than other linkers, so the fact that it’s preferred over bfd linker was contested (e.g. gold was already quasi-broken on Alpine)
  • switching the linker now requires effectively reinstalling GHC or editing the GHC settings file manually

The hardcoding of ld.gold has now even led to breakage, because it has recently been officially deprecated and removed from distros.

Starting with ghcup 0.1.50.2, this behavior is now disabled and the install procedure will pick plain ld.

:radioactive: Fallout

That means if the gold linker was previously installed on your distro and you’re now upgrading to a binutils 2.44 or later, your GHC installations are likely broken.

You should upgrade ghcup and reinstall all your GHCs.

Opt-out

If you prefer GHCs --enable-ld-override, you can still tell GHCup to do that. Add the following to ~/.ghcup/config.yaml:

def-ghc-conf-options:
  - "--enable-ld-override"

This is also described in more detail here: https://www.haskell.org/ghcup/guide/#linkers


How to upgrade

ghcup upgrade

If you haven’t installed yet, follow the instructions at: GHCup

ChangeLog

  • Respect system ld on all platforms and disable GHCs aggressive selection of ld.gold, fixes #1032
  • TUI: allow responding to prompts with Return (defaulting to Yes response) by Jan Hrček wrt #1253
15 Likes

Thanks @hasufell!

I have updated the linker list to reflect that piece of news: Linking · Wiki · Glasgow Haskell Compiler / GHC · GitLab

7 Likes