Skip to content
  • Ilias Tsitsimpis's avatar
    Do not define hs_atomic{read,write}64() on non-64bit · dbea7e9d
    Ilias Tsitsimpis authored and Marge Bot's avatar Marge Bot committed
    Do not define hs_atomicread64() and hs_atomicwrite64() on machines where
    WORD_SIZE_IN_BITS is less than 64, just like we do with the rest of the atomic
    functions which work on 64-bit values.
    
    Without this, compilation fails on MIPSel and PowerPC with the following error:
    
    /usr/bin/ld: /<<PKGBUILDDIR>>/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3_p.a(atomic.p_o): in function `hs_atomicread64':
    atomic.c:(.text.hs_atomicread64+0x8): undefined reference to `__sync_add_and_fetch_8'
    /usr/bin/ld: /<<PKGBUILDDIR>>/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3_p.a(atomic.p_o): in function `hs_atomicwrite64':
    atomic.c:(.text.hs_atomicwrite64+0x38): undefined reference to `__sync_bool_compare_and_swap_8'
    
    Fixes #17886.
    dbea7e9d