#7062: Spurious undefined reference to `openpty'
---------------------------------+------------------------------------------
    Reporter:  simonmar          |       Owner:                  
        Type:  bug               |      Status:  merge           
    Priority:  high              |   Milestone:  7.4.3           
   Component:  Compiler          |     Version:  7.4.2           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------
Changes (by trommler):

 * cc: ptrommler@… (added)


Comment:

 I came across the --as-needed issue when preparing packages for openSUSE's
 Build Service, where it is set by default.

 The problem is that shared libraries that do not contain symbols that are
 undefined in any object (library or object file) up to the point in the
 command line where the library is mentioned (-l) will not be included in
 the ELF info and especially an Rpath will not be recorded. If the shared
 library is not installed in a standard directory, and Haskell libraries
 will not be in most Linux distributions, then it will not be found. If you
 symlinked those libraries from one of the standard directories then all
 works fine again.

 As a temporary fix I put --no-as-needed into ghc's settings in a patch for
 openSUSE's ghc package.

 To fix the --as-needed issue properly all libraries need to be linked to
 before libraries they depend on and for cycles one library needs to be
 linked twice. For Haskell packages dependency information in the packaging
 system could be used, for system libraries the the correct linking order
 would have to be specified in the extra-libraries field.

 AFAIK Gentoo uses or at least recommends using --as-needed, too. Should we
 deal with this as a feature request in a different ticket?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7062#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to