ghc-prim: Emulate C11 atomics when not available
authorBen Gamari <bgamari.foss@gmail.com>
Sat, 3 Feb 2018 16:37:01 +0000 (11:37 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sat, 3 Feb 2018 17:30:11 +0000 (12:30 -0500)
commit7a3a7ee938b05a297e4b624cae86e4f0caefb88a
tree48889bf490064fe2a2c48c4ee8a415b417dbc6ca
parent445554b6d9a2263f969e25bb9f532dd0c3a9dc8c
ghc-prim: Emulate C11 atomics when not available

GCC's __sync primitives apparently "usually" imply a full barrier,
meaning they can be used to emulate the more precise C11 atomics albeit
with a loss of efficiency. This restores compatibility with GCC 4.4.

This partially reverts commit 59de290928e6903337f31c1f8107ac8a98ea145d.

Test Plan: Validate on Centos

Reviewers: hvr, simonmar, trommler

Subscribers: rwbarton, thomie, erikd, carter

GHC Trac Issues: #14244

Differential Revision: https://phabricator.haskell.org/D4364

(cherry picked from commit 217e4170bdce3df28a667803ce5e619553bfecdd)
aclocal.m4
configure.ac
libraries/ghc-prim/cbits/atomic.c
mk/config.mk.in
mk/warnings.mk
rts/ghc.mk