Skip to content

Linker error after modifying file

Given two files

module C where

import D

c = d
module D where

d = True

perform the following:

$ rm *.hi *.o
$ ghc -dynamic C
[1 of 2] Compiling D                ( D.hs, D.o )
[2 of 2] Compiling C                ( C.hs, C.o )

$ echo "-- change" >> D.hs

$ ghci C
GHCi, version 9.6.1: https://www.haskell.org/ghc/  :? for help
[1 of 2] Compiling D                ( D.hs, interpreted ) [Source file changed]
Ok, two modules loaded.
ghci> c

GHC.Linker.Loader.dynLoadObjs: Loading temp shared object failed
During interactive linking, GHCi couldn't find the following symbol:
  /tmp/ghc39755_0/libghc_2.so: undefined symbol: D_d_closure

Before 9.4, there is no error: C is interpreted rather than compiled.

Found while reviewing !8229.

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