summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2019-01-20 19:25:26 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-08-10 14:39:27 -0400
commit818602818bb8553b241271204d159d5a40971d5a (patch)
tree135e9d4f7d635b94effe709efc8e3f20cc6968f6 /hadrian
parent83ca42de519cdfa28b38164e90d726034dba768e (diff)
downloadhaskell-818602818bb8553b241271204d159d5a40971d5a.tar.gz
Consolidate `TablesNextToCode` and `GhcUnreigsterised` in configure (#15548)
`TablesNextToCode` is now a substituted by configure, where it has the correct defaults and error handling. Nowhere else needs to duplicate that, though we may want the compiler to to guard against bogus settings files. I renamed it from `GhcEnableTablesNextToCode` to `TablesNextToCode` to: - Help me guard against any unfixed usages - Remove any lingering connotation that this flag needs to be combined with `GhcUnreigsterised`. Original reviewers: Original subscribers: TerrorJack, rwbarton, carter Original Differential Revision: https://phabricator.haskell.org/D5082
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/cfg/system.config.in1
-rw-r--r--hadrian/src/Oracles/Flag.hs2
-rw-r--r--hadrian/src/Oracles/Setting.hs7
-rw-r--r--hadrian/src/Rules/Generate.hs4
-rw-r--r--hadrian/src/Settings/Packages.hs7
5 files changed, 10 insertions, 11 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in
index 5bdb322551..2380baf9c0 100644
--- a/hadrian/cfg/system.config.in
+++ b/hadrian/cfg/system.config.in
@@ -43,6 +43,7 @@ hs-cpp-args = @HaskellCPPArgs@
solaris-broken-shld = @SOLARIS_BROKEN_SHLD@
ghc-unregisterised = @Unregisterised@
+tables-next-to-code = @TablesNextToCode@
ghc-source-path = @hardtop@
leading-underscore = @LeadingUnderscore@
diff --git a/hadrian/src/Oracles/Flag.hs b/hadrian/src/Oracles/Flag.hs
index 4f5116bf41..075a1bfe23 100644
--- a/hadrian/src/Oracles/Flag.hs
+++ b/hadrian/src/Oracles/Flag.hs
@@ -13,6 +13,7 @@ data Flag = ArSupportsAtFile
| CrossCompiling
| GccIsClang
| GhcUnregisterised
+ | TablesNextToCode
| GmpInTree
| GmpFrameworkPref
| LeadingUnderscore
@@ -30,6 +31,7 @@ flag f = do
CrossCompiling -> "cross-compiling"
GccIsClang -> "gcc-is-clang"
GhcUnregisterised -> "ghc-unregisterised"
+ TablesNextToCode -> "tables-next-to-code"
GmpInTree -> "intree-gmp"
GmpFrameworkPref -> "gmp-framework-preferred"
LeadingUnderscore -> "leading-underscore"
diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs
index 408f9e3422..51ccc729a3 100644
--- a/hadrian/src/Oracles/Setting.hs
+++ b/hadrian/src/Oracles/Setting.hs
@@ -1,7 +1,7 @@
module Oracles.Setting (
configFile, Setting (..), SettingList (..), setting, settingList, getSetting,
getSettingList, anyTargetPlatform, anyTargetOs, anyTargetArch, anyHostOs,
- ghcWithInterpreter, ghcEnableTablesNextToCode, useLibFFIForAdjustors,
+ ghcWithInterpreter, useLibFFIForAdjustors,
ghcCanonVersion, cmdLineLengthLimit, hostSupportsRPaths, topDirectory,
libsuf, ghcVersionStage, SettingsFileSetting (..), settingsFileSetting
) where
@@ -225,11 +225,6 @@ ghcWithInterpreter = do
, "sparc64", "arm" ]
return $ goodOs && goodArch
--- | Check whether the target architecture supports placing info tables next to
--- code. See: https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/storage/heap-objects#tables_next_to_code.
-ghcEnableTablesNextToCode :: Action Bool
-ghcEnableTablesNextToCode = notM $ anyTargetArch ["ia64", "powerpc64", "powerpc64le"]
-
-- | Check to use @libffi@ for adjustors.
useLibFFIForAdjustors :: Action Bool
useLibFFIForAdjustors = notM $ anyTargetArch ["i386", "x86_64"]
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 18e6f9271c..8ad8ead4c7 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -313,7 +313,7 @@ generateSettings = do
, ("Use native code generator", expr $ yesNo <$> ghcWithNativeCodeGen)
, ("Support SMP", expr $ yesNo <$> ghcWithSMP)
, ("RTS ways", unwords . map show <$> getRtsWays)
- , ("Tables next to code", expr $ yesNo <$> ghcEnableTablesNextToCode)
+ , ("Tables next to code", expr $ yesNo <$> flag TablesNextToCode)
, ("Leading underscore", expr $ yesNo <$> flag LeadingUnderscore)
, ("Use LibFFI", expr $ yesNo <$> useLibFFIForAdjustors)
, ("Use Threads", yesNo . any (wayUnit Threaded) <$> getRtsWays)
@@ -373,7 +373,7 @@ generateGhcAutoconfH :: Expr String
generateGhcAutoconfH = do
trackGenerateHs
configHContents <- expr $ map undefinePackage <$> readFileLines configH
- tablesNextToCode <- expr ghcEnableTablesNextToCode
+ tablesNextToCode <- getFlag TablesNextToCode
ghcUnreg <- getFlag GhcUnregisterised
ccLlvmBackend <- getSetting CcLlvmBackend
ccClangBackend <- getSetting CcClangBackend
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index ecffc58c9d..01c170b68e 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -67,7 +67,7 @@ packageArgs = do
, (any (wayUnit Threaded) rtsWays) ?
notStage0 ? arg "--ghc-option=-optc-DTHREADED_RTS"
, ghcWithInterpreter ?
- ghcEnableTablesNextToCode ?
+ flag TablesNextToCode ?
notM (flag GhcUnregisterised) ?
notStage0 ? arg "--ghc-option=-DGHCI_TABLES_NEXT_TO_CODE"
, ghcWithInterpreter ?
@@ -196,7 +196,7 @@ rtsPackageArgs = package rts ? do
targetOs <- getSetting TargetOs
targetVendor <- getSetting TargetVendor
ghcUnreg <- expr $ yesNo <$> flag GhcUnregisterised
- ghcEnableTNC <- expr $ yesNo <$> ghcEnableTablesNextToCode
+ ghcEnableTNC <- expr $ yesNo <$> flag TablesNextToCode
rtsWays <- getRtsWays
way <- getWay
path <- getBuildPath
@@ -249,7 +249,8 @@ rtsPackageArgs = package rts ? do
, "-DTargetOS=" ++ show targetOs
, "-DTargetVendor=" ++ show targetVendor
, "-DGhcUnregisterised=" ++ show ghcUnreg
- , "-DGhcEnableTablesNextToCode=" ++ show ghcEnableTNC ]
+ , "-DTablesNextToCode=" ++ show ghcEnableTNC
+ ]
-- We're after pur performance here. So make sure fast math and
-- vectorization is enabled.