#5289: Can't use ghci with a library linked against libstdc++
-------------------------+--------------------------------------------------
  Reporter:  bos         |          Owner:  simonmar        
      Type:  bug         |         Status:  closed          
  Priority:  high        |      Milestone:  7.2.1           
 Component:  GHCi        |        Version:  7.0.3           
Resolution:  fixed       |       Keywords:                  
  Testcase:              |      Blockedby:                  
Difficulty:              |             Os:  Unknown/Multiple
  Blocking:              |   Architecture:  Unknown/Multiple
   Failure:  GHCi crash  |  
-------------------------+--------------------------------------------------
Changes (by simonmar):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Replying to [comment:25 bos]:
 > The main consequence of the distinction that I can see is that a
 {{{#!/usr/bin/runghc}}} script will not work under your view of things
 unless a `-devel` package is installed. I've never seen such a script in
 the wild except for `Setup.lhs`, so that doesn't seem like a big deal to
 me.

 This is true, however if that becomes a problem then GHC should be made to
 depend on the `-devel` versions of the system libraries it depends on.

 > Cool! Will that same fallback work for both `runghc` and Template
 Haskell? Certainly TH is affected by this bug, so I assume that all users
 of the GHC API would be. (Actually, that makes me wonder about some of the
 web-development packages that use dynamic reloading.)

 Yes: GHCi, runghc and TH all use the same linking mechanisms inside GHC.

 This does *not* work on Windows currently.  Here's the current situation;
 see #4468 for background.

 You can force the `stdc++` DLL to be loaded in GHCi by asking for it
 explicitly, ''and'' adding `mingw/bin` from your GHC installation to the
 `PATH`, so that the other DLLs it depends on can be found:

 {{{
 PATH=c:/ghc/ghc-7.2.1/mingw/bin:$PATH
 ghci c:/ghc/ghc-7.2.1/mingw/bin/libstdc++-6.dll
 }}}

 Note the DLL is called `libstdc++-6.dll`, so it won't be found by the
 normal search strategy.

 We have a static `libstdc++.a`, but it probably isn't a good idea to load
 this into GHCi because GHC's linker won't run the constructors.  I'm
 guessing that would be a problem for C++ code, but I haven't tried it.

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