From: Ilias Tsitsimpis Date: Tue, 11 Aug 2020 14:12:43 +0000 (+0100) Subject: Do not define hs_atomic{read,write}64() on non-64bit X-Git-Tag: archive/raspbian/8.8.4-1+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f098886683ba51fad187e4812aa69bfd7b0ab12b;p=ghc.git Do not define hs_atomic{read,write}64() on non-64bit Bug: https://gitlab.haskell.org/ghc/ghc/issues/17886 Forwarded: https://gitlab.haskell.org/ghc/ghc/merge_requests/2804 Gbp-Pq: Name fix-32bit-atomic --- diff --git a/libraries/ghc-prim/cbits/atomic.c b/libraries/ghc-prim/cbits/atomic.c index ea961206..8396e767 100644 --- a/libraries/ghc-prim/cbits/atomic.c +++ b/libraries/ghc-prim/cbits/atomic.c @@ -361,6 +361,7 @@ hs_atomicread32(StgWord x) #endif } +#if WORD_SIZE_IN_BITS == 64 extern StgWord64 hs_atomicread64(StgWord x); StgWord64 hs_atomicread64(StgWord x) @@ -371,6 +372,7 @@ hs_atomicread64(StgWord x) return __sync_add_and_fetch((StgWord64 *) x, 0); #endif } +#endif // AtomicWriteByteArrayOp_Int // Implies a full memory barrier (see compiler/prelude/primops.txt.pp) @@ -409,6 +411,7 @@ hs_atomicwrite32(StgWord x, StgWord val) #endif } +#if WORD_SIZE_IN_BITS == 64 extern void hs_atomicwrite64(StgWord x, StgWord64 val); void hs_atomicwrite64(StgWord x, StgWord64 val) @@ -420,3 +423,5 @@ hs_atomicwrite64(StgWord x, StgWord64 val) #endif } #endif + +#endif