Rodrigo Mesquita pushed to branch wip/T23675 at Glasgow Haskell Compiler / GHC
Commits:
-
51837035
by Rodrigo Mesquita at 2025-06-17T11:26:31+01:00
3 changed files:
Changes:
... | ... | @@ -34,7 +34,6 @@ import Base |
34 | 34 | import Context
|
35 | 35 | import Oracles.Flag
|
36 | 36 | import Oracles.Setting (setting, Setting(..))
|
37 | -import Oracles.Setting (settingsFileSetting, ToolchainSetting(..))
|
|
38 | 37 | import Packages
|
39 | 38 | |
40 | 39 | import GHC.IO.Encoding (getFileSystemEncoding)
|
... | ... | @@ -240,7 +239,7 @@ instance H.Builder Builder where |
240 | 239 | Ghc _ st -> do
|
241 | 240 | root <- buildRoot
|
242 | 241 | unlitPath <- builderPath Unlit
|
243 | - distro_mingw <- settingsFileSetting ToolchainSetting_DistroMinGW
|
|
242 | + distro_mingw <- lookupSystemConfig "settings-use-distro-mingw"
|
|
244 | 243 | libffi_adjustors <- useLibffiForAdjustors
|
245 | 244 | use_system_ffi <- flag UseSystemFfi
|
246 | 245 |
... | ... | @@ -75,19 +75,6 @@ data Setting = CursesIncludeDir |
75 | 75 | | BourneShell
|
76 | 76 | | EmsdkVersion
|
77 | 77 | |
78 | --- TODO compute solely in Hadrian, removing these variables' definitions
|
|
79 | --- from aclocal.m4 whenever they can be calculated from other variables
|
|
80 | --- already fed into Hadrian.
|
|
81 | - |
|
82 | --- | All 'ToolchainSetting's are computed by the ghc-toolchain utility for configuring toolchains.
|
|
83 | --- This used to be defined by 'FP_SETTINGS' in aclocal.m4.
|
|
84 | ---
|
|
85 | --- TODO: We should be able to drop this completely, after moving all the toolchain settings to ghc-toolchain
|
|
86 | --- Move to ghc-toolchain and to the Target files generated by configure and ghc-toolchain
|
|
87 | --- * First we will get rid of DistroMinGW when we fix the windows build
|
|
88 | -data ToolchainSetting
|
|
89 | - = ToolchainSetting_DistroMinGW
|
|
90 | - |
|
91 | 78 | -- | Look up the value of a 'Setting' in @cfg/system.config@, tracking the
|
92 | 79 | -- result.
|
93 | 80 | setting :: Setting -> Action String
|
... | ... | @@ -128,14 +115,6 @@ setting key = lookupSystemConfig $ case key of |
128 | 115 | BourneShell -> "bourne-shell"
|
129 | 116 | EmsdkVersion -> "emsdk-version"
|
130 | 117 | |
131 | --- | Look up the value of a 'SettingList' in @cfg/system.config@, tracking the
|
|
132 | --- result.
|
|
133 | --- See Note [tooldir: How GHC finds mingw on Windows]
|
|
134 | --- ROMES:TODO: This should be queryTargetTargetConfig
|
|
135 | -settingsFileSetting :: ToolchainSetting -> Action String
|
|
136 | -settingsFileSetting key = lookupSystemConfig $ case key of
|
|
137 | - ToolchainSetting_DistroMinGW -> "settings-use-distro-mingw" -- ROMES:TODO: This option doesn't seem to be in ghc-toolchain yet. It corresponds to EnableDistroToolchain
|
|
138 | - |
|
139 | 118 | -- | An expression that looks up the value of a 'Setting' in @cfg/system.config@,
|
140 | 119 | -- tracking the result.
|
141 | 120 | getSetting :: Setting -> Expr c b String
|
... | ... | @@ -424,7 +424,7 @@ bindistRules = do |
424 | 424 | , interpolateSetting "LlvmMinVersion" LlvmMinVersion
|
425 | 425 | , interpolateVar "LlvmTarget" $ getTarget tgtLlvmTarget
|
426 | 426 | , interpolateSetting "ProjectVersion" ProjectVersion
|
427 | - , interpolateVar "SettingsUseDistroMINGW" $ settingsFileSetting ToolchainSetting_DistroMinGW
|
|
427 | + , interpolateVar "SettingsUseDistroMINGW" $ lookupSystemConfig "settings-use-distro-mingw"
|
|
428 | 428 | , interpolateVar "TablesNextToCode" $ yesNo <$> getTarget tgtTablesNextToCode
|
429 | 429 | , interpolateVar "TargetHasLibm" $ lookupSystemConfig "target-has-libm"
|
430 | 430 | , interpolateVar "TargetPlatform" $ getTarget targetPlatformTriple
|
... | ... | @@ -529,7 +529,7 @@ generateSettings settingsFile = do |
529 | 529 | , ("LLVM opt command", queryTarget optPath)
|
530 | 530 | , ("LLVM llvm-as command", queryTarget llvmAsPath)
|
531 | 531 | , ("LLVM llvm-as flags", queryTarget llvmAsFlags)
|
532 | - , ("Use inplace MinGW toolchain", expr $ settingsFileSetting ToolchainSetting_DistroMinGW)
|
|
532 | + , ("Use inplace MinGW toolchain", expr $ lookupSystemConfig "settings-use-distro-mingw")
|
|
533 | 533 | |
534 | 534 | , ("target RTS linker only supports shared libraries", expr $ yesNo <$> targetRTSLinkerOnlySupportsSharedLibs)
|
535 | 535 | , ("Use interpreter", expr $ yesNo <$> ghcWithInterpreter (predStage stage))
|