diff options
| author | Haochen Tong <i@hexchain.org> | 2021-10-11 11:40:56 +0800 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-12 19:17:53 -0400 |
| commit | 90f06a0e015e18c066fe1569fb2add318bec72ca (patch) | |
| tree | c9ab2f2530ce13e136d7085b66f7920c50777863 /rts | |
| parent | 82938981a7916c2747ee3b97624c55f7c5467c84 (diff) | |
| download | haskell-90f06a0e015e18c066fe1569fb2add318bec72ca.tar.gz | |
Check for libatomic dependency for atomic operations
Some platforms (e.g. RISC-V) require linking against libatomic for some
(e.g. sub-word-sized) atomic operations.
Fixes #19119.
Diffstat (limited to 'rts')
| -rw-r--r-- | rts/package.conf.in | 3 | ||||
| -rw-r--r-- | rts/rts.cabal.in | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/rts/package.conf.in b/rts/package.conf.in index 6bc38e592d..a4d3edf3fd 100644 --- a/rts/package.conf.in +++ b/rts/package.conf.in @@ -63,6 +63,9 @@ extra-libraries: , "elf" , "dw" /* for backtraces */ #endif +#if NEED_ATOMIC_LIB + , "atomic" +#endif #if defined(INSTALLING) include-dirs: INCLUDE_DIR FFI_INCLUDE_DIR diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in index 5739af6713..d1f5681d79 100644 --- a/rts/rts.cabal.in +++ b/rts/rts.cabal.in @@ -20,6 +20,8 @@ flag libbfd default: @CabalHaveLibbfd@ flag mingwex default: @CabalMingwex@ +flag need-atomic + default: @CabalNeedLibatomic@ flag libdw default: @CabalHaveLibdw@ flag libnuma @@ -126,6 +128,9 @@ library if flag(need-pthread) -- for pthread_getthreadid_np, pthread_create, ... extra-libraries: pthread + if flag(need-atomic) + -- for sub-word-sized atomic operations (#19119) + extra-libraries: atomic if flag(libbfd) -- for debugging extra-libraries: bfd iberty |
