[Git][ghc/ghc][wip/hadrian-cross-stage2] 2 commits: fix source dist

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Mon Oct 9 12:06:04 UTC 2023



Matthew Pickering pushed to branch wip/hadrian-cross-stage2 at Glasgow Haskell Compiler / GHC


Commits:
cca0c584 by Matthew Pickering at 2023-10-09T13:05:45+01:00
fix source dist

- - - - -
bcf28efa by Matthew Pickering at 2023-10-09T13:05:45+01:00
MP: HACK? Use the target file for building things on the host when host=target

Perhaps another way to achieve this is to copy the target target file
on top of the host when host=target.

- - - - -


2 changed files:

- hadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Rules/SourceDist.hs


Changes:

=====================================
hadrian/src/Hadrian/Oracles/TextFile.hs
=====================================
@@ -100,7 +100,15 @@ getBuildTarget = getTargetConfig buildTargetFile
 
 -- | Get the host target configuration through 'getTargetConfig'
 getHostTarget :: Action Toolchain.Target
-getHostTarget = getTargetConfig hostTargetFile
+getHostTarget = do
+  -- MP: If we are not cross compiling then we should use the target file in order to
+  -- build things for the host, in particular we want to use the configured values for the
+  -- target for building the RTS (ie are we using Libffi for adjustors, and the wordsize)
+  ht <- getTargetConfig hostTargetFile
+  tt <- getTargetConfig targetTargetFile
+  if (Toolchain.targetPlatformTriple ht) == (Toolchain.targetPlatformTriple tt)
+    then return tt
+    else return ht
   -- where
   --   msg = "The host's target configuration file " ++ quote hostTargetFile ++ " does not exist! ghc-toolchain might have failed to generate it."
 


=====================================
hadrian/src/Rules/SourceDist.hs
=====================================
@@ -156,7 +156,7 @@ prepareTree dest = do
       , pkgPath terminfo -/- "configure"
       , "configure"
       , "aclocal.m4"
-      , "mk" -/- "config.h.in" ]
+      ]
 
     copyAlexHappyFiles =
       forM_ alexHappyFiles $ \(stg, pkg, inp, out) -> do



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e8c6538db02b9f463883902f5411066bd0944a20...bcf28efa32a93b82e0690697cca74935700e13ed

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e8c6538db02b9f463883902f5411066bd0944a20...bcf28efa32a93b82e0690697cca74935700e13ed
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/20231009/f29e6ae7/attachment-0001.html>


More information about the ghc-commits mailing list