#4828: ghci fails to load fat binary archives on OS X
---------------------------------+------------------------------------------
    Reporter:  gwright           |        Owner:  igloo     
        Type:  bug               |       Status:  patch     
    Priority:  normal            |    Milestone:  7.2.1     
   Component:  Runtime System    |      Version:  7.0.1     
    Keywords:                    |     Testcase:            
   Blockedby:                    |   Difficulty:            
          Os:  MacOS X           |     Blocking:            
Architecture:  Unknown/Multiple  |      Failure:  GHCi crash
---------------------------------+------------------------------------------

Comment(by gwright):

 I've tested a version of your patch and it loads fat archives correctly.
 (The only difference between your patch and the one I've attached are a
 few typographical corrections.)

 Building with `GhcDebugged=YES`, we can see the result:
 {{{
 plumbbob-franklin> inplace/bin/ghc-stage2 --interactive +RTS -Dl -RTS 2>&1
 | grep loadArchive
 initLinker: inserting rts symbol _loadArchive, 0x101f01bb8
 loadArchive: Loading archive `/opt/local/lib/libiconv.a'
 loadArchive: found a fat archive containing 2 architectures
 loadArchive: found my archive in a fat archive
 loadArchive: Found member file `__.SYMDEF SORTED'
 loadArchive: Found member file `iconv.o'
 loadArchive: Found member file `localcharset.o'
 loadArchive: Found member file `relocatable.o'
 loadArchive: Loading archive `/opt/local/lib/libcharset.a'
 loadArchive: found a fat archive containing 2 architectures
 loadArchive: found my archive in a fat archive
 loadArchive: Found member file `__.SYMDEF SORTED'
 loadArchive: Found member file `localcharset.o'
 loadArchive: Found member file `relocatable.o'
 Prelude>
 }}}

 I checked the loadArchive routine and it does get the length of an archive
 from the archive header, so we should never run past the end.

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