#5289: Can't use ghci with a library linked against libstdc++
---------------------------------+------------------------------------------
    Reporter:  bos               |        Owner:            
        Type:  bug               |       Status:  new       
    Priority:  normal            |    Milestone:  7.2.1     
   Component:  GHCi              |      Version:  7.0.3     
    Keywords:                    |     Testcase:            
   Blockedby:                    |   Difficulty:            
          Os:  Unknown/Multiple  |     Blocking:            
Architecture:  Unknown/Multiple  |      Failure:  GHCi crash
---------------------------------+------------------------------------------

Comment(by ivanstojic):

 Replying to [comment:20 hgolden]:
 > Replying to [comment:19 bos]:
 > > That's not what {{{ghci}}} is finding. If you run it under
 {{{strace}}}, you'll find that it is picking up a symlink named
 {{{libstdc++.so}}} somewhere else. {{{ghci}}} doesn't search for a shared
 library by its extended name, only with the {{{.so}}} suffix.
 >
 > I was incorrect before about the location of the shared library. Here is
 the correct explanation:
 >
 > {{{dlopen}}} looks in {{{/lib/ld.so.cache}}} for "libstdc++.so" (which
 is what {{{ghci}}} asks for when it gets the option "-lstdc++"). It finds
 the first entry that corresponds to the particular system in use (for me,
 libc6,x86-64). On my system this entry is {{{/usr/lib/gcc/x86_64-pc-linux-
 gnu/4.5.2/libstdc++.so}}}. On my system, that is a symlink to
 {{{/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.2/libstdc++.so.6.0.14}}}.
 >
 > In other words, {{{libstdc++.so}}} is NOT a symlink. It is an entry in
 {{{/lib/ld.so.cache}}}.
 >
 > You can see all the {{{/lib/ld.so.cache}}} entries your system has by
 using the command "ldconfig -p".

 That is indeed so on Linux, but OS X is a vastly different beast.

 From the man pages:

 ''Unlike  many  other operating systems, Darwin does not locate dependent
 dynamic libraries via their leaf file name.  Instead the full path to each
 dylib is used (e.g. /usr/lib/lib-System.B.dylib).
 ''

 I'm not sure how that affects the specified behavior though. To me it
 always looked as if GHCi cannot even locate the library to work with in
 the first place.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5289#comment:21>
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