Skip to content

System-wide installed profile build cannot load libHSghc-prim.0.5.2.0.so

Steps to reproduce:

  1. Make a pristine git checkout
  2. Follow the steps outlined in https://ghc.haskell.org/trac/ghc/wiki/Building/QuickStart, uncommenting the BuildFlavour = prof line in build.mk, to build and install ghc.
  3. Check ghc version to verify that this ghc build is the one in /usr/local/bin
  4. Try to compile the following hello.hs:
{-# LANGUAGE TemplateHaskell #-}

import Language.Haskell.TH

main = putStrLn $(litE (stringL "Hello"))

It should fail with an error message similar to:

<no location info>: error:
    ghc: panic! (the 'impossible' happened)
  (GHC version 8.3.20171120 for x86_64-unknown-linux):
	Dynamic linker not initialised
CallStack (from -prof):
  Linker.CAF (<entire-module>)

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

and:

<no location info>: error:
    <command line>: can't load .so/.DLL for: libHSghc-prim-0.5.2.0.so (libHSghc-prim-0.5.2.0.so: cannot open shared object file: No such file or directory)

By contrast, the following do *not* trigger the error:

  • Building GHC without uncommenting the BuildFlavour line in build.mk
  • Compiling with the inplace/bin/ghc-stage2 in the GHC source tree
  • Compiling a hello.hs that does not use TemplateHaskell

Further system info:

  • Debian 9
  • Cabal version 1.24
  • GHC 8.0.1
Trac metadata
Trac field Value
Version 8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information