DSO linking bug in unix package
unix depends on libpthread, but it's not listed under extra-libraries in the cabal file. For that reason some programs fail to build on Ubuntu 13.04.
Steps to reproduce:
-- Main.hs
import System.Posix.Semaphore
main :: IO ()
main = do
semUnlink "foo"
$ ghc --make Main.hs
Expected result: Program is compiled and linked.
Actual result: Liking fails with
/usr/bin/ld: /home/foo/.install/haskell/ghc-7.6.2/lib/ghc-7.6.2/unix-2.6.0.1/libHSunix-2.6.0.1.a(Semaphore__5.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
This is related to https://fedoraproject.org/wiki/UnderstandingDSOLinkChange.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.6.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/unix |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |