DSO linking bug (unix package / pthread)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

DSO linking bug (unix package / pthread)

Simon Hengel
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