[Pkg-haskell-maintainers] Bug#616635: [GHC] #4999: build fails on powerpc: error: 'ObjectCode' has no member named 'misalignment'

GHC cvs-ghc at haskell.org
Sun Mar 6 06:43:24 UTC 2011


#4999: build fails on powerpc:   error: 'ObjectCode' has no member named
'misalignment'
------------------------+---------------------------------------------------
    Reporter:  nomeata  |       Owner:                     
        Type:  bug      |      Status:  new                
    Priority:  normal   |   Component:  Runtime System     
     Version:  7.0.2    |    Keywords:                     
    Testcase:           |   Blockedby:                     
          Os:  Linux    |    Blocking:                     
Architecture:  powerpc  |     Failure:  Building GHC failed
------------------------+---------------------------------------------------
 When building the Debian package for ghc-7.0.2 on powerpc, the build
 fails. Build log at
 https://buildd.debian.org/fetch.cgi?pkg=ghc;ver=7.0.2-1;arch=powerpc;stamp=1299367262
 and relevant portion is:
 {{{
 rts/Linker.c:2440:0:
      error: 'ObjectCode' has no member named 'misalignment'
 }}}

 This is the code in question:
 {{{
 static void ocFlushInstructionCache( ObjectCode *oc )
 {
     /* The main object code */
     ocFlushInstructionCacheFrom(oc->image + oc->misalignment,
 oc->fileSize);

     /* Jump Islands */
     ocFlushInstructionCacheFrom(oc->symbol_extras, sizeof(SymbolExtra) *
 oc->n_symbol_extras);
 }
 }}}
 and it is inside
 {{{
 #ifdef powerpc_HOST_ARCH
 }}}

 The misalignment field is defined as
 {{{
 #ifndef USE_MMAP
 #ifdef darwin_HOST_OS
                        , int misalignment
 #endif
 #endif
 }}}

 And USE_MMAP is true if
 {{{
 #if defined(linux_HOST_OS    ) || defined(freebsd_HOST_OS) || \
     defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
     defined(openbsd_HOST_OS  ) || \
     ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) ) || \
     defined(kfreebsdgnu_HOST_OS) \
 /* Don't use mmap on powerpc-apple-darwin as mmap doesn't support
  * reallocating but we need to allocate jump islands just after each
  * object images. Otherwise relative branches to jump islands can fail
  * due to 24-bits displacement overflow.
  */
 }}}
 (last entry added by Debian, but unrelated to this bug).

 It seems that the correct line here should be
 {{{
     ( !defined(darwin_HOST_OS ) && defined(powerpc_HOST_ARCH) ) || }}}
 so that powerpc builds not on darwin use MMAP?

 Also, I guess the failing line should be modified to also work in the
 absence of the misalignment flag.

 I’d be grateful if you could tell me what exactly to patch here, as I’m
 not confident with the inner workings of the rts and even if I get it to
 compile, I would not be sure that it’s correct.

 Thanks,
 Joachim

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4999>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler





More information about the Pkg-haskell-maintainers mailing list