#5004: loading stripped libHsghc-7.0.2.a fails
---------------------------------+------------------------------------------
    Reporter:  pbrisbin          |        Owner:            
        Type:  bug               |       Status:  new       
    Priority:  highest           |    Milestone:  7.2.1     
   Component:  Compiler          |      Version:  7.0.2     
    Keywords:                    |     Testcase:            
   Blockedby:                    |   Difficulty:            
          Os:  Linux             |     Blocking:            
Architecture:  Unknown/Multiple  |      Failure:  GHCi crash
---------------------------------+------------------------------------------

Comment(by twhitehead):

 Just finished running into this on Debian.  Looks like the problem is that
 the ''keepCAFsForGHCi.o'' object file in the archive has no symbols but
 debug ones.

 That is, taking the post-stripped archive from the packaging directory, we
 have

 {{{
 $ nm libHSghc-7.0.3-poststrip.a > /dev/null
 nm: keepCAFsForGHCi.o: no symbols
 $ ar -x libHSghc-7.0.3-poststrip.a keepCAFsForGHCi.o
 $ nm keepCAFsForGHCi.o
 nm: keepCAFsForGHCi.o: no symbols
 $ nm -a keepCAFsForGHCi.o
 nm: keepCAFsForGHCi.o: no symbols
 }}}

 compared to the pre-stripped archive from the install directory, which
 gives

 {{{
 $ nm libHSghc-7.0.3.a > /dev/null
 $ ar -x libHSghc-7.0.3.a keepCAFsForGHCi.o
 $ nm keepCAFsForGHCi.o
 $ nm -a
 0000000000000000 b .bss
 0000000000000000 n .comment
 0000000000000000 d .data
 0000000000000000 n .note.GNU-stack
 0000000000000000 t .text
 0000000000000000 a keepCAFsForGHCi.c
 $
 }}}

 (the ''-a'' flag causes ''nm'' to also list debug symbols).

 Replacing just ''keepCAFsForGHCi.o'' in the post-stripped archive with
 that from the pre-stripped archive is enough to make GHC work again.

 I see the associated source file seems to only exist to set the
 ''keepCAFs'' variable via a ''constructor'' flagged function.  As this
 variable seems to be local (there is no corresponding undefined symbol),
 I'm a bit confused as to what it is suppose to do.

 In any event, even if it is still used, this can likely be easily worked
 around by simply adding a bogus non-static symbol as well so stripping
 won't produce no symbols.

 Cheers!  -Tyson

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