Skip to content

MacOS binaries have $ORIGIN in RPATH

Summary

The binaries shipped with GHC on macOS have an RPATH entry that refers to $ORIGIN, a Linux-only dynamic linker variable...

Steps to reproduce

On macOS,

otool -l $(ghc --print-libdir)/../bin/ghc | grep -A2 RPATH

you get

          cmd LC_RPATH
      cmdsize 56
         path @loader_path/../lib/aarch64-osx-ghc-9.8.1 (offset 12)
--
          cmd LC_RPATH
      cmdsize 56
         path $ORIGIN/../../../lib/aarch64-osx-ghc-9.8.1 (offset 12)

Expected behavior

There shouldn't be any RPATH entries referring to $ORIGIN as the macOS loader can't ever resolve it, thus no dynamic library can actually be found there.

Environment

  • GHC version used: 9.8.1, 9.10.1

Optional:

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