Revert "adds -latomic to. ghc-prim"
authorBen Gamari <ben@smart-cactus.org>
Wed, 19 Sep 2018 19:23:27 +0000 (15:23 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 20 Sep 2018 14:13:55 +0000 (10:13 -0400)
This commit was never properly justified and relies on the existence of
libatomic, which doesn't appear to exist on Darwin.

This reverts commit ec9aacf3eb2975fd302609163aaef429962ecd87.

aclocal.m4
configure.ac
libraries/ghc-prim/Setup.hs
libraries/ghc-prim/aclocal.m4 [deleted file]
libraries/ghc-prim/configure.ac [deleted file]
libraries/ghc-prim/ghc-prim.buildinfo.in [deleted file]

index 1412350..e2804cf 100644 (file)
@@ -1296,6 +1296,24 @@ AC_SUBST(GccIsClang)
 rm -f conftest.txt
 ])
 
 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
 # FP_GCC_SUPPORTS_NO_PIE
 # ----------------------
 # Does gcc support the -no-pie option? If so we should pass it to gcc when
index 2b05535..f794375 100644 (file)
@@ -739,6 +739,11 @@ FP_GCC_VERSION
 dnl ** See whether gcc supports -no-pie
 FP_GCC_SUPPORTS_NO_PIE
 
 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.
 FP_GCC_EXTRA_FLAGS
 
 dnl ** look to see if we have a C compiler using an llvm back end.
index cccc416..5bb17e2 100644 (file)
@@ -18,7 +18,7 @@ import System.Exit
 import System.Directory
 
 main :: IO ()
 import System.Directory
 
 main :: IO ()
-main = do let hooks = autoconfUserHooks {
+main = do let hooks = simpleUserHooks {
                   regHook = addPrimModule
                           $ regHook simpleUserHooks,
                   buildHook = build_primitive_sources
                   regHook = addPrimModule
                           $ regHook simpleUserHooks,
                   buildHook = build_primitive_sources
diff --git a/libraries/ghc-prim/aclocal.m4 b/libraries/ghc-prim/aclocal.m4
deleted file mode 100644 (file)
index 81fc44c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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 y; }' > 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
-])
diff --git a/libraries/ghc-prim/configure.ac b/libraries/ghc-prim/configure.ac
deleted file mode 100644 (file)
index 8249be3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-AC_INIT([ghc-prim package], [2.1], [glasgow-haskell-bugs@haskell.org], [ghc-prim])
-
-AC_CONFIG_SRCDIR([ghc-prim.cabal])
-
-# -------------------------------------------------------------------------
-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?])
-
-if test "$CONF_GCC_SUPPORTS__ATOMICS" = "YES"
-then PRIM_CFLAGS=-DHAVE_C11_ATOMICS
-     PRIM_EXTRA_LIBRARIES=atomic
-fi
-AC_SUBST([PRIM_CFLAGS])
-AC_SUBST([PRIM_EXTRA_LIBRARIES])
-AC_CONFIG_FILES([ghc-prim.buildinfo])
-AC_OUTPUT
diff --git a/libraries/ghc-prim/ghc-prim.buildinfo.in b/libraries/ghc-prim/ghc-prim.buildinfo.in
deleted file mode 100644 (file)
index a093282..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-cc-options: @PRIM_CFLAGS@
-extra-libraries: @PRIM_EXTRA_LIBRARIES@
\ No newline at end of file