Hello community, here is the log from the commit of package ghc for openSUSE:Factory checked in at 2017-10-02 16:53:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc (Old) and /work/SRC/openSUSE:Factory/.ghc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc" Mon Oct 2 16:53:21 2017 rev:57 rq:529937 version:8.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc/ghc.changes 2017-09-17 22:40:08.397375575 +0200 +++ /work/SRC/openSUSE:Factory/.ghc.new/ghc.changes 2017-10-02 16:53:32.144017121 +0200 @@ -1,0 +2,11 @@ +Fri Sep 22 07:57:10 UTC 2017 - ptrommler@icloud.com + +- add 0001-Use-__atomic-intrinsics-for-atomicread-write.patch + * add missing memory barriers on atomic read/write ops + * fixes upstream ticket #14244 +- adjust comment for patch 32 + * the situation with upstream #12537 is improved but not + solved. Patch 32, however, is correct. There are even more + memory barriers missing elsewhere in the compiler. + +------------------------------------------------------------------- New: ---- 0001-Use-__atomic-intrinsics-for-atomicread-write.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc.spec ++++++ --- /var/tmp/diff_new_pack.mgKpYP/_old 2017-10-02 16:53:34.287716234 +0200 +++ /var/tmp/diff_new_pack.mgKpYP/_new 2017-10-02 16:53:34.291715672 +0200 @@ -76,8 +76,10 @@ # PATCH-FIX-UPSTREAM 0001-PPC-CodeGen-fix-lwa-instruction-generation.patch peter.trommler@ohm-hochschule.de -- Fix PPC codegen: Fixes ghc-zeromq4-haskell build on 64-bit PowerPCs Patch30: 0001-PPC-CodeGen-fix-lwa-instruction-generation.patch Patch31: ghc-pie.patch -# PATCH-FIX-UPSTREAM 0001-PPC-Implement-Atomic-operations.patch ptrommler@icloud.com -- Inline atomic operations for PowerPC. This also happens to fix Haskell Trac #12537. +# PATCH-FIX-UPSTREAM 0001-PPC-Implement-Atomic-operations.patch ptrommler@icloud.com -- Inline atomic operations for PowerPC. Patch32: 0001-PPC-Implement-Atomic-operations.patch +# PATCH-FIX-UPSTREAM 0001-Use-__atomic-intrinsics-for-atomicread-write.patch ptrommler@icloud.com -- Fix atomic read and atomic write on platforms that have no native code generator nor LLVM backend. This is s390x for openSUSE. See Haskell Trac #14244. +Patch33: 0001-Use-__atomic-intrinsics-for-atomicread-write.patch # PATCH-FIX-OPENSUSE ghc-8.0.2-Cabal-dynlibdir.patch -- Fix shared library directory location. Patch100: ghc-8.0.2-Cabal-dynlibdir.patch # PATCH-FIX-UPSTREAM buildpath-abi-stability.patch -- debian patch for more stable abi-1 @@ -174,6 +176,7 @@ %patch30 -p1 %patch31 -p1 %patch32 -p1 +%patch33 -p1 %patch100 -p1 %patch110 -p1 %patch111 -p1 ++++++ 0001-Use-__atomic-intrinsics-for-atomicread-write.patch ++++++
From 00d1f097680da6ca718600884794128919dbd87d Mon Sep 17 00:00:00 2001 From: Peter Trommler
Date: Thu, 21 Sep 2017 13:42:58 +0200 Subject: [PATCH] Use __atomic* intrinsics for atomicread/write
--- libraries/ghc-prim/cbits/atomic.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/ghc-prim/cbits/atomic.c b/libraries/ghc-prim/cbits/atomic.c index 2ecbf3461a..e679186394 100644 --- a/libraries/ghc-prim/cbits/atomic.c +++ b/libraries/ghc-prim/cbits/atomic.c @@ -265,28 +265,28 @@ extern StgWord hs_atomicread8(StgWord x); StgWord hs_atomicread8(StgWord x) { - return *(volatile StgWord8 *) x; + return __atomic_load_n((StgWord8 *) x, __ATOMIC_SEQ_CST); } extern StgWord hs_atomicread16(StgWord x); StgWord hs_atomicread16(StgWord x) { - return *(volatile StgWord16 *) x; + return __atomic_load_n((StgWord16 *) x, __ATOMIC_SEQ_CST); } extern StgWord hs_atomicread32(StgWord x); StgWord hs_atomicread32(StgWord x) { - return *(volatile StgWord32 *) x; + return __atomic_load_n((StgWord32 *) x, __ATOMIC_SEQ_CST); } extern StgWord64 hs_atomicread64(StgWord x); StgWord64 hs_atomicread64(StgWord x) { - return *(volatile StgWord64 *) x; + return __atomic_load_n((StgWord64 *) x, __ATOMIC_SEQ_CST); } // AtomicWriteByteArrayOp_Int @@ -295,26 +295,26 @@ extern void hs_atomicwrite8(StgWord x, StgWord val); void hs_atomicwrite8(StgWord x, StgWord val) { - *(volatile StgWord8 *) x = (StgWord8) val; + __atomic_store_n((StgWord8 *) x, (StgWord8) val, __ATOMIC_SEQ_CST); } extern void hs_atomicwrite16(StgWord x, StgWord val); void hs_atomicwrite16(StgWord x, StgWord val) { - *(volatile StgWord16 *) x = (StgWord16) val; + __atomic_store_n((StgWord16 *) x, (StgWord16) val, __ATOMIC_SEQ_CST); } extern void hs_atomicwrite32(StgWord x, StgWord val); void hs_atomicwrite32(StgWord x, StgWord val) { - *(volatile StgWord32 *) x = (StgWord32) val; + __atomic_store_n((StgWord32 *) x, (StgWord32) val, __ATOMIC_SEQ_CST); } extern void hs_atomicwrite64(StgWord x, StgWord64 val); void hs_atomicwrite64(StgWord x, StgWord64 val) { - *(volatile StgWord64 *) x = (StgWord64) val; + __atomic_store_n((StgWord64 *) x, (StgWord64) val, __ATOMIC_SEQ_CST); } -- 2.12.3