summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-03-27 00:27:01 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-05-06 14:59:29 -0400
commit27941064872b19f65e99ba65b7fa8635268ee738 (patch)
treec601e08e8b9be05605cc04daf28cb2642585aa31
parentead3f835e24338fb3df3ebdec3e86f9364df7c9c (diff)
downloadhaskell-27941064872b19f65e99ba65b7fa8635268ee738.tar.gz
Remove cGhcEnableTablesNextToCode
Get "Tables next to code" from the settings file instead.
-rw-r--r--compiler/ghc.mk2
-rw-r--r--compiler/main/DynFlags.hs18
-rw-r--r--compiler/main/SysTools.hs4
-rw-r--r--hadrian/src/Rules/Generate.hs5
-rw-r--r--includes/ghc.mk1
5 files changed, 15 insertions, 15 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 69eff31330..988759ecb1 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -106,8 +106,6 @@ ifeq "$(GhcRtsWithLibdw)" "YES"
else
@echo 'cGhcRtsWithLibdw = False' >> $@
endif
- @echo 'cGhcEnableTablesNextToCode :: String' >> $@
- @echo 'cGhcEnableTablesNextToCode = "$(GhcEnableTablesNextToCode)"' >> $@
@echo 'cLeadingUnderscore :: String' >> $@
@echo 'cLeadingUnderscore = "$(LeadingUnderscore)"' >> $@
@echo 'cLibFFI :: Bool' >> $@
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 786deccf3c..01750a8bd0 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1353,7 +1353,10 @@ data Settings = Settings {
sOpt_lcc :: [String], -- LLVM: c compiler
sOpt_i :: [String], -- iserv options
- sPlatformConstants :: PlatformConstants
+ sPlatformConstants :: PlatformConstants,
+
+ -- Formerly Config.hs, target specific
+ sTablesNextToCode :: Bool
}
targetPlatform :: DynFlags -> Platform
@@ -1621,17 +1624,14 @@ defaultObjectTarget platform
| cGhcWithNativeCodeGen == "YES" = HscAsm
| otherwise = HscLlvm
-tablesNextToCode :: DynFlags -> Bool
-tablesNextToCode dflags
- = mkTablesNextToCode (platformUnregisterised (targetPlatform dflags))
-
-- Determines whether we will be compiling
-- info tables that reside just before the entry code, or with an
-- indirection to the entry code. See TABLES_NEXT_TO_CODE in
-- includes/rts/storage/InfoTables.h.
-mkTablesNextToCode :: Bool -> Bool
-mkTablesNextToCode unregisterised
- = not unregisterised && cGhcEnableTablesNextToCode == "YES"
+tablesNextToCode :: DynFlags -> Bool
+tablesNextToCode dflags =
+ not (platformUnregisterised $ targetPlatform dflags) &&
+ sTablesNextToCode (settings dflags)
data DynLibLoader
= Deployable
@@ -5621,7 +5621,7 @@ compilerInfo dflags
("Object splitting supported", showBool False),
("Have native code generator", cGhcWithNativeCodeGen),
("Support SMP", cGhcWithSMP),
- ("Tables next to code", cGhcEnableTablesNextToCode),
+ ("Tables next to code", showBool $ sTablesNextToCode $ settings dflags),
("RTS ways", cGhcRTSWays),
("RTS expects libdw", showBool cGhcRtsWithLibdw),
-- Whether or not we support @-dynamic-too@
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index 6eccdd7ec6..4374c35dcf 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -184,6 +184,7 @@ initSysTools top_dir
targetHasGnuNonexecStack <- readSetting "target has GNU nonexec stack"
targetHasIdentDirective <- readSetting "target has .ident directive"
targetHasSubsectionsViaSymbols <- readSetting "target has subsections via symbols"
+ tablesNextToCode <- getBooleanSetting "Tables next to code"
myExtraGccViaCFlags <- getSetting "GCC extra via C opts"
-- On Windows, mingw is distributed with GHC,
-- so we look in TopDir/../mingw/bin,
@@ -303,7 +304,8 @@ initSysTools top_dir
sOpt_lo = [],
sOpt_lc = [],
sOpt_i = [],
- sPlatformConstants = platformConstants
+ sPlatformConstants = platformConstants,
+ sTablesNextToCode = tablesNextToCode
}
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 0c35e85dd7..97cd124594 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -303,6 +303,8 @@ generateSettings = do
, ("LLVM llc command", settingsFileSetting SettingsFileSetting_LlcCommand)
, ("LLVM opt command", settingsFileSetting SettingsFileSetting_OptCommand)
, ("LLVM clang command", settingsFileSetting SettingsFileSetting_ClangCommand)
+
+ , ("Tables next to code", yesNo <$> ghcEnableTablesNextToCode)
]
let showTuple (k, v) = "(" ++ show k ++ ", " ++ show v ++ ")"
pure $ case settings of
@@ -334,7 +336,6 @@ generateConfigHs = do
cGhcWithInterpreter <- expr $ yesNo <$> ghcWithInterpreter
cGhcWithNativeCodeGen <- expr $ yesNo <$> ghcWithNativeCodeGen
cGhcWithSMP <- expr $ yesNo <$> ghcWithSMP
- cGhcEnableTablesNextToCode <- expr $ yesNo <$> ghcEnableTablesNextToCode
cLeadingUnderscore <- expr $ yesNo <$> flag LeadingUnderscore
cLibFFI <- expr useLibFFIForAdjustors
rtsWays <- getRtsWays
@@ -389,8 +390,6 @@ generateConfigHs = do
, "cGhcWithSMP = " ++ show cGhcWithSMP
, "cGhcRTSWays :: String"
, "cGhcRTSWays = " ++ show cGhcRTSWays
- , "cGhcEnableTablesNextToCode :: String"
- , "cGhcEnableTablesNextToCode = " ++ show cGhcEnableTablesNextToCode
, "cLeadingUnderscore :: String"
, "cLeadingUnderscore = " ++ show cLeadingUnderscore
, "cLibFFI :: Bool"
diff --git a/includes/ghc.mk b/includes/ghc.mk
index b7bac36ba0..4a25aaa8c1 100644
--- a/includes/ghc.mk
+++ b/includes/ghc.mk
@@ -210,6 +210,7 @@ $(includes_SETTINGS) : includes/Makefile | $$(dir $$@)/.
@echo ',("LLVM llc command", "$(SettingsLlcCommand)")' >> $@
@echo ',("LLVM opt command", "$(SettingsOptCommand)")' >> $@
@echo ',("LLVM clang command", "$(SettingsClangCommand)")' >> $@
+ @echo ',("Tables next to code", "$(GhcEnableTablesNextToCode)")' >> $@
@echo ']' >> $@