[commit: ghc] master: hadrian: Disable -Wno-undef in files which include ffi.h (#459) (fa3771f)

git at git.haskell.org git at git.haskell.org
Tue Oct 23 20:11:59 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/fa3771fe6baf5008a8506fec48220f8347ac59af/ghc

>---------------------------------------------------------------

commit fa3771fe6baf5008a8506fec48220f8347ac59af
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Tue Nov 14 12:15:42 2017 -0500

    hadrian: Disable -Wno-undef in files which include ffi.h (#459)
    
    As pointed out in D4181, these headers refer to undefined macros.


>---------------------------------------------------------------

fa3771fe6baf5008a8506fec48220f8347ac59af
 src/Settings/Packages/Rts.hs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Settings/Packages/Rts.hs b/src/Settings/Packages/Rts.hs
index b15bb6a..cdc89da 100644
--- a/src/Settings/Packages/Rts.hs
+++ b/src/Settings/Packages/Rts.hs
@@ -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



More information about the ghc-commits mailing list