summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorCheng Shao <terrorjack@type.dance>2023-04-05 03:13:27 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-04-24 12:19:44 -0400
commit87095f6a283d95016f66f4a14a3da923c394877c (patch)
tree3399b7d8655be5cc5fa443d4f6f5317a7532a42d /rts
parent787c6e8c5b96c95ead6cc7c213d12c5983975084 (diff)
downloadhaskell-87095f6a283d95016f66f4a14a3da923c394877c.tar.gz
rts: always build 64-bit atomic ops
This patch does a few things: - Always build 64-bit atomic ops in rts/ghc-prim, even on 32-bit platforms - Remove legacy "64bit" cabal flag of rts package - Fix hs_xchg64 function prototype for 32-bit platforms - Fix AtomicFetch test for wasm32
Diffstat (limited to 'rts')
-rw-r--r--rts/include/stg/Prim.h2
-rw-r--r--rts/rts.cabal.in39
2 files changed, 17 insertions, 24 deletions
diff --git a/rts/include/stg/Prim.h b/rts/include/stg/Prim.h
index 9e5752584a..c4595cf4fd 100644
--- a/rts/include/stg/Prim.h
+++ b/rts/include/stg/Prim.h
@@ -53,7 +53,7 @@ void hs_atomicwrite64(StgWord x, StgWord64 val);
StgWord hs_xchg8(StgWord x, StgWord val);
StgWord hs_xchg16(StgWord x, StgWord val);
StgWord hs_xchg32(StgWord x, StgWord val);
-StgWord hs_xchg64(StgWord x, StgWord val);
+StgWord64 hs_xchg64(StgWord x, StgWord64 val);
/* libraries/ghc-prim/cbits/bswap.c */
StgWord16 hs_bswap16(StgWord16 x);
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index df25403654..9541e1c8ed 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -45,8 +45,6 @@ flag libdw
default: @CabalHaveLibdw@
flag libnuma
default: @CabalHaveLibNuma@
-flag 64bit
- default: @Cabal64bit@
flag leading-underscore
default: @CabalLeadingUnderscore@
flag smp
@@ -289,27 +287,6 @@ library
stg/Types.h
-- See Note [Undefined symbols in the RTS]
- if flag(64bit)
- if flag(leading-underscore)
- ld-options:
- "-Wl,-u,_hs_atomic_add64"
- "-Wl,-u,_hs_atomic_sub64"
- "-Wl,-u,_hs_atomic_and64"
- "-Wl,-u,_hs_atomic_nand64"
- "-Wl,-u,_hs_atomic_or64"
- "-Wl,-u,_hs_atomic_xor64"
- "-Wl,-u,_hs_atomicread64"
- "-Wl,-u,_hs_atomicwrite64"
- else
- ld-options:
- "-Wl,-u,hs_atomic_add64"
- "-Wl,-u,hs_atomic_sub64"
- "-Wl,-u,hs_atomic_and64"
- "-Wl,-u,hs_atomic_nand64"
- "-Wl,-u,hs_atomic_or64"
- "-Wl,-u,hs_atomic_xor64"
- "-Wl,-u,hs_atomicread64"
- "-Wl,-u,hs_atomicwrite64"
if flag(leading-underscore)
ld-options:
"-Wl,-u,_base_GHCziTopHandler_runIO_closure"
@@ -357,21 +334,27 @@ library
"-Wl,-u,_hs_atomic_add8"
"-Wl,-u,_hs_atomic_add16"
"-Wl,-u,_hs_atomic_add32"
+ "-Wl,-u,_hs_atomic_add64"
"-Wl,-u,_hs_atomic_sub8"
"-Wl,-u,_hs_atomic_sub16"
"-Wl,-u,_hs_atomic_sub32"
+ "-Wl,-u,_hs_atomic_sub64"
"-Wl,-u,_hs_atomic_and8"
"-Wl,-u,_hs_atomic_and16"
"-Wl,-u,_hs_atomic_and32"
+ "-Wl,-u,_hs_atomic_and64"
"-Wl,-u,_hs_atomic_nand8"
"-Wl,-u,_hs_atomic_nand16"
"-Wl,-u,_hs_atomic_nand32"
+ "-Wl,-u,_hs_atomic_nand64"
"-Wl,-u,_hs_atomic_or8"
"-Wl,-u,_hs_atomic_or16"
"-Wl,-u,_hs_atomic_or32"
+ "-Wl,-u,_hs_atomic_or64"
"-Wl,-u,_hs_atomic_xor8"
"-Wl,-u,_hs_atomic_xor16"
"-Wl,-u,_hs_atomic_xor32"
+ "-Wl,-u,_hs_atomic_xor64"
"-Wl,-u,_hs_cmpxchg8"
"-Wl,-u,_hs_cmpxchg16"
"-Wl,-u,_hs_cmpxchg32"
@@ -383,9 +366,11 @@ library
"-Wl,-u,_hs_atomicread8"
"-Wl,-u,_hs_atomicread16"
"-Wl,-u,_hs_atomicread32"
+ "-Wl,-u,_hs_atomicread64"
"-Wl,-u,_hs_atomicwrite8"
"-Wl,-u,_hs_atomicwrite16"
"-Wl,-u,_hs_atomicwrite32"
+ "-Wl,-u,_hs_atomicwrite64"
"-Wl,-u,_base_GHCziStackziCloneStack_StackSnapshot_closure"
if flag(find-ptr)
@@ -440,21 +425,27 @@ library
"-Wl,-u,hs_atomic_add8"
"-Wl,-u,hs_atomic_add16"
"-Wl,-u,hs_atomic_add32"
+ "-Wl,-u,hs_atomic_add64"
"-Wl,-u,hs_atomic_sub8"
"-Wl,-u,hs_atomic_sub16"
"-Wl,-u,hs_atomic_sub32"
+ "-Wl,-u,hs_atomic_sub64"
"-Wl,-u,hs_atomic_and8"
"-Wl,-u,hs_atomic_and16"
"-Wl,-u,hs_atomic_and32"
+ "-Wl,-u,hs_atomic_and64"
"-Wl,-u,hs_atomic_nand8"
"-Wl,-u,hs_atomic_nand16"
"-Wl,-u,hs_atomic_nand32"
+ "-Wl,-u,hs_atomic_nand64"
"-Wl,-u,hs_atomic_or8"
"-Wl,-u,hs_atomic_or16"
"-Wl,-u,hs_atomic_or32"
+ "-Wl,-u,hs_atomic_or64"
"-Wl,-u,hs_atomic_xor8"
"-Wl,-u,hs_atomic_xor16"
"-Wl,-u,hs_atomic_xor32"
+ "-Wl,-u,hs_atomic_xor64"
"-Wl,-u,hs_cmpxchg8"
"-Wl,-u,hs_cmpxchg16"
"-Wl,-u,hs_cmpxchg32"
@@ -466,9 +457,11 @@ library
"-Wl,-u,hs_atomicread8"
"-Wl,-u,hs_atomicread16"
"-Wl,-u,hs_atomicread32"
+ "-Wl,-u,hs_atomicread64"
"-Wl,-u,hs_atomicwrite8"
"-Wl,-u,hs_atomicwrite16"
"-Wl,-u,hs_atomicwrite32"
+ "-Wl,-u,hs_atomicwrite64"
"-Wl,-u,base_GHCziStackziCloneStack_StackSnapshot_closure"
if flag(find-ptr)