hadrian: Disable -Wno-undef in files which include ffi.h (#459)
authorBen Gamari <ben@smart-cactus.org>
Tue, 14 Nov 2017 17:15:42 +0000 (12:15 -0500)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Tue, 14 Nov 2017 17:15:42 +0000 (17:15 +0000)
As pointed out in D4181, these headers refer to undefined macros.

src/Settings/Packages/Rts.hs

index b15bb6a..cdc89da 100644 (file)
@@ -177,9 +177,15 @@ rtsPackageArgs = package rts ? do
             , input "//StgCRun.c" ? windowsHost ? arg "-Wno-return-local-addr"
             , input "//RetainerProfile.c" ? flag GccIsClang ?
               arg "-Wno-incompatible-pointer-types"
+            , windowsHost ? arg ("-DWINVER=" ++ windowsVersion)
+
+            -- libffi's ffi.h triggers various warnings
             , inputs [ "//Interpreter.c", "//Storage.c", "//Adjustor.c" ] ?
               arg "-Wno-strict-prototypes"
-            , windowsHost ? arg ("-DWINVER=" ++ windowsVersion) ]
+            , inputs ["//Interpreter.c", "//Adjustor.c", "//sm/Storage.c"] ?
+              anyTargetArch ["powerpc"] ? arg "-Wno-undef"
+            ]
+
     mconcat
         [ builder (Cc FindCDependencies) ? cArgs
         , builder (Ghc CompileCWithGhc) ? map ("-optc" ++) <$> cArgs