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 16:37:14 +0000 (11:37 -0500)
commit217e4170bdce3df28a667803ce5e619553bfecdd
tree1e548bae29aecc72ce257dc962025c1388a7a7b5
parentfdf518c708dc5a34ae810c5d5f3a4db812d226f0
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
aclocal.m4
configure.ac
libraries/ghc-prim/cbits/atomic.c
mk/config.mk.in
mk/warnings.mk
rts/ghc.mk