Hello community, here is the log from the commit of package ghc for openSUSE:Factory checked in at 2016-05-23 16:39:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc (Old) and /work/SRC/openSUSE:Factory/.ghc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc/ghc.changes 2016-05-17 17:15:38.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc.new/ghc.changes 2016-05-23 16:39:59.000000000 +0200 @@ -1,0 +2,7 @@ +Tue May 17 19:01:13 UTC 2016 - peter.trommler@ohm-hochschule.de + +- add D2225.patch +* backport of upstream patch accepted for ghc 8.0.1 +* fix SMP primitives on all powerpc archs + +------------------------------------------------------------------- New: ---- D2225.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc.spec ++++++ --- /var/tmp/diff_new_pack.SvUoXr/_old 2016-05-23 16:40:01.000000000 +0200 +++ /var/tmp/diff_new_pack.SvUoXr/_new 2016-05-23 16:40:01.000000000 +0200 @@ -86,6 +86,8 @@ Patch24: 0001-Fix-misspelled-WORDS_BIGENDIAN-macro.patch # PATCH-FIX-UPSTREAM D2214.patch peter.trommler@ohm-hochschule.de -- Fix PowerPC code generator. See Haskell Trac #12054 and https://phabricator.haskell.org/D2214 for details. Patch25: D2214.patch +# PATCH-FIX-UPSTREAM D2225.patch peter.trommler@ohm-hochschule.de -- Fix SMP imlementation in Haskell runtime on PPC[64[le]]. Backport of upstreamed patch. See Haskell trac #12070 and https://phabricator.haskell.org/D2225 for details. +Patch26: D2225.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -185,6 +187,7 @@ %patch23 -p2 %patch24 -p1 %patch25 -p1 +%patch26 -p1 %build # Patch 19 modifies build system ++++++ D2225.patch ++++++ Index: ghc-7.10.3/includes/stg/SMP.h =================================================================== --- ghc-7.10.3.orig/includes/stg/SMP.h +++ ghc-7.10.3/includes/stg/SMP.h @@ -119,22 +119,8 @@ xchg(StgPtr p, StgWord w) :"+r" (result), "+m" (*p) : /* no input-only operands */ ); -#elif powerpc_HOST_ARCH - __asm__ __volatile__ ( - "1: lwarx %0, 0, %2\n" - " stwcx. %1, 0, %2\n" - " bne- 1b" - :"=&r" (result) - :"r" (w), "r" (p) - ); -#elif powerpc64_HOST_ARCH || powerpc64le_HOST_ARCH - __asm__ __volatile__ ( - "1: ldarx %0, 0, %2\n" - " stdcx. %1, 0, %2\n" - " bne- 1b" - :"=&r" (result) - :"r" (w), "r" (p) - ); +#elif powerpc_HOST_ARCH || powerpc64_HOST_ARCH || powerpc64le_HOST_ARCH + result = __sync_lock_test_and_set(p, w); #elif sparc_HOST_ARCH result = w; __asm__ __volatile__ ( @@ -202,34 +188,8 @@ cas(StgVolatilePtr p, StgWord o, StgWord :"=a"(o), "+m" (*(volatile unsigned int *)p) :"0" (o), "r" (n)); return o; -#elif powerpc_HOST_ARCH - StgWord result; - __asm__ __volatile__ ( - "1: lwarx %0, 0, %3\n" - " cmpw %0, %1\n" - " bne 2f\n" - " stwcx. %2, 0, %3\n" - " bne- 1b\n" - "2:" - :"=&r" (result) - :"r" (o), "r" (n), "r" (p) - :"cc", "memory" - ); - return result; -#elif powerpc64_HOST_ARCH || powerpc64le_HOST_ARCH - StgWord result; - __asm__ __volatile__ ( - "1: ldarx %0, 0, %3\n" - " cmpd %0, %1\n" - " bne 2f\n" - " stdcx. %2, 0, %3\n" - " bne- 1b\n" - "2:" - :"=&r" (result) - :"r" (o), "r" (n), "r" (p) - :"cc", "memory" - ); - return result; +#elif powerpc_HOST_ARCH || powerpc64_HOST_ARCH || powerpc64le_HOST_ARCH + return __sync_val_compare_and_swap(p, o, n); #elif sparc_HOST_ARCH __asm__ __volatile__ ( "cas [%1], %2, %0" @@ -290,6 +250,7 @@ cas(StgVolatilePtr p, StgWord o, StgWord // RRN: Generalized to arbitrary increments to enable fetch-and-add in // Haskell code (fetchAddIntArray#). +// PT: add-and-fetch, returns new value EXTERN_INLINE StgWord atomic_inc(StgVolatilePtr p, StgWord incr) { @@ -301,6 +262,8 @@ atomic_inc(StgVolatilePtr p, StgWord inc "+r" (r), "+m" (*p): ); return r + incr; +#elif powerpc_HOST_ARCH || powerpc64_HOST_ARCH || powerpc64le_HOST_ARCH + return __sync_add_and_fetch(p, incr); #else StgWord old, new_; do { @@ -322,6 +285,8 @@ atomic_dec(StgVolatilePtr p) "+r" (r), "+m" (*p): ); return r-1; +#elif powerpc_HOST_ARCH || powerpc64_HOST_ARCH || powerpc64le_HOST_ARCH + return __sync_sub_and_fetch(p, (StgWord) 1); #else StgWord old, new_; do {