ghc 9.4.1 fails to compile head
Run the below repro script in a clean ubuntu:22.04
docker container:
#!/usr/bin/env bash
set -euo pipefail
export PATH=~/.cabal/bin:~/.ghcup/bin:$PATH
apt update
apt full-upgrade -y
apt install -y \
automake \
build-essential \
curl \
git \
libgmp-dev \
libncurses-dev \
python3
mkdir -p ~/.ghcup/bin
curl -f -L --retry 5 https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup -o ~/.ghcup/bin/ghcup
chmod +x ~/.ghcup/bin/ghcup
ghcup install ghc 9.2.4
ghcup install ghc 9.4.1 -u https://downloads.haskell.org/~ghc/9.4.1/ghc-9.4.1-x86_64-fedora33-linux.tar.xz
ghcup set ghc 9.4.1
ghcup install cabal
cabal update
cabal install \
alex \
happy
git clone --recurse-submodules https://gitlab.haskell.org/ghc/ghc.git /tmp/ghc
cd /tmp/ghc
./boot --hadrian
./configure
GHC=ghc-9.2.4 hadrian/build -j
It'll fail with linker error:
Command line: /root/.ghcup/bin/ghc -Wall -Wcompat -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage0/lib/package.conf.d' '-package-id array-0.5.4.0' '-package-id base-4.17.0.0' '-package-id containers-0.6.6' '-package-id directory-1.3.7.1' '-package-id filepath-1.4.2.2' '-package-id hpc-0.6.1.0' -i -i/tmp/ghc/_build/stage0/utils/hpc/build -i/tmp/ghc/_build/stage0/utils/hpc/build/hpc/autogen -i/tmp/ghc/utils/hpc -I_build/stage0/utils/hpc/build -I/tmp/ghc/_build/stage0/lib/x86_64-linux-ghc-9.4.1/unix-2.7.2.2/include -I/tmp/ghc/_build/stage0/lib/x86_64-linux-ghc-9.4.1/time-1.12.2/include -I/tmp/ghc/_build/stage0/lib/x86_64-linux-ghc-9.4.1/bytestring-0.11.3.0/include -I/root/.ghcup/ghc/9.4.1/lib/ghc-9.4.1/lib/x86_64-linux-ghc-9.4.1/base-4.17.0.0/include -I/root/.ghcup/ghc/9.4.1/lib/ghc-9.4.1/lib/x86_64-linux-ghc-9.4.1/ghc-bignum-1.3/include -I/root/.ghcup/ghc/9.4.1/lib/ghc-9.4.1/lib/x86_64-linux-ghc-9.4.1/rts-1.0.2/include -optP-include -optP_build/stage0/utils/hpc/build/hpc/autogen/cabal_macros.h -outputdir _build/stage0/utils/hpc/build -fdiagnostics-color=always -no-auto-link-packages -rtsopts -optc-Wno-error=inline -optP-Wno-nonportable-include-path _build/stage0/utils/hpc/build/Main.o _build/stage0/utils/hpc/build/HpcParser.o _build/stage0/utils/hpc/build/HpcCombine.o _build/stage0/utils/hpc/build/HpcDraft.o _build/stage0/utils/hpc/build/HpcFlags.o _build/stage0/utils/hpc/build/HpcLexer.o _build/stage0/utils/hpc/build/HpcMarkup.o _build/stage0/utils/hpc/build/HpcOverlay.o _build/stage0/utils/hpc/build/HpcReport.o _build/stage0/utils/hpc/build/HpcShowTix.o _build/stage0/utils/hpc/build/HpcUtils.o _build/stage0/utils/hpc/build/Paths_hpc_bin.o -o _build/stage0/bin/hpc -O -H32m -XHaskell2010
===> Command failed with error code: 1
/root/.ghcup/ghc/9.4.1/lib/ghc-9.4.1/lib/../lib/x86_64-linux-ghc-9.4.1/containers-0.6.6/libHScontainers-0.6.6.a(Tree.o)(.text+0x2d96): error: undefined reference to 'templatezmhaskell_LanguageziHaskellziTHziSyntax_zdwzdclift11_info'
/root/.ghcup/ghc/9.4.1/lib/ghc-9.4.1/lib/../lib/x86_64-linux-ghc-9.4.1/containers-0.6.6/libHScontainers-0.6.6.a(Tree.o)(.text+0x3426): error: undefined reference to 'templatezmhaskell_LanguageziHaskellziTHziSyntax_zdwzdclift11_info'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Command failed
Build failed.