Add -Wno-sync-nand to ghcPrim's cbits/atomic.c
authorAndrey Mokhov <andrey.mokhov@gmail.com>
Mon, 6 Feb 2017 01:21:05 +0000 (02:21 +0100)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Mon, 6 Feb 2017 01:21:05 +0000 (02:21 +0100)
See GHC ticket #9678

cfg/system.config.in
src/Oracles/Config/Flag.hs
src/Settings/Packages/GhcPrim.hs

index 9ea0f44..667a22d 100644 (file)
@@ -30,6 +30,7 @@ ar-supports-at-file = @ArSupportsAtFile@
 cc-clang-backend    = @CC_CLANG_BACKEND@
 cc-llvm-backend     = @CC_LLVM_BACKEND@
 gcc-is-clang        = @GccIsClang@
+gcc-lt-44           = @GccLT44@
 gcc-lt-46           = @GccLT46@
 hs-cpp-args         = @HaskellCPPArgs@
 
index 6c5879d..8ac753f 100644 (file)
@@ -12,6 +12,7 @@ import Oracles.Config.Setting
 data Flag = ArSupportsAtFile
           | CrossCompiling
           | GccIsClang
+          | GccLt44
           | GccLt46
           | GhcUnregisterised
           | LeadingUnderscore
@@ -29,6 +30,7 @@ flag f = do
             ArSupportsAtFile   -> "ar-supports-at-file"
             CrossCompiling     -> "cross-compiling"
             GccIsClang         -> "gcc-is-clang"
+            GccLt44            -> "gcc-lt-44"
             GccLt46            -> "gcc-lt-46"
             GhcUnregisterised  -> "ghc-unregisterised"
             LeadingUnderscore  -> "leading-underscore"
index 225ff56..bed8345 100644 (file)
@@ -1,8 +1,13 @@
 module Settings.Packages.GhcPrim (ghcPrimPackageArgs) where
 
 import GHC
+import Oracles.Config.Flag
 import Predicate
 
 ghcPrimPackageArgs :: Args
-ghcPrimPackageArgs = package ghcPrim ?
-    builder GhcCabal ? arg "--flag=include-ghc-prim"
+ghcPrimPackageArgs = package ghcPrim ? mconcat
+    [ builder GhcCabal ? arg "--flag=include-ghc-prim"
+
+    , builder (Cc CompileC)    ?
+      (not <$> flag GccLt44)   ?
+      input "//cbits/atomic.c" ? arg "-Wno-sync-nand" ]