Skip to content

ghc seems to prefer installed lld to ld.bfd or ld.gold on Linux?

Summary

When I build recent ghc on Fedora Linux and have lld installed ghc seems to use it for linking (even though I didn't request it to (ld.bfd and ld.gold are available)) and this causes rpm debuginfo generation to fail with an 8bit build-id.

(This came up a while back but I didn't get round to report it - hope there isn't an existing bug)

The workaround is just to uninstall the lld linker (from llvm). Another workaround might be to export/pass LD=/usr/bin/ld say.

Steps to reproduce

Build ghc on (Fedora) Linux with lld installed. (I think it may not matter whether it is Hadrian or make.) The GHC build uses ld.lld rather than ld.bfd or ld.gold for its linking.

Expected behavior

GHC to use ld.bfd or ld.gold by default (even if lld is installed in the system)

Environment

  • GHC version used: 9.4, 9.2 (maybe earlier too)

Optional:

  • Operating System: Fedora Linux
  • System Architecture: x86_64

Downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=2116508

Edited by Jens Petersen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information