#3761: 6.12.1 HC bootstrap failes due to suspicious static library ordering
---------------------------------+------------------------------------------
    Reporter:  PHO               |       Owner:                     
        Type:  bug               |      Status:  new                
    Priority:  normal            |   Component:  Build System       
     Version:  6.12.1            |    Keywords:                     
          Os:  Unknown/Multiple  |    Testcase:                     
Architecture:  Unknown/Multiple  |     Failure:  Building GHC failed
---------------------------------+------------------------------------------
 I found ghc-stage2 doesn't link because of the order of static libraries
 passed to gcc. The problem occurs on FreeBSD but I believe it's platform-
 independent.

 The build system puts rts/dist/build/libHSrts.a followed by
 rts/dist/build/libHSrtsmain.a. The latter has an undefined symbol to
 "hs_main" which is defined in libHSrts.a, so the linker complains about
 the absence of hs_main.

 The following patch to rts/ghc.mk solves the problem:
 {{{
 --- ghc.mk.orig 2009-12-11 03:11:33.000000000 +0900
 +++ ghc.mk
 @@ -19,8 +19,9 @@ rts_dist_HC = $(GHC_STAGE1)
  # merge GhcLibWays and GhcRTSWays but strip out duplicates
  rts_WAYS = $(GhcLibWays) $(filter-out $(GhcLibWays),$(GhcRTSWays))

 -ALL_RTS_LIBS = $(foreach
 way,$(rts_WAYS),rts/dist/build/libHSrts$($(way)_libsuf)) \
 -              rts/dist/build/libHSrtsmain.a
 +ALL_RTS_LIBS = rts/dist/build/libHSrtsmain.a \
 +       $(foreach way,$(rts_WAYS),rts/dist/build/libHSrts$($(way)_libsuf))
 +
  all_rts : $(ALL_RTS_LIBS)

  #
 -----------------------------------------------------------------------------
 }}}

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