Accepting request 336458 from home:Andreas_Schwab:Factory
- atomic-cast.patch: fix signature of atomic bultins - ghc-7.8-arm-use-ld-gold.patch: remove obsolete patch OBS-URL: https://build.opensuse.org/request/show/336458 OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=191
This commit is contained in:
parent
d2ad58f410
commit
dfc7b78992
546
atomic-cast.patch
Normal file
546
atomic-cast.patch
Normal file
@ -0,0 +1,546 @@
|
||||
From e3d2bab86fc89113f8ee65800fdfac81d8d54851 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schwab <schwab@suse.de>
|
||||
Date: Fri, 2 Oct 2015 23:03:12 +0200
|
||||
Subject: [PATCH] Fix signature of atomic builtins
|
||||
|
||||
This patch is due to Andreas Schwab.
|
||||
|
||||
This fixes #10926, which reports (on AArch64) errors of the form,
|
||||
|
||||
```
|
||||
/tmp/ghc1492_0/ghc_1.hc:2844:25: warning: passing argument 1 of
|
||||
'hs_atomic_xor64' makes pointer from integer without a cast
|
||||
[-Wint-conversion]
|
||||
_c1Ho = hs_atomic_xor64((*Sp) + (((Sp[1]) << 0x3UL) + 0x10UL), Sp[2]);
|
||||
^
|
||||
|
||||
In file included from
|
||||
/home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/Stg.h:273:0: 0,
|
||||
from /tmp/ghc1492_0/ghc_1.hc:3:
|
||||
|
||||
/home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/stg/Prim.h:41:11:
|
||||
note: expected 'volatile StgWord64 *
|
||||
{aka volatile long unsigned int *}'
|
||||
but argument is of type 'long unsigned int'
|
||||
StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val);
|
||||
^
|
||||
```
|
||||
|
||||
Test Plan: Validate
|
||||
|
||||
Reviewers: austin, simonmar
|
||||
|
||||
Reviewed By: simonmar
|
||||
|
||||
Subscribers: thomie
|
||||
|
||||
Differential Revision: https://phabricator.haskell.org/D1300
|
||||
|
||||
GHC Trac Issues: #10926
|
||||
---
|
||||
includes/stg/Prim.h | 72 ++++++------
|
||||
libraries/ghc-prim/cbits/atomic.c | 224 +++++++++++++++++++-------------------
|
||||
2 files changed, 148 insertions(+), 148 deletions(-)
|
||||
|
||||
Index: ghc-7.10.2/includes/stg/Prim.h
|
||||
===================================================================
|
||||
--- ghc-7.10.2.orig/includes/stg/Prim.h
|
||||
+++ ghc-7.10.2/includes/stg/Prim.h
|
||||
@@ -15,42 +15,42 @@
|
||||
#define PRIM_H
|
||||
|
||||
/* libraries/ghc-prim/cbits/atomic.c */
|
||||
-StgWord hs_atomic_add8(volatile StgWord8 *x, StgWord val);
|
||||
-StgWord hs_atomic_add16(volatile StgWord16 *x, StgWord val);
|
||||
-StgWord hs_atomic_add32(volatile StgWord32 *x, StgWord val);
|
||||
-StgWord64 hs_atomic_add64(volatile StgWord64 *x, StgWord64 val);
|
||||
-StgWord hs_atomic_sub8(volatile StgWord8 *x, StgWord val);
|
||||
-StgWord hs_atomic_sub16(volatile StgWord16 *x, StgWord val);
|
||||
-StgWord hs_atomic_sub32(volatile StgWord32 *x, StgWord val);
|
||||
-StgWord64 hs_atomic_sub64(volatile StgWord64 *x, StgWord64 val);
|
||||
-StgWord hs_atomic_and8(volatile StgWord8 *x, StgWord val);
|
||||
-StgWord hs_atomic_and16(volatile StgWord16 *x, StgWord val);
|
||||
-StgWord hs_atomic_and32(volatile StgWord32 *x, StgWord val);
|
||||
-StgWord64 hs_atomic_and64(volatile StgWord64 *x, StgWord64 val);
|
||||
-StgWord hs_atomic_nand8(volatile StgWord8 *x, StgWord val);
|
||||
-StgWord hs_atomic_nand16(volatile StgWord16 *x, StgWord val);
|
||||
-StgWord hs_atomic_nand32(volatile StgWord32 *x, StgWord val);
|
||||
-StgWord64 hs_atomic_nand64(volatile StgWord64 *x, StgWord64 val);
|
||||
-StgWord hs_atomic_or8(volatile StgWord8 *x, StgWord val);
|
||||
-StgWord hs_atomic_or16(volatile StgWord16 *x, StgWord val);
|
||||
-StgWord hs_atomic_or32(volatile StgWord32 *x, StgWord val);
|
||||
-StgWord64 hs_atomic_or64(volatile StgWord64 *x, StgWord64 val);
|
||||
-StgWord hs_atomic_xor8(volatile StgWord8 *x, StgWord val);
|
||||
-StgWord hs_atomic_xor16(volatile StgWord16 *x, StgWord val);
|
||||
-StgWord hs_atomic_xor32(volatile StgWord32 *x, StgWord val);
|
||||
-StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val);
|
||||
-StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new);
|
||||
-StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new);
|
||||
-StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new);
|
||||
-StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new);
|
||||
-StgWord hs_atomicread8(volatile StgWord8 *x);
|
||||
-StgWord hs_atomicread16(volatile StgWord16 *x);
|
||||
-StgWord hs_atomicread32(volatile StgWord32 *x);
|
||||
-StgWord64 hs_atomicread64(volatile StgWord64 *x);
|
||||
-void hs_atomicwrite8(volatile StgWord8 *x, StgWord val);
|
||||
-void hs_atomicwrite16(volatile StgWord16 *x, StgWord val);
|
||||
-void hs_atomicwrite32(volatile StgWord32 *x, StgWord val);
|
||||
-void hs_atomicwrite64(volatile StgWord64 *x, StgWord64 val);
|
||||
+StgWord hs_atomic_add8(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_add16(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_add32(StgWord x, StgWord val);
|
||||
+StgWord64 hs_atomic_add64(StgWord x, StgWord64 val);
|
||||
+StgWord hs_atomic_sub8(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_sub16(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_sub32(StgWord x, StgWord val);
|
||||
+StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val);
|
||||
+StgWord hs_atomic_and8(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_and16(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_and32(StgWord x, StgWord val);
|
||||
+StgWord64 hs_atomic_and64(StgWord x, StgWord64 val);
|
||||
+StgWord hs_atomic_nand8(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_nand16(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_nand32(StgWord x, StgWord val);
|
||||
+StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val);
|
||||
+StgWord hs_atomic_or8(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_or16(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_or32(StgWord x, StgWord val);
|
||||
+StgWord64 hs_atomic_or64(StgWord x, StgWord64 val);
|
||||
+StgWord hs_atomic_xor8(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_xor16(StgWord x, StgWord val);
|
||||
+StgWord hs_atomic_xor32(StgWord x, StgWord val);
|
||||
+StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val);
|
||||
+StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new);
|
||||
+StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new);
|
||||
+StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new);
|
||||
+StgWord hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new);
|
||||
+StgWord hs_atomicread8(StgWord x);
|
||||
+StgWord hs_atomicread16(StgWord x);
|
||||
+StgWord hs_atomicread32(StgWord x);
|
||||
+StgWord64 hs_atomicread64(StgWord x);
|
||||
+void hs_atomicwrite8(StgWord x, StgWord val);
|
||||
+void hs_atomicwrite16(StgWord x, StgWord val);
|
||||
+void hs_atomicwrite32(StgWord x, StgWord val);
|
||||
+void hs_atomicwrite64(StgWord x, StgWord64 val);
|
||||
|
||||
/* libraries/ghc-prim/cbits/bswap.c */
|
||||
StgWord16 hs_bswap16(StgWord16 x);
|
||||
Index: ghc-7.10.2/libraries/ghc-prim/cbits/atomic.c
|
||||
===================================================================
|
||||
--- ghc-7.10.2.orig/libraries/ghc-prim/cbits/atomic.c
|
||||
+++ ghc-7.10.2/libraries/ghc-prim/cbits/atomic.c
|
||||
@@ -11,97 +11,97 @@
|
||||
|
||||
// FetchAddByteArrayOp_Int
|
||||
|
||||
-extern StgWord hs_atomic_add8(volatile StgWord8 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_add8(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_add8(volatile StgWord8 *x, StgWord val)
|
||||
+hs_atomic_add8(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_add(x, (StgWord8) val);
|
||||
+ return __sync_fetch_and_add((volatile StgWord8 *) x, (StgWord8) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_add16(volatile StgWord16 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_add16(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_add16(volatile StgWord16 *x, StgWord val)
|
||||
+hs_atomic_add16(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_add(x, (StgWord16) val);
|
||||
+ return __sync_fetch_and_add((volatile StgWord16 *) x, (StgWord16) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_add32(volatile StgWord32 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_add32(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_add32(volatile StgWord32 *x, StgWord val)
|
||||
+hs_atomic_add32(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_add(x, (StgWord32) val);
|
||||
+ return __sync_fetch_and_add((volatile StgWord32 *) x, (StgWord32) val);
|
||||
}
|
||||
|
||||
#if WORD_SIZE_IN_BITS == 64
|
||||
-extern StgWord64 hs_atomic_add64(volatile StgWord64 *x, StgWord64 val);
|
||||
+extern StgWord64 hs_atomic_add64(StgWord x, StgWord64 val);
|
||||
StgWord64
|
||||
-hs_atomic_add64(volatile StgWord64 *x, StgWord64 val)
|
||||
+hs_atomic_add64(StgWord x, StgWord64 val)
|
||||
{
|
||||
- return __sync_fetch_and_add(x, val);
|
||||
+ return __sync_fetch_and_add((volatile StgWord64 *) x, val);
|
||||
}
|
||||
#endif
|
||||
|
||||
// FetchSubByteArrayOp_Int
|
||||
|
||||
-extern StgWord hs_atomic_sub8(volatile StgWord8 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_sub8(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_sub8(volatile StgWord8 *x, StgWord val)
|
||||
+hs_atomic_sub8(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_sub(x, (StgWord8) val);
|
||||
+ return __sync_fetch_and_sub((volatile StgWord8 *) x, (StgWord8) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_sub16(volatile StgWord16 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_sub16(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_sub16(volatile StgWord16 *x, StgWord val)
|
||||
+hs_atomic_sub16(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_sub(x, (StgWord16) val);
|
||||
+ return __sync_fetch_and_sub((volatile StgWord16 *) x, (StgWord16) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_sub32(volatile StgWord32 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_sub32(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_sub32(volatile StgWord32 *x, StgWord val)
|
||||
+hs_atomic_sub32(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_sub(x, (StgWord32) val);
|
||||
+ return __sync_fetch_and_sub((volatile StgWord32 *) x, (StgWord32) val);
|
||||
}
|
||||
|
||||
#if WORD_SIZE_IN_BITS == 64
|
||||
-extern StgWord64 hs_atomic_sub64(volatile StgWord64 *x, StgWord64 val);
|
||||
+extern StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val);
|
||||
StgWord64
|
||||
-hs_atomic_sub64(volatile StgWord64 *x, StgWord64 val)
|
||||
+hs_atomic_sub64(StgWord x, StgWord64 val)
|
||||
{
|
||||
- return __sync_fetch_and_sub(x, val);
|
||||
+ return __sync_fetch_and_sub((volatile StgWord64 *) x, val);
|
||||
}
|
||||
#endif
|
||||
|
||||
// FetchAndByteArrayOp_Int
|
||||
|
||||
-extern StgWord hs_atomic_and8(volatile StgWord8 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_and8(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_and8(volatile StgWord8 *x, StgWord val)
|
||||
+hs_atomic_and8(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_and(x, (StgWord8) val);
|
||||
+ return __sync_fetch_and_and((volatile StgWord8 *) x, (StgWord8) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_and16(volatile StgWord16 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_and16(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_and16(volatile StgWord16 *x, StgWord val)
|
||||
+hs_atomic_and16(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_and(x, (StgWord16) val);
|
||||
+ return __sync_fetch_and_and((volatile StgWord16 *) x, (StgWord16) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_and32(volatile StgWord32 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_and32(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_and32(volatile StgWord32 *x, StgWord val)
|
||||
+hs_atomic_and32(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_and(x, (StgWord32) val);
|
||||
+ return __sync_fetch_and_and((volatile StgWord32 *) x, (StgWord32) val);
|
||||
}
|
||||
|
||||
#if WORD_SIZE_IN_BITS == 64
|
||||
-extern StgWord64 hs_atomic_and64(volatile StgWord64 *x, StgWord64 val);
|
||||
+extern StgWord64 hs_atomic_and64(StgWord x, StgWord64 val);
|
||||
StgWord64
|
||||
-hs_atomic_and64(volatile StgWord64 *x, StgWord64 val)
|
||||
+hs_atomic_and64(StgWord x, StgWord64 val)
|
||||
{
|
||||
- return __sync_fetch_and_and(x, val);
|
||||
+ return __sync_fetch_and_and((volatile StgWord64 *) x, val);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -117,204 +117,204 @@ hs_atomic_and64(volatile StgWord64 *x, S
|
||||
return tmp; \
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_nand8(volatile StgWord8 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_nand8(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_nand8(volatile StgWord8 *x, StgWord val)
|
||||
+hs_atomic_nand8(StgWord x, StgWord val)
|
||||
{
|
||||
#ifdef __clang__
|
||||
- CAS_NAND(x, (StgWord8) val)
|
||||
+ CAS_NAND((volatile StgWord8 *) x, (StgWord8) val)
|
||||
#else
|
||||
- return __sync_fetch_and_nand(x, (StgWord8) val);
|
||||
+ return __sync_fetch_and_nand((volatile StgWord8 *) x, (StgWord8) val);
|
||||
#endif
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_nand16(volatile StgWord16 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_nand16(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_nand16(volatile StgWord16 *x, StgWord val)
|
||||
+hs_atomic_nand16(StgWord x, StgWord val)
|
||||
{
|
||||
#ifdef __clang__
|
||||
- CAS_NAND(x, (StgWord16) val);
|
||||
+ CAS_NAND((volatile StgWord16 *) x, (StgWord16) val);
|
||||
#else
|
||||
- return __sync_fetch_and_nand(x, (StgWord16) val);
|
||||
+ return __sync_fetch_and_nand((volatile StgWord16 *) x, (StgWord16) val);
|
||||
#endif
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_nand32(volatile StgWord32 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_nand32(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_nand32(volatile StgWord32 *x, StgWord val)
|
||||
+hs_atomic_nand32(StgWord x, StgWord val)
|
||||
{
|
||||
#ifdef __clang__
|
||||
- CAS_NAND(x, (StgWord32) val);
|
||||
+ CAS_NAND((volatile StgWord32 *) x, (StgWord32) val);
|
||||
#else
|
||||
- return __sync_fetch_and_nand(x, (StgWord32) val);
|
||||
+ return __sync_fetch_and_nand((volatile StgWord32 *) x, (StgWord32) val);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if WORD_SIZE_IN_BITS == 64
|
||||
-extern StgWord64 hs_atomic_nand64(volatile StgWord64 *x, StgWord64 val);
|
||||
+extern StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val);
|
||||
StgWord64
|
||||
-hs_atomic_nand64(volatile StgWord64 *x, StgWord64 val)
|
||||
+hs_atomic_nand64(StgWord x, StgWord64 val)
|
||||
{
|
||||
#ifdef __clang__
|
||||
- CAS_NAND(x, val);
|
||||
+ CAS_NAND((volatile StgWord64 *) x, val);
|
||||
#else
|
||||
- return __sync_fetch_and_nand(x, val);
|
||||
+ return __sync_fetch_and_nand((volatile StgWord64 *) x, val);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// FetchOrByteArrayOp_Int
|
||||
|
||||
-extern StgWord hs_atomic_or8(volatile StgWord8 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_or8(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_or8(volatile StgWord8 *x, StgWord val)
|
||||
+hs_atomic_or8(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_or(x, (StgWord8) val);
|
||||
+ return __sync_fetch_and_or((volatile StgWord8 *) x, (StgWord8) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_or16(volatile StgWord16 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_or16(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_or16(volatile StgWord16 *x, StgWord val)
|
||||
+hs_atomic_or16(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_or(x, (StgWord16) val);
|
||||
+ return __sync_fetch_and_or((volatile StgWord16 *) x, (StgWord16) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_or32(volatile StgWord32 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_or32(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_or32(volatile StgWord32 *x, StgWord val)
|
||||
+hs_atomic_or32(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_or(x, (StgWord32) val);
|
||||
+ return __sync_fetch_and_or((volatile StgWord32 *) x, (StgWord32) val);
|
||||
}
|
||||
|
||||
#if WORD_SIZE_IN_BITS == 64
|
||||
-extern StgWord64 hs_atomic_or64(volatile StgWord64 *x, StgWord64 val);
|
||||
+extern StgWord64 hs_atomic_or64(StgWord x, StgWord64 val);
|
||||
StgWord64
|
||||
-hs_atomic_or64(volatile StgWord64 *x, StgWord64 val)
|
||||
+hs_atomic_or64(StgWord x, StgWord64 val)
|
||||
{
|
||||
- return __sync_fetch_and_or(x, val);
|
||||
+ return __sync_fetch_and_or((volatile StgWord64 *) x, val);
|
||||
}
|
||||
#endif
|
||||
|
||||
// FetchXorByteArrayOp_Int
|
||||
|
||||
-extern StgWord hs_atomic_xor8(volatile StgWord8 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_xor8(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_xor8(volatile StgWord8 *x, StgWord val)
|
||||
+hs_atomic_xor8(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_xor(x, (StgWord8) val);
|
||||
+ return __sync_fetch_and_xor((volatile StgWord8 *) x, (StgWord8) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_xor16(volatile StgWord16 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_xor16(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_xor16(volatile StgWord16 *x, StgWord val)
|
||||
+hs_atomic_xor16(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_xor(x, (StgWord16) val);
|
||||
+ return __sync_fetch_and_xor((volatile StgWord16 *) x, (StgWord16) val);
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomic_xor32(volatile StgWord32 *x, StgWord val);
|
||||
+extern StgWord hs_atomic_xor32(StgWord x, StgWord val);
|
||||
StgWord
|
||||
-hs_atomic_xor32(volatile StgWord32 *x, StgWord val)
|
||||
+hs_atomic_xor32(StgWord x, StgWord val)
|
||||
{
|
||||
- return __sync_fetch_and_xor(x, (StgWord32) val);
|
||||
+ return __sync_fetch_and_xor((volatile StgWord32 *) x, (StgWord32) val);
|
||||
}
|
||||
|
||||
#if WORD_SIZE_IN_BITS == 64
|
||||
-extern StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val);
|
||||
+extern StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val);
|
||||
StgWord64
|
||||
-hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val)
|
||||
+hs_atomic_xor64(StgWord x, StgWord64 val)
|
||||
{
|
||||
- return __sync_fetch_and_xor(x, val);
|
||||
+ return __sync_fetch_and_xor((volatile StgWord64 *) x, val);
|
||||
}
|
||||
#endif
|
||||
|
||||
// CasByteArrayOp_Int
|
||||
|
||||
-extern StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new);
|
||||
+extern StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new);
|
||||
StgWord
|
||||
-hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new)
|
||||
+hs_cmpxchg8(StgWord x, StgWord old, StgWord new)
|
||||
{
|
||||
- return __sync_val_compare_and_swap(x, (StgWord8) old, (StgWord8) new);
|
||||
+ return __sync_val_compare_and_swap((volatile StgWord8 *) x, (StgWord8) old, (StgWord8) new);
|
||||
}
|
||||
|
||||
-extern StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new);
|
||||
+extern StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new);
|
||||
StgWord
|
||||
-hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new)
|
||||
+hs_cmpxchg16(StgWord x, StgWord old, StgWord new)
|
||||
{
|
||||
- return __sync_val_compare_and_swap(x, (StgWord16) old, (StgWord16) new);
|
||||
+ return __sync_val_compare_and_swap((volatile StgWord16 *) x, (StgWord16) old, (StgWord16) new);
|
||||
}
|
||||
|
||||
-extern StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new);
|
||||
+extern StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new);
|
||||
StgWord
|
||||
-hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new)
|
||||
+hs_cmpxchg32(StgWord x, StgWord old, StgWord new)
|
||||
{
|
||||
- return __sync_val_compare_and_swap(x, (StgWord32) old, (StgWord32) new);
|
||||
+ return __sync_val_compare_and_swap((volatile StgWord32 *) x, (StgWord32) old, (StgWord32) new);
|
||||
}
|
||||
|
||||
#if WORD_SIZE_IN_BITS == 64
|
||||
-extern StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new);
|
||||
+extern StgWord hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new);
|
||||
StgWord
|
||||
-hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new)
|
||||
+hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
|
||||
{
|
||||
- return __sync_val_compare_and_swap(x, old, new);
|
||||
+ return __sync_val_compare_and_swap((volatile StgWord64 *) x, old, new);
|
||||
}
|
||||
#endif
|
||||
|
||||
// AtomicReadByteArrayOp_Int
|
||||
|
||||
-extern StgWord hs_atomicread8(volatile StgWord8 *x);
|
||||
+extern StgWord hs_atomicread8(StgWord x);
|
||||
StgWord
|
||||
-hs_atomicread8(volatile StgWord8 *x)
|
||||
+hs_atomicread8(StgWord x)
|
||||
{
|
||||
- return *x;
|
||||
+ return *(volatile StgWord8 *) x;
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomicread16(volatile StgWord16 *x);
|
||||
+extern StgWord hs_atomicread16(StgWord x);
|
||||
StgWord
|
||||
-hs_atomicread16(volatile StgWord16 *x)
|
||||
+hs_atomicread16(StgWord x)
|
||||
{
|
||||
- return *x;
|
||||
+ return *(volatile StgWord16 *) x;
|
||||
}
|
||||
|
||||
-extern StgWord hs_atomicread32(volatile StgWord32 *x);
|
||||
+extern StgWord hs_atomicread32(StgWord x);
|
||||
StgWord
|
||||
-hs_atomicread32(volatile StgWord32 *x)
|
||||
+hs_atomicread32(StgWord x)
|
||||
{
|
||||
- return *x;
|
||||
+ return *(volatile StgWord32 *) x;
|
||||
}
|
||||
|
||||
-extern StgWord64 hs_atomicread64(volatile StgWord64 *x);
|
||||
+extern StgWord64 hs_atomicread64(StgWord x);
|
||||
StgWord64
|
||||
-hs_atomicread64(volatile StgWord64 *x)
|
||||
+hs_atomicread64(StgWord x)
|
||||
{
|
||||
- return *x;
|
||||
+ return *(volatile StgWord64 *) x;
|
||||
}
|
||||
|
||||
// AtomicWriteByteArrayOp_Int
|
||||
|
||||
-extern void hs_atomicwrite8(volatile StgWord8 *x, StgWord val);
|
||||
+extern void hs_atomicwrite8(StgWord x, StgWord val);
|
||||
void
|
||||
-hs_atomicwrite8(volatile StgWord8 *x, StgWord val)
|
||||
+hs_atomicwrite8(StgWord x, StgWord val)
|
||||
{
|
||||
- *x = (StgWord8) val;
|
||||
+ *(volatile StgWord8 *) x = (StgWord8) val;
|
||||
}
|
||||
|
||||
-extern void hs_atomicwrite16(volatile StgWord16 *x, StgWord val);
|
||||
+extern void hs_atomicwrite16(StgWord x, StgWord val);
|
||||
void
|
||||
-hs_atomicwrite16(volatile StgWord16 *x, StgWord val)
|
||||
+hs_atomicwrite16(StgWord x, StgWord val)
|
||||
{
|
||||
- *x = (StgWord16) val;
|
||||
+ *(volatile StgWord16 *) x = (StgWord16) val;
|
||||
}
|
||||
|
||||
-extern void hs_atomicwrite32(volatile StgWord32 *x, StgWord val);
|
||||
+extern void hs_atomicwrite32(StgWord x, StgWord val);
|
||||
void
|
||||
-hs_atomicwrite32(volatile StgWord32 *x, StgWord val)
|
||||
+hs_atomicwrite32(StgWord x, StgWord val)
|
||||
{
|
||||
- *x = (StgWord32) val;
|
||||
+ *(volatile StgWord32 *) x = (StgWord32) val;
|
||||
}
|
||||
|
||||
-extern void hs_atomicwrite64(volatile StgWord64 *x, StgWord64 val);
|
||||
+extern void hs_atomicwrite64(StgWord x, StgWord64 val);
|
||||
void
|
||||
-hs_atomicwrite64(volatile StgWord64 *x, StgWord64 val)
|
||||
+hs_atomicwrite64(StgWord x, StgWord64 val)
|
||||
{
|
||||
- *x = (StgWord64) val;
|
||||
+ *(volatile StgWord64 *) x = (StgWord64) val;
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
armv7 by nomeata: https://ghc.haskell.org/trac/ghc/ticket/8976#comment:12
|
||||
arm64 backport of https://ghc.haskell.org/trac/ghc/ticket/9673#comment:28 (erikd)
|
||||
|
||||
--- ghc-7.8.4/aclocal.m4.24~ 2015-04-01 04:48:39.961193022 -0400
|
||||
+++ ghc-7.8.4/aclocal.m4 2015-04-01 04:50:19.708203082 -0400
|
||||
@@ -553,6 +553,14 @@
|
||||
$3="$$3 -D_HPUX_SOURCE"
|
||||
$5="$$5 -D_HPUX_SOURCE"
|
||||
;;
|
||||
+ arm*)
|
||||
+ # On arm, link using gold
|
||||
+ $3="$$3 -fuse-ld=gold"
|
||||
+ ;;
|
||||
+ aarch64*)
|
||||
+ # On arm, link using gold
|
||||
+ $3="$$3 -fuse-ld=gold"
|
||||
+ ;;
|
||||
esac
|
||||
|
||||
# If gcc knows about the stack protector, turn it off.
|
||||
--- ghc-7.8.4/configure.ac~ 2014-12-22 14:08:24.000000000 -0500
|
||||
+++ ghc-7.8.4/configure.ac 2015-04-22 00:08:54.646110535 -0400
|
||||
@@ -587,7 +587,18 @@
|
||||
dnl ** Which ld to use?
|
||||
dnl --------------------------------------------------------------
|
||||
FP_ARG_WITH_PATH_GNU_PROG([LD], [ld], [ld])
|
||||
-LdCmd="$LD"
|
||||
+case $target in
|
||||
+arm*linux* | aarch64*linux*)
|
||||
+ # Arm requires use of the binutils ld.gold linker.
|
||||
+ # This case should catch at least arm-unknown-linux-gnueabihf and
|
||||
+ # arm-linux-androideabi.
|
||||
+ FP_ARG_WITH_PATH_GNU_PROG([LD_GOLD], [ld.gold], [ld.gold])
|
||||
+ LdCmd="$LD_GOLD"
|
||||
+ ;;
|
||||
+*)
|
||||
+ LdCmd="$LD"
|
||||
+ ;;
|
||||
+esac
|
||||
AC_SUBST([LdCmd])
|
||||
|
||||
dnl ** Which nm to use?
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 5 07:47:58 UTC 2015 - schwab@suse.de
|
||||
|
||||
- atomic-cast.patch: fix signature of atomic bultins
|
||||
- ghc-7.8-arm-use-ld-gold.patch: remove obsolete patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Oct 3 18:50:28 UTC 2015 - sbahling@suse.com
|
||||
|
||||
|
9
ghc.spec
9
ghc.spec
@ -66,10 +66,10 @@ Requires: ghc-ghc-devel = %{version}-%{release}
|
||||
Requires: ghc-libraries = %{version}-%{release}
|
||||
Source: http://haskell.org/ghc/dist/%{version}/%{name}-%{version}-src.tar.xz
|
||||
Source1: ghc-rpmlintrc
|
||||
# PATCH-FIX-UPSTREAM fix signature of atomic builtins (#10926)
|
||||
Patch1: atomic-cast.patch
|
||||
# PATCH-FEATURE-UPSTREAM 0001-implement-native-code-generator-for-ppc64.patch peter.trommler@ohm-hochschule.de -- Implement native code generator for ppc64. Haskell Trac #9863.
|
||||
Patch19: 0001-implement-native-code-generator-for-ppc64.patch
|
||||
# PATCH-FIX-UPSTREAM peter.trommler@ohm-hochschule.de -- GNU ld does not work with ghc on aarch64 so use Gold. Adapted from Fedora patch 24.
|
||||
Patch23: ghc-7.8-arm-use-ld-gold.patch
|
||||
# PATCH-FIX-OPENSUSE sbahling@suse.com -- remove-cur_term-usage.patch openSUSE's ncurses6 doesn't export cur_term function
|
||||
Patch24: remove-cur_term-usage.patch
|
||||
|
||||
@ -161,13 +161,10 @@ except the ghc library, which is installed by the toplevel ghc metapackage.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
%patch19 -p1
|
||||
%patch24 -p1
|
||||
|
||||
#%%ifarch armv7hl aarch64
|
||||
#%%patch23 -p1 -b .24~
|
||||
#%%endif
|
||||
|
||||
%build
|
||||
# Patch 19 and 22 modify build system
|
||||
perl boot
|
||||
|
Loading…
x
Reference in New Issue
Block a user