Skip to content

rpmlint complains: "E: undefined-non-weak-symbol /usr/lib64/ghc-9.4.5/lib/libHS*.so ..."

Summary

Haskell libraries built on Fedora Linux generate a lot rpmlint linking related errors.

See https://bugzilla.redhat.com/show_bug.cgi?id=2241738#c5 and above for one example, but it is pervasive across libraries.

Steps to reproduce

  1. podman run -it --rm fedora:39
  2. dnf install rpmlint ghc-HTTP
  3. rpmlint -i ghc-HTTP
$ rpmlint -i ghc-HTTP | grep undefined-non-weak-symbol | sed -e 's%/usr/lib64/ghc-9.4.5/lib/libHSHTTP-4000.4.1-G6Riw1snTE94zj1b9TsY1b-ghc9.4.5.so %%' -e 's%\t% %' -e 's%/usr/lib64/ghc-9.4.5/lib/%%' | wc -l`
1039

These errors for libHSHTTP-4000.4.1--ghc9.4.5.so look like this:

ghc-language-c99.x86_64: E: undefined-non-weak-symbol /usr/lib64/ghc-9.4.5/lib/libHSlanguage-c99-0.2.0-I2TYFE5SafWGfH3mmM7Uvw-ghc9.4.5.so RtsFlags	(/usr/lib64/ghc-9.4.5/lib/x86_64-linux-ghc-9.4.5/libHSbase-4.17.1.0-ghc9.4.5.so)
ghc-language-c99.x86_64: E: undefined-non-weak-symbol /usr/lib64/ghc-9.4.5/lib/libHSlanguage-c99-0.2.0-I2TYFE5SafWGfH3mmM7Uvw-ghc9.4.5.so __hscore_get_saved_termios	(/usr/lib64/ghc-9.4.5/lib/x86_64-linux-ghc-9.4.5/libHSbase-4.17.1.0-ghc9.4.5.so)
ghc-language-c99.x86_64: E: undefined-non-weak-symbol /usr/lib64/ghc-9.4.5/lib/libHSlanguage-c99-0.2.0-I2TYFE5SafWGfH3mmM7Uvw-ghc9.4.5.so stg_INTLIKE_closure	(/usr/lib64/ghc-9.4.5/lib/x86_64-linux-ghc-9.4.5/libHSghc-bignum-1.3-ghc9.4.5.so)

After above sed processing, eg:

ghc-HTTP.x86_64: E: undefined-non-weak-symbol stg_ap_ppp_fast (libHSHTTP-4000.4.1-G6Riw1snTE94zj1b9TsY1b-ghc9.4.5.so)

906 of them are stg_* symbols.

To additionally rebuild the library from source:

  1. dnf install fedpkg
  2. fedpkg clone ghc-HTTP
  3. cd ghc-HTTP
  4. dnf builddep ghc-HTTP.spec
  5. fedpkg local

Expected behavior

Ideally no rpmlint errors.

Environment

  • GHC version used: 9.4.5 (but same on any recent ghc 9 I believe)

Optional:

  • Operating System: Fedora Linux
  • System Architecture: x86_64
Edited by Jens Petersen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information