summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-02-03 11:37:01 -0500
committerBen Gamari <ben@smart-cactus.org>2018-02-03 11:37:14 -0500
commit217e4170bdce3df28a667803ce5e619553bfecdd (patch)
tree1e548bae29aecc72ce257dc962025c1388a7a7b5 /configure.ac
parentfdf518c708dc5a34ae810c5d5f3a4db812d226f0 (diff)
downloadhaskell-217e4170bdce3df28a667803ce5e619553bfecdd.tar.gz
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
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 216a97fb49..5bf096b3d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -712,6 +712,11 @@ FP_GCC_VERSION
dnl ** See whether gcc supports -no-pie
FP_GCC_SUPPORTS_NO_PIE
+dnl ** Used to determine how to compile ghc-prim's atomics.c, used by
+dnl unregisterised, Sparc, and PPC backends.
+FP_GCC_SUPPORTS__ATOMICS
+AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic primitives?])
+
FP_GCC_EXTRA_FLAGS
dnl ** look to see if we have a C compiler using an llvm back end.