[GHC] #7921: DSO linking bug in unix package

#7921: DSO linking bug in unix package -------------------------------+-------------------------------------------- Reporter: SimonHengel | Owner: Type: bug | Status: new Priority: normal | Component: libraries/unix Version: 7.6.3 | Keywords: Os: Linux | Architecture: x86_64 (amd64) Failure: Compile-time crash | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- {{{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. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7921 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7921: DSO linking bug in unix package ---------------------------------+------------------------------------------ Reporter: SimonHengel | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: libraries/unix | Version: 7.6.3 Resolution: worksforme | Keywords: Os: Linux | Architecture: x86_64 (amd64) Failure: Compile-time crash | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ---------------------------------+------------------------------------------ Changes (by igloo): * status: new => closed * difficulty: => Unknown * resolution: => worksforme Comment: The `unix` package has a check for whether `sem_close` requires `pthread` or not in its `configure.ac`: {{{ AC_SEARCH_LIBS(sem_close, pthread, [EXTRA_LIBS="$EXTRA_LIBS $ac_lib"], [AC_MSG_NOTICE([Not found])]) }}} I suspect that you are using a binary that was built on another machine which didn't require pthread, so I'll close this ticket. Please re-open if you still think there's a bug, though. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7921#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC