GHC 8.8 fails to build on PowerPC, not linking against libatomic
GHC 8.8.3 fails to build on 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'
(for full build logs, see here).
The problem seems to be that we are not linking against libatomic (see also this gcc bug report).
Previous versions of GHC correctly added atomic
to PRIM_EXTRA_LIBRARIES, but that code has been removed in latest versions of GHC.