Skip to content

Commit

Permalink
Revert "adds -latomic to. ghc-prim"
Browse files Browse the repository at this point in the history
This commit was never properly justified and relies on the existence of
libatomic, which doesn't appear to exist on Darwin.

This reverts commit ec9aacf.
  • Loading branch information
bgamari committed Sep 20, 2018
1 parent ba086ca commit d7fa869
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 38 deletions.
18 changes: 18 additions & 0 deletions aclocal.m4
Expand Up @@ -1296,6 +1296,24 @@ AC_SUBST(GccIsClang)
rm -f conftest.txt
])

# FP_GCC_SUPPORTS__ATOMICS
# ------------------------
# Does gcc support the __atomic_* family of builtins?
AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS],
[
AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([whether GCC supports __atomic_ builtins])
echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; }' > conftest.c
if $CC -c conftest.c > /dev/null 2>&1; then
CONF_GCC_SUPPORTS__ATOMICS=YES
AC_MSG_RESULT([yes])
else
CONF_GCC_SUPPORTS__ATOMICS=NO
AC_MSG_RESULT([no])
fi
rm -f conftest.c conftest.o
])

# FP_GCC_SUPPORTS_NO_PIE
# ----------------------
# Does gcc support the -no-pie option? If so we should pass it to gcc when
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Expand Up @@ -739,6 +739,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.
Expand Down
2 changes: 1 addition & 1 deletion libraries/ghc-prim/Setup.hs
Expand Up @@ -18,7 +18,7 @@ import System.Exit
import System.Directory

main :: IO ()
main = do let hooks = autoconfUserHooks {
main = do let hooks = simpleUserHooks {
regHook = addPrimModule
$ regHook simpleUserHooks,
buildHook = build_primitive_sources
Expand Down
17 changes: 0 additions & 17 deletions libraries/ghc-prim/aclocal.m4

This file was deleted.

18 changes: 0 additions & 18 deletions libraries/ghc-prim/configure.ac

This file was deleted.

2 changes: 0 additions & 2 deletions libraries/ghc-prim/ghc-prim.buildinfo.in

This file was deleted.

0 comments on commit d7fa869

Please sign in to comment.