[commit: ghc] master: Add atomic operations to package.conf.in (c06e3f4)

git at git.haskell.org git at git.haskell.org
Sat Jul 30 07:24:40 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c06e3f46d24ef69f3a3d794f5f604cb8c2a40cbc/ghc

>---------------------------------------------------------------

commit c06e3f46d24ef69f3a3d794f5f604cb8c2a40cbc
Author: alexbiehl <alex.biehl at gmail.com>
Date:   Sat Jul 30 17:22:54 2016 +1000

    Add atomic operations to package.conf.in
    
    This patch resulted from the discussion in D2431 and should be merged
    first.
    
    @erikd and @trommler reported errors like
    
    ```
    /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o
    ): In function `c14_info':
    (.text+0x2b8): undefined reference to `hs_cmpxchg32'
    /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o
    ): In function `c5e_info':
    (.text+0xac4): undefined reference to `hs_cmpxchg32'
    /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o
    ): In function `c8b_info':
    (.text+0x1198): undefined reference to `hs_cmpxchg32'
    /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o
    ): In function `c8b_info':
    (.text+0x122c): undefined reference to `hs_cmpxchg32'
    /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o
    ): In function `c8b_info':
    (.text+0x12ec): undefined reference to `hs_cmpxchg32'
    ```
    
    on PowerPC. @simonmar suggests to add the specific exports to
    `rts/package.conf.in`. This patch does exactly that, including all
    other atomic ops as they probably (maybe someone can verify?) suffer
    from the same problem on PPC.
    
    Test Plan: Please make sure to build on PPC.
    
    Reviewers: erikd, austin, bgamari, simonmar, trommler
    
    Reviewed By: erikd, trommler
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2435


>---------------------------------------------------------------

c06e3f46d24ef69f3a3d794f5f604cb8c2a40cbc
 rts/package.conf.in | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 108 insertions(+)

diff --git a/rts/package.conf.in b/rts/package.conf.in
index d2b728e..65aa5c3 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -122,6 +122,60 @@ ld-options:
          , "-Wl,-u,_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure"
          , "-Wl,-u,_base_GHCziConcziSync_runSparks_closure"
          , "-Wl,-u,_base_GHCziConcziSignal_runHandlersPtr_closure"
+         , "-Wl,-u,_hs_atomic_add8"
+         , "-Wl,-u,_hs_atomic_add16"
+         , "-Wl,-u,_hs_atomic_add32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_atomic_add64"
+#endif
+         , "-Wl,-u,_hs_atomic_sub8"
+         , "-Wl,-u,_hs_atomic_sub16"
+         , "-Wl,-u,_hs_atomic_sub32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_atomic_sub64"
+#endif
+         , "-Wl,-u,_hs_atomic_and8"
+         , "-Wl,-u,_hs_atomic_and16"
+         , "-Wl,-u,_hs_atomic_and32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_atomic_and64"
+#endif
+         , "-Wl,-u,_hs_atomic_nand8"
+         , "-Wl,-u,_hs_atomic_nand16"
+         , "-Wl,-u,_hs_atomic_nand32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_atomic_nand64"
+#endif
+         , "-Wl,-u,_hs_atomic_or8"
+         , "-Wl,-u,_hs_atomic_or16"
+         , "-Wl,-u,_hs_atomic_or32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_atomic_or64"
+#endif
+         , "-Wl,-u,_hs_atomic_xor8"
+         , "-Wl,-u,_hs_atomic_xor16"
+         , "-Wl,-u,_hs_atomic_xor32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_atomic_xor64"
+#endif
+         , "-Wl,-u,_hs_cmpxchg8"
+         , "-Wl,-u,_hs_cmpxchg16"
+         , "-Wl,-u,_hs_cmpxchg32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_cmpxchg64"
+#endif
+         , "-Wl,-u,_hs_atomicread8"
+         , "-Wl,-u,_hs_atomicread16"
+         , "-Wl,-u,_hs_atomicread32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_atomicread64"
+#endif
+         , "-Wl,-u,_hs_atomicwrite8"
+         , "-Wl,-u,_hs_atomicwrite16"
+         , "-Wl,-u,_hs_atomicwrite32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,_hs_atomicwrite64"
+#endif
 #else
            "-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info"
          , "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info"
@@ -164,6 +218,60 @@ ld-options:
          , "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure"
          , "-Wl,-u,base_GHCziConcziSync_runSparks_closure"
          , "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure"
+         , "-Wl,-u,hs_atomic_add8"
+         , "-Wl,-u,hs_atomic_add16"
+         , "-Wl,-u,hs_atomic_add32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_atomic_add64"
+#endif
+         , "-Wl,-u,hs_atomic_sub8"
+         , "-Wl,-u,hs_atomic_sub16"
+         , "-Wl,-u,hs_atomic_sub32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_atomic_sub64"
+#endif
+         , "-Wl,-u,hs_atomic_and8"
+         , "-Wl,-u,hs_atomic_and16"
+         , "-Wl,-u,hs_atomic_and32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_atomic_and64"
+#endif
+         , "-Wl,-u,hs_atomic_nand8"
+         , "-Wl,-u,hs_atomic_nand16"
+         , "-Wl,-u,hs_atomic_nand32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_atomic_nand64"
+#endif
+         , "-Wl,-u,hs_atomic_or8"
+         , "-Wl,-u,hs_atomic_or16"
+         , "-Wl,-u,hs_atomic_or32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_atomic_or64"
+#endif
+         , "-Wl,-u,hs_atomic_xor8"
+         , "-Wl,-u,hs_atomic_xor16"
+         , "-Wl,-u,hs_atomic_xor32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_atomic_xor64"
+#endif
+         , "-Wl,-u,hs_cmpxchg8"
+         , "-Wl,-u,hs_cmpxchg16"
+         , "-Wl,-u,hs_cmpxchg32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_cmpxchg64"
+#endif
+         , "-Wl,-u,hs_atomicread8"
+         , "-Wl,-u,hs_atomicread16"
+         , "-Wl,-u,hs_atomicread32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_atomicread64"
+#endif
+         , "-Wl,-u,hs_atomicwrite8"
+         , "-Wl,-u,hs_atomicwrite16"
+         , "-Wl,-u,hs_atomicwrite32"
+#if WORD_SIZE_IN_BITS == 64
+         , "-Wl,-u,hs_atomicwrite64"
+#endif
 #endif
 
 /*  Pick up static libraries in preference over dynamic if in earlier search



More information about the ghc-commits mailing list