summaryrefslogtreecommitdiffstats
path: root/tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch')
-rw-r--r--tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch b/tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch
new file mode 100644
index 0000000..df0d5ff
--- /dev/null
+++ b/tools/bootstrap/ghc/ghc-powerpc-linker-mmap.patch
@@ -0,0 +1,34 @@
+diff -up ghc-7.0.2/rts/Linker.c.fix-powerpc ghc-7.0.2/rts/Linker.c
+--- ghc-7.0.2/rts/Linker.c.fix-powerpc 2011-02-28 19:10:08.000000000 +0100
++++ ghc-7.0.2/rts/Linker.c 2011-04-25 22:20:10.781092305 +0200
+@@ -70,11 +70,12 @@
+ #include <sys/wait.h>
+ #endif
+
+-#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) )
+-/* Don't use mmap on powerpc-apple-darwin as mmap doesn't support
++#if !defined(powerpc_HOST_ARCH) && \
++ ( 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(kfreebsdgnu_HOST_OS) )
++/* Don't use mmap on powerpc_HOST_ARCH 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.
+@@ -2436,7 +2437,11 @@ static void ocFlushInstructionCacheFrom(
+ static void ocFlushInstructionCache( ObjectCode *oc )
+ {
+ /* The main object code */
+- ocFlushInstructionCacheFrom(oc->image + oc->misalignment, oc->fileSize);
++ ocFlushInstructionCacheFrom(oc->image
++#ifdef darwin_HOST_OS
++ + oc->misalignment
++#endif
++ , oc->fileSize);
+
+ /* Jump Islands */
+ ocFlushInstructionCacheFrom(oc->symbol_extras, sizeof(SymbolExtra) * oc->n_symbol_extras);