#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 hgolden):

 Replying to [comment:19 bos]:
 > Replying to [comment:17 hgolden]:
 >
 > > To me, this means that ghci dynamic loader can find libstdc++. Note:
 On my system, it is located at /usr/lib/libstdc++.so.5 which is a symlink
 to /usr/lib/libstdc++.so.5.0.7.
 >
 > 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".

 > Right. But that's not my focus here. I might open a separate bug for
 that. This one should remain focused on the library finding issue.

 I still believe that libstdc++ is being found using {{{dlopen}}}. I
 suspect that the reason the initial report couldn't find libstdc++.so was
 that the entry in {{{/lib/ld.so.cache}}} (or its OS X equivalent) was
 missing. Perhaps later you rebuilt {{{/lib/ld.so.cache}}} which may
 explain why you aren't able to reproduce the original error.

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