summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-04-06 13:56:53 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-04-07 12:39:00 -0400
commitd014ab0db0c167ab5a0f9cb15280aee6fd8f3621 (patch)
tree9c60484f66b951774db80f2de2e98e978087467a /hadrian
parent546f8b1478e43f18b25236a20c6c30fa986a046a (diff)
downloadhaskell-d014ab0db0c167ab5a0f9cb15280aee6fd8f3621.tar.gz
Remove dynamic-by-default (#16782)
Dynamic-by-default was a mechanism to automatically select the -dynamic way for some targets. It was implemented in a convoluted way: it was defined as a flavour option, hence it couldn't be passed as a global settings (which are produced by `configure` before considering flavours), so a build system rule was used to pass -DDYNAMIC_BY_DEFAULT to the C compiler so that deriveConstants could infer it. * Make build system has it disabled for 8 years (951e28c0625ece7e0db6ac9d4a1e61e2737b10de) * It has never been implemented in Hadrian * Last time someone tried to enable it 1 year ago it didn't work (!2436) * Having this as a global constant impedes making GHC multi-target (see !5427) This commit fully removes support for dynamic-by-default. If someone wants to reimplement something like this, it would probably need to move the logic in the compiler. (Doing this would probably need some refactoring of the way the compiler handles DynFlags: DynFlags are used to store and to pass enabled ways to many parts of the compiler. It can be set by command-line flags, GHC API, global settings. In multi-target GHC, we will use DynFlags to load the target platform and its constants: but at this point with the current DynFlags implementation we can't easily update the existing DynFlags with target-specific options such as dynamic-by-default without overriding ways previously set by the user.)
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Oracles/TestSettings.hs2
-rw-r--r--hadrian/src/Settings/Builders/DeriveConstants.hs1
-rw-r--r--hadrian/src/Settings/Builders/RunTest.hs2
3 files changed, 0 insertions, 5 deletions
diff --git a/hadrian/src/Oracles/TestSettings.hs b/hadrian/src/Oracles/TestSettings.hs
index ba89e00beb..b5f197299b 100644
--- a/hadrian/src/Oracles/TestSettings.hs
+++ b/hadrian/src/Oracles/TestSettings.hs
@@ -28,7 +28,6 @@ data TestSetting = TestHostOS
| TestGhcWithInterpreter
| TestGhcUnregisterised
| TestGhcWithSMP
- | TestGhcDynamicByDefault
| TestGhcDynamic
| TestGhcProfiled
| TestAR
@@ -57,7 +56,6 @@ testSetting key = do
TestGhcWithInterpreter -> "GhcWithInterpreter"
TestGhcUnregisterised -> "GhcUnregisterised"
TestGhcWithSMP -> "GhcWithSMP"
- TestGhcDynamicByDefault -> "GhcDynamicByDefault"
TestGhcDynamic -> "GhcDynamic"
TestGhcProfiled -> "GhcProfiled"
TestAR -> "AR"
diff --git a/hadrian/src/Settings/Builders/DeriveConstants.hs b/hadrian/src/Settings/Builders/DeriveConstants.hs
index be115fb789..856e85aac0 100644
--- a/hadrian/src/Settings/Builders/DeriveConstants.hs
+++ b/hadrian/src/Settings/Builders/DeriveConstants.hs
@@ -11,7 +11,6 @@ deriveConstantsPairs =
, ("platformConstants", "--gen-haskell-value")
]
--- TODO: do we need to support `includes_CC_OPTS += -DDYNAMIC_BY_DEFAULT`?
deriveConstantsBuilderArgs :: Args
deriveConstantsBuilderArgs = builder DeriveConstants ? do
cFlags <- includeCcArgs
diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs
index 8fcc0aaee2..7ea8d4f364 100644
--- a/hadrian/src/Settings/Builders/RunTest.hs
+++ b/hadrian/src/Settings/Builders/RunTest.hs
@@ -63,7 +63,6 @@ runTestBuilderArgs = builder RunTest ? do
let hasRtsWay w = elem w rtsWays
hasLibWay w = elem w libWays
hasDynamic <- getBooleanSetting TestGhcDynamic
- hasDynamicByDefault <- getBooleanSetting TestGhcDynamicByDefault
withNativeCodeGen <- getBooleanSetting TestGhcWithNativeCodeGen
withInterpreter <- getBooleanSetting TestGhcWithInterpreter
unregisterised <- getBooleanSetting TestGhcUnregisterised
@@ -127,7 +126,6 @@ runTestBuilderArgs = builder RunTest ? do
, arg "-e", arg $ asBool "config.have_fast_bignum=" (bignumBackend /= "native" && not bignumCheck)
, arg "-e", arg $ asBool "ghc_with_smp=" withSMP
- , arg "-e", arg $ "config.ghc_dynamic_by_default=" ++ show hasDynamicByDefault
, arg "-e", arg $ "config.ghc_dynamic=" ++ show hasDynamic
, arg "-e", arg $ "config.wordsize=" ++ show wordsize