DSO linking bug (unix package / pthread)

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


Hi,
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-2.4.2.0/libHSunix-2.4.2.0.a(Semaphore__3.o): 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:

    https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

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

Cheers,
Simon



More information about the ghc-devs mailing list