DSO linking bug (unix package / pthread)

Simon Hengel sol at typeful.net
Mon May 20 13:25:21 CEST 2013

when I try to use System.Posix.Semaphore.semUnlink on Ubuntu 13.04 I get
the following liker error:

    /usr/bin/ld: /home/sol/.install/haskell/ghc-7.0.4/lib/ghc-7.0.4/unix- undefined reference to symbol 'sem_unlink@@GLIBC_2.2.5'
    /usr/bin/ld: note: 'sem_unlink@@GLIBC_2.2.5' is defined in DSO /lib/x86_64-linux-gnu/libpthread.so.0 so try adding it to the linker command line
    /lib/x86_64-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status

The issue can be reproduced by compiling

    -- Main.hs
    import System.Posix.Semaphore

    main :: IO ()
    main = do
      semUnlink "pwsafe"

with `ghc --make Main.hs`.

Probably related to those changes to DSO liking:


Any chances that we fix this for previous releases, too (I'm interested
in ghc-6.12.1 to ghc-7.6.3)?


More information about the ghc-devs mailing list