Rodrigo Mesquita pushed to branch wip/romes/26227 at Glasgow Haskell Compiler / GHC
Commits:
-
3150b664
by Rodrigo Mesquita at 2025-08-01T16:07:33+01:00
4 changed files:
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Settings/IO.hs
- hadrian/bindist/Makefile
- hadrian/src/Rules/Generate.hs
Changes:
... | ... | @@ -3502,6 +3502,7 @@ compilerInfo dflags |
3502 | 3502 | ("target has .ident directive", queryBool tgtSupportsIdentDirective),
|
3503 | 3503 | ("target has subsections via symbols", queryBool tgtSupportsSubsectionsViaSymbols),
|
3504 | 3504 | ("target RTS linker only supports shared libraries", queryBool tgtRTSLinkerOnlySupportsSharedLibs),
|
3505 | + ("unlit command", toolSettings_pgm_L (toolSettings dflags)),
|
|
3505 | 3506 | ("Unregisterised", queryBool tgtUnregisterised),
|
3506 | 3507 | ("LLVM target", query tgtLlvmTarget),
|
3507 | 3508 | ("LLVM llc command", queryCmdMaybe id tgtLlc),
|
... | ... | @@ -131,12 +131,8 @@ initSettings top_dir = do |
131 | 131 | let ghc_usage_msg_path = installed "ghc-usage.txt"
|
132 | 132 | ghci_usage_msg_path = installed "ghci-usage.txt"
|
133 | 133 | |
134 | - -- For all systems, unlit, split, mangle are GHC utilities
|
|
135 | - -- architecture-specific stuff is done when building Config.hs
|
|
136 | - unlit_path <- getToolSetting "unlit command"
|
|
137 | - |
|
138 | - -- Other things being equal, 'as' is simply 'gcc'
|
|
139 | - let (cc_link, cc_link_args) = getTool (ccLinkProgram . tgtCCompilerLink)
|
|
134 | + -- Other things being equal, 'as' is simply 'gcc'
|
|
135 | + (cc_link, cc_link_args) = getTool (ccLinkProgram . tgtCCompilerLink)
|
|
140 | 136 | as_prog = cc_prog
|
141 | 137 | as_args = map Option cc_args
|
142 | 138 | ld_prog = cc_link
|
... | ... | @@ -146,6 +142,9 @@ initSettings top_dir = do |
146 | 142 | let (ld_r_path, ld_r_args) = getTool (mergeObjsProgram . const ld_r_prog)
|
147 | 143 | pure (ld_r_path, map Option ld_r_args)
|
148 | 144 | iserv_prog = libexec "ghc-iserv"
|
145 | + unlit_prog = libexec (if (tgtLocallyExecutable target)
|
|
146 | + then "unlit" -- not a cross compiler
|
|
147 | + else targetPlatformTriple target ++ "-unlit")
|
|
149 | 148 | |
150 | 149 | baseUnitId <- getSetting_raw "base unit-id"
|
151 | 150 | |
... | ... | @@ -180,7 +179,7 @@ initSettings top_dir = do |
180 | 179 | , toolSettings_arSupportsDashL = arSupportsDashL $ tgtAr target
|
181 | 180 | , toolSettings_cmmCppSupportsG0 = cmmCppSupportsG0 $ tgtCmmCPreprocessor target
|
182 | 181 | |
183 | - , toolSettings_pgm_L = unlit_path
|
|
182 | + , toolSettings_pgm_L = unlit_prog
|
|
184 | 183 | , toolSettings_pgm_P = (hs_cpp_prog, map Option hs_cpp_args)
|
185 | 184 | , toolSettings_pgm_JSP = (js_cpp_prog, map Option js_cpp_args)
|
186 | 185 | , toolSettings_pgm_CmmP = (cmmCpp_prog, map Option cmmCpp_args)
|
... | ... | @@ -85,8 +85,7 @@ WrapperBinsDir=${bindir} |
85 | 85 | # N.B. this is duplicated from includes/ghc.mk.
|
86 | 86 | lib/settings : config.mk
|
87 | 87 | @rm -f $@
|
88 | - @echo '[("unlit command", "$$topdir/../bin/$(CrossCompilePrefix)unlit")' >> $@
|
|
89 | - @echo ',("RTS ways", "$(GhcRTSWays)")' >> $@
|
|
88 | + @echo '[("RTS ways", "$(GhcRTSWays)")' >> $@
|
|
90 | 89 | @echo ',("Relative Global Package DB", "package.conf.d")' >> $@
|
91 | 90 | @echo ',("base unit-id", "$(BaseUnitId)")' >> $@
|
92 | 91 | @echo "]" >> $@
|
... | ... | @@ -8,7 +8,6 @@ import Development.Shake.FilePath |
8 | 8 | import Data.Char (isSpace)
|
9 | 9 | import qualified Data.Set as Set
|
10 | 10 | import Base
|
11 | -import qualified Context
|
|
12 | 11 | import Expression
|
13 | 12 | import Hadrian.Oracles.TextFile (lookupSystemConfig, getTargetTarget)
|
14 | 13 | import Oracles.Flag hiding (arSupportsAtFile, arSupportsDashL)
|
... | ... | @@ -460,7 +459,6 @@ ghcWrapper stage = do |
460 | 459 | |
461 | 460 | generateSettings :: FilePath -> Expr String
|
462 | 461 | generateSettings settingsFile = do
|
463 | - ctx <- getContext
|
|
464 | 462 | stage <- getStage
|
465 | 463 | |
466 | 464 | package_db_path <- expr $ do
|
... | ... | @@ -482,8 +480,7 @@ generateSettings settingsFile = do |
482 | 480 | let rel_pkg_db = makeRelativeNoSysLink (dropFileName settingsFile) package_db_path
|
483 | 481 | |
484 | 482 | settings <- traverse sequence $
|
485 | - [ ("unlit command", ("$topdir/../bin/" <>) <$> expr (programName (ctx { Context.package = unlit })))
|
|
486 | - , ("RTS ways", escapeArgs . map show . Set.toList <$> getRtsWays)
|
|
483 | + [ ("RTS ways", escapeArgs . map show . Set.toList <$> getRtsWays)
|
|
487 | 484 | , ("Relative Global Package DB", pure rel_pkg_db)
|
488 | 485 | , ("base unit-id", pure base_unit_id)
|
489 | 486 | ]
|