#4523: unix package does not check properly for sem_close
---------------------------------+------------------------------------------
    Reporter:  bos               |       Owner:                
        Type:  bug               |      Status:  new           
    Priority:  normal            |   Component:  libraries/unix
     Version:  7.0.1             |    Keywords:                
    Testcase:                    |   Blockedby:                
          Os:  Linux             |    Blocking:                
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown  
---------------------------------+------------------------------------------
 On modern Linux systems (in my case, Fedora 13 and 14), the
 {{{sem_close}}} and other functions are in the {{{rt}}} and {{{pthread}}}
 libraries.  This combination is not checked for properly by the {{{unix}}}
 package's {{{autoconf}}} script. As a result attempting to build the
 {{{unix}}} package will succeed, but linking applications against the
 misconfigured {{{unix}}} will result in undefined symbol errors for e.g.
 {{{sem_close}}}.

 I believe that the C compiler needs to be invoked with {{{-pthread}}} for
 the right thing to happen, as {{{unix.buildinfo}}} contains a reference to
 {{{rt}}} that is nevertheless not enough:

 {{{

 buildable: True
 cc-options:
 ld-options:
 extra-libraries:  rt util dl
 }}}

 Here's my current workaround hack:

 {{{

 --- old-unix/configure.ac       2010-11-23 15:25:33.741849630 -0800
 +++ new-unix/configure.ac       2010-11-23 15:25:33.760849987 -0800
 @@ -215,6 +215,9 @@
         PTHREAD_CFLAGS=-pthread
         PTHREAD_LDFLAGS=-pthread
         ;;
 +linux*)
 +       PTHREAD_LIBS=pthread
 +       ;;
  esac
  AC_SUBST(PTHREAD_CFLAGS)
  AC_SUBST(PTHREAD_LDFLAGS)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4523>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to