| ... |
... |
@@ -105,50 +105,49 @@ allowHaveLLVM = not . (`elem` ["wasm32", "javascript"]) |
|
105
|
105
|
--
|
|
106
|
106
|
inTreeCompilerArgs :: Stage -> Action TestCompilerArgs
|
|
107
|
107
|
inTreeCompilerArgs stg = do
|
|
108
|
|
- -- TODO: executable and library stage would be clearer
|
|
109
|
108
|
cross <- crossStage stg
|
|
110
|
|
- let ghcStage = succStage stg
|
|
111
|
|
- pkgCacheStage = if cross then ghcStage else stg
|
|
|
109
|
+ let executableStage = succStage stg
|
|
|
110
|
+ libraryStage = if cross then executableStage else stg
|
|
112
|
111
|
(hasDynamicRts, hasThreadedRts) <- do
|
|
113
|
|
- ways <- interpretInContext (vanillaContext ghcStage rts) getRtsWays
|
|
|
112
|
+ ways <- interpretInContext (vanillaContext executableStage rts) getRtsWays
|
|
114
|
113
|
return (dynamic `elem` ways, threaded `elem` ways)
|
|
115
|
|
- hasDynamic <- (wayUnit Dynamic) . Context.Type.way <$> (programContext stg ghc)
|
|
116
|
|
- leadingUnderscore <- queryTargetTarget ghcStage tgtSymbolsHaveLeadingUnderscore
|
|
117
|
|
- withInterpreter <- ghcWithInterpreter ghcStage
|
|
118
|
|
- unregisterised <- queryTargetTarget ghcStage tgtUnregisterised
|
|
119
|
|
- tables_next_to_code <- queryTargetTarget ghcStage tgtTablesNextToCode
|
|
120
|
|
- targetWithSMP <- targetSupportsSMP ghcStage
|
|
121
|
|
- interpForceDyn <- targetRTSLinkerOnlySupportsSharedLibs ghcStage
|
|
122
|
|
-
|
|
123
|
|
- debugAssertions <- ghcDebugAssertions <$> flavour <*> pure ghcStage
|
|
124
|
|
- debugged <- ghcDebugged <$> flavour <*> pure ghcStage
|
|
125
|
|
- profiled <- ghcProfiled <$> flavour <*> pure ghcStage
|
|
|
114
|
+ hasDynamic <- wayUnit Dynamic . Context.Type.way <$> programContext stg ghc
|
|
|
115
|
+ leadingUnderscore <- queryTargetTarget executableStage tgtSymbolsHaveLeadingUnderscore
|
|
|
116
|
+ withInterpreter <- ghcWithInterpreter executableStage
|
|
|
117
|
+ unregisterised <- queryTargetTarget executableStage tgtUnregisterised
|
|
|
118
|
+ tables_next_to_code <- queryTargetTarget executableStage tgtTablesNextToCode
|
|
|
119
|
+ targetWithSMP <- targetSupportsSMP executableStage
|
|
|
120
|
+ interpForceDyn <- targetRTSLinkerOnlySupportsSharedLibs executableStage
|
|
|
121
|
+
|
|
|
122
|
+ debugAssertions <- ghcDebugAssertions <$> flavour <*> pure executableStage
|
|
|
123
|
+ debugged <- ghcDebugged <$> flavour <*> pure executableStage
|
|
|
124
|
+ profiled <- ghcProfiled <$> flavour <*> pure executableStage
|
|
126
|
125
|
|
|
127
|
126
|
os <- queryHostTarget queryOS
|
|
128
|
|
- arch <- queryTargetTarget ghcStage queryArch
|
|
|
127
|
+ arch <- queryTargetTarget executableStage queryArch
|
|
129
|
128
|
let codegen_arches = ["x86_64", "i386", "powerpc", "powerpc64", "powerpc64le", "aarch64", "wasm32", "riscv64", "loongarch64"]
|
|
130
|
129
|
let withNativeCodeGen
|
|
131
|
130
|
| unregisterised = False
|
|
132
|
131
|
| arch `elem` codegen_arches = True
|
|
133
|
132
|
| otherwise = False
|
|
134
|
|
- platform <- queryTargetTarget ghcStage targetPlatformTriple
|
|
135
|
|
- wordsize <- show @Int . (*8) <$> queryTargetTarget ghcStage (wordSize2Bytes . tgtWordSize)
|
|
|
133
|
+ platform <- queryTargetTarget executableStage targetPlatformTriple
|
|
|
134
|
+ wordsize <- show @Int . (*8) <$> queryTargetTarget executableStage (wordSize2Bytes . tgtWordSize)
|
|
136
|
135
|
|
|
137
|
|
- llc_cmd <- queryTargetTarget ghcStage tgtLlc
|
|
138
|
|
- llvm_as_cmd <- queryTargetTarget ghcStage tgtLlvmAs
|
|
|
136
|
+ llc_cmd <- queryTargetTarget executableStage tgtLlc
|
|
|
137
|
+ llvm_as_cmd <- queryTargetTarget executableStage tgtLlvmAs
|
|
139
|
138
|
let have_llvm = allowHaveLLVM arch && all isJust [llc_cmd, llvm_as_cmd]
|
|
140
|
139
|
|
|
141
|
140
|
top <- topDirectory
|
|
142
|
141
|
|
|
143
|
142
|
pkgConfCacheFile <- System.FilePath.normalise . (top -/-)
|
|
144
|
|
- <$> (packageDbPath (PackageDbLoc pkgCacheStage Final) <&> (-/- "package.cache"))
|
|
|
143
|
+ <$> (packageDbPath (PackageDbLoc libraryStage Final) <&> (-/- "package.cache"))
|
|
145
|
144
|
libdir <- System.FilePath.normalise . (top -/-)
|
|
146
|
|
- <$> stageLibPath pkgCacheStage
|
|
|
145
|
+ <$> stageLibPath libraryStage
|
|
147
|
146
|
|
|
148
|
147
|
-- For this information, we need to query ghc --info, however, that would
|
|
149
|
148
|
-- require building ghc, which we don't want to do here. Therefore, the
|
|
150
|
149
|
-- logic from `platformHasRTSLinker` is duplicated here.
|
|
151
|
|
- let rtsLinker = not $ arch `elem` ["powerpc", "powerpc64", "powerpc64le", "s390x", "loongarch64", "javascript"]
|
|
|
150
|
+ let rtsLinker = arch `notElem` ["powerpc", "powerpc64", "powerpc64le", "s390x", "loongarch64", "javascript"]
|
|
152
|
151
|
|
|
153
|
152
|
return TestCompilerArgs{..}
|
|
154
|
153
|
|