[Git][ghc/ghc][wip/romes/enable-ghc-toolchain] 2 commits: Check Link Works with -Werror

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Jul 24 17:26:39 UTC 2023



Rodrigo Mesquita pushed to branch wip/romes/enable-ghc-toolchain at Glasgow Haskell Compiler / GHC


Commits:
ec6463b0 by Rodrigo Mesquita at 2023-07-24T18:24:09+01:00
Check Link Works with -Werror

- - - - -
2c4236d6 by Rodrigo Mesquita at 2023-07-24T18:26:31+01:00
Make search for Cpp message better, since we're not really looking for anything

- - - - -


2 changed files:

- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs


Changes:

=====================================
utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs
=====================================
@@ -24,7 +24,7 @@ newtype HsCpp = HsCpp { hsCppProgram :: Program
 findHsCpp :: ProgOpt -> Cc -> M HsCpp
 findHsCpp progOpt cc = checking "for Haskell C preprocessor" $ do
   -- Use the specified Hs Cpp or try to use the c compiler
-  foundHsCppProg <- findProgram "Haskell C preprocessor" progOpt [] <|> pure (programFromOpt progOpt (prgPath $ ccProgram cc) [])
+  foundHsCppProg <- findProgram "a user specified Haskell C preprocessor" progOpt [] <|> pure (programFromOpt progOpt (prgPath $ ccProgram cc) [])
   -- Always add the -E flag to the CPP, regardless of the user options
   let rawHsCppProgram = addFlagIfNew "-E" foundHsCppProg
   -- Always try to add the Haskell-specific CPP flags, regardless of the user options
@@ -59,7 +59,7 @@ findHsCppArgs cpp = withTempDir $ \dir -> do
 findCpp :: ProgOpt -> Cc -> M Cpp
 findCpp progOpt cc = checking "for C preprocessor" $ do
   -- Use the specified CPP or try to use the c compiler
-  foundCppProg <- findProgram "C preprocessor" progOpt [] <|> pure (programFromOpt progOpt (prgPath $ ccProgram cc) [])
+  foundCppProg <- findProgram "a user specified C preprocessor" progOpt [] <|> pure (programFromOpt progOpt (prgPath $ ccProgram cc) [])
   -- Always add the -E flag to the CPP, regardless of the user options
   let cppProgram = addFlagIfNew "-E" foundCppProg
   return Cpp{cppProgram}


=====================================
utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs
=====================================
@@ -163,7 +163,7 @@ checkLinkWorks cc ccLink = withTempDir $ \dir -> do
 
     let out = dir </> "test"
         err = "linker didn't produce any output"
-    callProgram ccLink ["-o", out, test_o, main_o]
+    callProgram ccLink ["-Werror", "-o", out, test_o, main_o]
     expectFileExists out err
       -- Linking in windows might produce an executable with an ".exe" extension
       <|> expectFileExists (out <.> "exe") err



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a1d38409fcdb951af7613aae1dc7fb81cadb66f2...2c4236d6f37d03f76fa5e54c998d5e28b036e9f7

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a1d38409fcdb951af7613aae1dc7fb81cadb66f2...2c4236d6f37d03f76fa5e54c998d5e28b036e9f7
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230724/924ee876/attachment-0001.html>


More information about the ghc-commits mailing list