[Git][ghc/ghc][wip/toolchain-selection] Fixes

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Tue Jul 11 08:36:43 UTC 2023



Rodrigo Mesquita pushed to branch wip/toolchain-selection at Glasgow Haskell Compiler / GHC


Commits:
44ec49e2 by Rodrigo Mesquita at 2023-07-11T09:36:38+01:00
Fixes

- - - - -


4 changed files:

- TODO
- default.host.target.in
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cc.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs


Changes:

=====================================
TODO
=====================================
@@ -4,3 +4,4 @@ Things that might get done on this or another MR
 [ ] Readelf is only used to find cc link, that OK?
 [ ] In hadrian/src/Rules/Generate.hs, generateGhcPlatformH, factor out the query into an argument to chooseSetting, to deduplicate it
 [ ] Get rid of all the ToolchainSettings in Hadrian still (e.g. settings-clang-command)
+[ ] Write Note about dummy values in default.host.target


=====================================
default.host.target.in
=====================================
@@ -29,12 +29,12 @@ Target
 , arIsGnu = False
 , arSupportsAtFile = @ArSupportsAtFile_STAGE0Bool@
 , arSupportsDashL = @ArSupportsDashL_STAGE0Bool@
-, arNeedsRanlib = False
+, arNeedsRanlib = True
 }
 
 , tgtRanlib = Nothing
-, tgtNm = Nm {nmProgram = Program {prgPath = "@NM@", prgFlags = []}}
+, tgtNm = Nm {nmProgram = Program {prgPath = "", prgFlags = []}}
 , tgtMergeObjs = Just (MergeObjs {mergeObjsProgram = Program {prgPath = "@LD_STAGE0@", prgFlags = ["-r"]}, mergeObjsSupportsResponseFiles = False})
-, tgtDllwrap = @DllWrapCmdMaybeProg@
-, tgtWindres = @WindresCmdMaybeProg@
+, tgtDllwrap = Nothing
+, tgtWindres = Nothing
 }


=====================================
utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cc.hs
=====================================
@@ -101,7 +101,8 @@ checkCcSupportsExtraViaCFlags cc = checking "whether cc supports extra via-c fla
       test_c = test_o -<.> "c"
   writeFile test_c "int main() { return 0; }"
   (code, out, err) <- readProgram (ccProgram cc)
-                                  [ "-fwrapv", "-fno-builtin"
+                                  [ "-c"
+                                  , "-fwrapv", "-fno-builtin"
                                   , "-Werror", "-x", "c"
                                   , "-o", test_o, test_c]
   when (not (isSuccess code)


=====================================
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 find one (candidate is the c compiler)
-  foundHsCppProg <- findProgram "Haskell C preprocessor" progOpt [prgPath $ ccProgram cc]
+  foundHsCppProg <- findProgram "Haskell C preprocessor" progOpt [takeFileName $ prgPath $ ccProgram cc]
   case poFlags progOpt of
     -- If the user specified HS CPP flags don't second-guess them
     Just _ -> return HsCpp{hsCppProgram=foundHsCppProg}



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/44ec49e257116f2e716d44736f99b5b7982b4d2f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/44ec49e257116f2e716d44736f99b5b7982b4d2f
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/20230711/be7e43a4/attachment-0001.html>


More information about the ghc-commits mailing list