Skip to content

[GHC 9.4] Seeing an RPATH issue while building on Linux (maybe in `ghc-iserv-dyn-ghc`)

Summary

While trying to update Homebrew's GHC to 9.4 and also migrate to Hadrian build from previous Make build, Homebrew CI detected incorrect linkage on Linux (https://github.com/Homebrew/homebrew-core/pull/110865). This was attempted for both 9.4.2 and 9.4.3.

I was debugging this in https://github.com/Homebrew/homebrew-core/pull/117270 and one potential issue I noticed was RPATH for ghc-iserv-dyn-ghc.

I also checked the official binary distribution where I see:

❯ objdump -p bin/ghc-iserv-dyn-ghc-9.4.3 | grep RUNPATH
  RUNPATH      $ORIGIN/../x86_64-linux-ghc-9.4.3:$ORIGIN/../../../x86_64-linux-ghc-9.4.3

❯ objdump -p bin/ghc | grep RUNPATH
  RUNPATH      $ORIGIN/../lib/x86_64-linux-ghc-9.4.3:$ORIGIN/../../../lib/x86_64-linux-ghc-9.4.3

Steps to reproduce

Originally seen performing Hadrian build of GHC 9.4.3. Steps I am trying in Homebrew:

  1. Downloaded GHC 9.2.5 and Cabal 3.8.1.0
  2. ./configure --prefix=#{prefix} --disable-numa --with-intree-gmp
  3. hadrian/build install -j#{jobs} --prefix=#{prefix} --flavour=release --docs=no-sphinx-pdfs

But can be seen in existing binary packages at https://www.haskell.org/ghc/download_ghc_9_4_3.html#linux_x86_64

Expected behavior

Valid RPATHs for binaries.

Environment

  • GHC version used: Building GHC 9.4.3/9.4.2 with bootstrap GHC 9.2.5

Optional:

  • Operating System: Ubuntu 22.04
  • System Architecture:
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information