Rodrigo Mesquita pushed to branch wip/romes/26227 at Glasgow Haskell Compiler / GHC
Commits:
-
b45394ac
by Rodrigo Mesquita at 2025-07-31T18:36:52+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),
|
| ... | ... | @@ -130,12 +130,8 @@ initSettings top_dir = do |
| 130 | 130 | let ghc_usage_msg_path = installed "ghc-usage.txt"
|
| 131 | 131 | ghci_usage_msg_path = installed "ghci-usage.txt"
|
| 132 | 132 | |
| 133 | - -- For all systems, unlit, split, mangle are GHC utilities
|
|
| 134 | - -- architecture-specific stuff is done when building Config.hs
|
|
| 135 | - unlit_path <- getToolSetting "unlit command"
|
|
| 136 | - |
|
| 137 | - -- Other things being equal, 'as' is simply 'gcc'
|
|
| 138 | - let (cc_link, cc_link_args) = getTool (ccLinkProgram . tgtCCompilerLink)
|
|
| 133 | + -- Other things being equal, 'as' is simply 'gcc'
|
|
| 134 | + (cc_link, cc_link_args) = getTool (ccLinkProgram . tgtCCompilerLink)
|
|
| 139 | 135 | as_prog = cc_prog
|
| 140 | 136 | as_args = map Option cc_args
|
| 141 | 137 | ld_prog = cc_link
|
| ... | ... | @@ -145,6 +141,9 @@ initSettings top_dir = do |
| 145 | 141 | let (ld_r_path, ld_r_args) = getTool (mergeObjsProgram . const ld_r_prog)
|
| 146 | 142 | pure (ld_r_path, map Option ld_r_args)
|
| 147 | 143 | iserv_prog = libexec "ghc-iserv"
|
| 144 | + unlit_prog = libexec (if tgtLocallyExecutable
|
|
| 145 | + then "unlit" -- not a cross compiler
|
|
| 146 | + else targetPlatformTriple target ++ "-unlit")
|
|
| 148 | 147 | |
| 149 | 148 | baseUnitId <- getSetting_raw "base unit-id"
|
| 150 | 149 | |
| ... | ... | @@ -179,7 +178,7 @@ initSettings top_dir = do |
| 179 | 178 | , toolSettings_arSupportsDashL = arSupportsDashL $ tgtAr target
|
| 180 | 179 | , toolSettings_cmmCppSupportsG0 = cmmCppSupportsG0 $ tgtCmmCPreprocessor target
|
| 181 | 180 | |
| 182 | - , toolSettings_pgm_L = unlit_path
|
|
| 181 | + , toolSettings_pgm_L = unlit_prog
|
|
| 183 | 182 | , toolSettings_pgm_P = (hs_cpp_prog, map Option hs_cpp_args)
|
| 184 | 183 | , toolSettings_pgm_JSP = (js_cpp_prog, map Option js_cpp_args)
|
| 185 | 184 | , 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 "]" >> $@
|
| ... | ... | @@ -483,8 +483,7 @@ generateSettings settingsFile = do |
| 483 | 483 | let rel_pkg_db = makeRelativeNoSysLink (dropFileName settingsFile) package_db_path
|
| 484 | 484 | |
| 485 | 485 | settings <- traverse sequence $
|
| 486 | - [ ("unlit command", ("$topdir/../bin/" <>) <$> expr (programName (ctx { Context.package = unlit })))
|
|
| 487 | - , ("RTS ways", escapeArgs . map show . Set.toList <$> getRtsWays)
|
|
| 486 | + [ ("RTS ways", escapeArgs . map show . Set.toList <$> getRtsWays)
|
|
| 488 | 487 | , ("Relative Global Package DB", pure rel_pkg_db)
|
| 489 | 488 | , ("base unit-id", pure base_unit_id)
|
| 490 | 489 | ]
|