From a5bffe88e83f499bec27d6dec9d1864988450db6 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 26 Apr 2011 17:40:21 +0900 Subject: [PATCH] add upstream ghc-powerpc-linker-mmap.patch for ppc64 (Jiri Skala) --- ghc-powerpc-linker-mmap.patch | 34 ++++++++++++++++++++++++++++++++++ ghc.spec | 8 +++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 ghc-powerpc-linker-mmap.patch diff --git a/ghc-powerpc-linker-mmap.patch b/ghc-powerpc-linker-mmap.patch new file mode 100644 index 0000000..df0d5ff --- /dev/null +++ b/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 + #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); diff --git a/ghc.spec b/ghc.spec index b787a2f..6a6b11e 100644 --- a/ghc.spec +++ b/ghc.spec @@ -47,7 +47,7 @@ Version: 7.0.2 # - release can only be reset if all library versions get bumped simultaneously # (eg for a major release) # - minor release numbers should be incremented monotonically -Release: 18%{?dist} +Release: 19%{?dist} Summary: Glasgow Haskell Compilation system # fedora ghc has only been bootstrapped on the following archs: ExclusiveArch: %{ix86} x86_64 ppc alpha sparcv9 ppc64 @@ -94,6 +94,8 @@ Patch4: ghc-use-system-libffi.patch Patch5: Cabal-option-executable-dynamic.patch Patch6: ghc-fix-linking-on-sparc.patch Patch7: ghc-ppc64-pthread.patch +# http://hackage.haskell.org/trac/ghc/ticket/4999 +Patch8: ghc-powerpc-linker-mmap.patch %description GHC is a state-of-the-art programming suite for Haskell, a purely @@ -178,6 +180,7 @@ rm -r ghc-tarballs/libffi %ifarch ppc64 %patch7 -p1 -b .pthread +%patch8 -p1 -b .mmap %endif @@ -397,6 +400,9 @@ fi %endif %changelog +* Tue Apr 26 2011 Jens Petersen - 7.0.2-19 +- upstream ghc-powerpc-linker-mmap.patch for ppc64 (Jiri Skala) + * Thu Apr 21 2011 Jiri Skala - 7.0.2-18 - bootstrap to ppc64