Ticket #4999: 0001-Fix-compiling-on-linux-powerpc.patch

File 0001-Fix-compiling-on-linux-powerpc.patch, 1.8 KB (added by erikd, 2 years ago)

Minimal patch (against current git head) to fix this particular compile issue.

  • rts/Linker.c

    From 0682b7aed2d0a502c1e423f17a64acbbcf5f1df2 Mon Sep 17 00:00:00 2001
    From: Erik de Castro Lopo <erikd@mega-nerd.com>
    Date: Mon, 4 Apr 2011 22:40:15 +1000
    Subject: [PATCH] Fix compiling on linux-powerpc.
    
    ---
     rts/Linker.c |   18 +++++++++++-------
     1 files changed, 11 insertions(+), 7 deletions(-)
    
    diff --git a/rts/Linker.c b/rts/Linker.c
    index d2fb4f7..57c6e6c 100644
    a b  
    7070#include <sys/wait.h> 
    7171#endif 
    7272 
    73 #if defined(linux_HOST_OS    ) || defined(freebsd_HOST_OS) || \ 
    74     defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \ 
    75     defined(openbsd_HOST_OS ) || \ 
    76     ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) ) || \ 
    77     defined(kfreebsdgnu_HOST_OS) 
    78 /* Don't use mmap on powerpc-apple-darwin as mmap doesn't support 
     73#if !defined(powerpc_HOST_ARCH) && \ 
     74    (   defined(linux_HOST_OS    ) || defined(freebsd_HOST_OS) || \ 
     75        defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \ 
     76        defined(openbsd_HOST_OS  ) || defined(darwin_HOST_OS ) || \ 
     77        defined(kfreebsdgnu_HOST_OS) ) 
     78/* Don't use mmap on powerpc_HOST_ARCH as mmap doesn't support 
    7979 * reallocating but we need to allocate jump islands just after each 
    8080 * object images. Otherwise relative branches to jump islands can fail 
    8181 * due to 24-bits displacement overflow. 
     
    24842484ocFlushInstructionCache( ObjectCode *oc ) 
    24852485{ 
    24862486    /* The main object code */ 
    2487     ocFlushInstructionCacheFrom(oc->image + oc->misalignment, oc->fileSize); 
     2487    ocFlushInstructionCacheFrom(oc->image 
     2488#ifdef darwin_HOST_OS 
     2489            + oc->misalignment 
     2490#endif 
     2491            , oc->fileSize); 
    24882492 
    24892493    /* Jump Islands */ 
    24902494    ocFlushInstructionCacheFrom(oc->symbol_extras, sizeof(SymbolExtra) * oc->n_symbol_extras);