summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-04-11 13:23:22 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-27 10:06:07 -0400
commitee11d04363ed8aa1d73a0cda16076a39e668d163 (patch)
tree8cb2853ac6cd99442f7ff7c4e4f979e7674301e4 /hadrian
parent318e0005b5a3a522854ced7162f3eee95f964bd9 (diff)
downloadhaskell-ee11d04363ed8aa1d73a0cda16076a39e668d163.tar.gz
Enable eventlog support in all ways by default
Here we deprecate the eventlogging RTS ways and instead enable eventlog support in the remaining ways. This simplifies packaging and reduces GHC compilation times (as we can eliminate two whole compilations of the RTS) while simplifying the end-user story. The trade-off is a small increase in binary sizes in the case that the user does not want eventlogging support, but we think that this is a fine trade-off. This also revealed a latent RTS bug: some files which included `Cmm.h` also assumed that it defined various macros which were in fact defined by `Config.h`, which `Cmm.h` did not include. Fixing this in turn revealed that `StgMiscClosures.cmm` failed to import various spinlock statistics counters, as evidenced by the failed unregisterised build. Closes #18948.
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/cfg/system.config.in1
-rw-r--r--hadrian/doc/flavours.md28
-rw-r--r--hadrian/doc/user-settings.md9
-rw-r--r--hadrian/src/Expression.hs6
-rw-r--r--hadrian/src/Settings/Builders/Ghc.hs3
-rw-r--r--hadrian/src/Settings/Default.hs4
-rw-r--r--hadrian/src/Settings/Flavours/Benchmark.hs2
-rw-r--r--hadrian/src/Settings/Flavours/Development.hs2
-rw-r--r--hadrian/src/Settings/Flavours/Quick.hs7
-rw-r--r--hadrian/src/Settings/Flavours/QuickCross.hs7
-rw-r--r--hadrian/src/Settings/Flavours/Quickest.hs2
-rw-r--r--hadrian/src/Settings/Flavours/Validate.hs3
-rw-r--r--hadrian/src/Settings/Packages.hs4
-rw-r--r--hadrian/src/Way.hs23
14 files changed, 30 insertions, 71 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in
index ddb6f54cb6..ae70823202 100644
--- a/hadrian/cfg/system.config.in
+++ b/hadrian/cfg/system.config.in
@@ -88,7 +88,6 @@ ghc-minor-version = @GhcMinVersion@
ghc-patch-level = @GhcPatchLevel@
bootstrap-threaded-rts = @GhcThreadedRts@
-bootstrap-event-logging-rts = @GhcEventLoggingRts@
project-name = @ProjectName@
project-version = @ProjectVersion@
diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md
index f0d34ddc90..3ef7ac5a3a 100644
--- a/hadrian/doc/flavours.md
+++ b/hadrian/doc/flavours.md
@@ -292,26 +292,16 @@ information. The following table lists ways that are built in different flavours
<th>default<br>perf<br>prof<br>devel1<br>devel2</td>
<td>vanilla</td>
<td>vanilla<br>profiling<br>dynamic</td>
- <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging
- <br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic
- <br>loggingDynamic<br>threadedLoggingDynamic
- </td>
- <td>
- logging<br>debug<br>threaded<br>threadedDebug<br>
- threadedLogging<br>threadedProfiling
- <br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic
- <br>loggingDynamic<br>threadedLoggingDynamic
- </td>
+ <td>debug<br>threaded<br>threadedDebug<br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic</td>
+ <td>debug<br>threaded<br>threadedDebug<br>threadedProfiling<br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic</td>
</tr>
<tr>
<th>static</td>
<td>vanilla</td>
<td>vanilla<br>profiling</td>
- <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging
- </td>
+ <td>debug<br>threaded<br>threadedDebug</td>
<td>
- logging<br>debug<br>threaded<br>threadedDebug<br>
- threadedLogging<br>threadedProfiling
+ debug<br>threaded<br>threadedDebug<br>threadedProfiling
</td>
<td>Only in<br>prof<br>flavour</td>
<td>Only in<br>prof<br>flavour</td>
@@ -320,14 +310,8 @@ information. The following table lists ways that are built in different flavours
<th>quick<br>quick-validate<br>quick-debug</th>
<td>vanilla</td>
<td>vanilla<br>dynamic</td>
- <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging
- <br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic
- <br>loggingDynamic<br>threadedLoggingDynamic
- </td>
- <td>logging<br>debug<br>threaded<br>threadedDebug<br>threadedLogging
- <br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic
- <br>loggingDynamic<br>threadedLoggingDynamic
- </td>
+ <td>debug<br>threaded<br>threadedDebug<br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic</td>
+ <td>debug<br>threaded<br>threadedDebug<br>debugDynamic<br>threadedDynamic<br>threadedDebugDynamic</td>
</tr>
<tr>
<th>quickest<br>bench</th>
diff --git a/hadrian/doc/user-settings.md b/hadrian/doc/user-settings.md
index 0cc7807755..82f9964ac6 100644
--- a/hadrian/doc/user-settings.md
+++ b/hadrian/doc/user-settings.md
@@ -324,15 +324,14 @@ One can alternatively supply settings from the command line or a
For example, putting the following in a file at `_build/hadrian.settings`:
``` make
-stage1.ghc-bin.ghc.link.opts += -eventlog
+stage1.ghc-bin.ghc.link.opts += -debug
*.base.ghc.*.opts += -v3
```
and running hadrian with the default build root (`_build`), would respectively
-link the stage 2 GHC executable (using the stage 1 GHC) with the `-eventlog`
-flag, so that stage 2 GHC supports producing eventlogs with `+RTS -l`, and use
-`-v3` on all GHC commands used to build anything related to `base`, whatever
-the stage.
+link the stage 2 GHC executable (using the stage 1 GHC) with the `-debug`
+flag and use `-v3` on all GHC commands used to build anything related to
+`base`, whatever the stage.
We could equivalently specify those settings on the command-line:
diff --git a/hadrian/src/Expression.hs b/hadrian/src/Expression.hs
index 821b7d5a1e..3d6b9b896c 100644
--- a/hadrian/src/Expression.hs
+++ b/hadrian/src/Expression.hs
@@ -9,7 +9,7 @@ module Expression (
-- ** Predicates
(?), stage, stage0, stage1, stage2, notStage0, threadedBootstrapper,
- eventLoggingBootstrapper, package, notPackage, packageOneOf,
+ package, notPackage, packageOneOf,
libraryPackage, builder, way, input, inputs, output, outputs,
-- ** Evaluation
@@ -132,10 +132,6 @@ notStage0 = notM stage0
threadedBootstrapper :: Predicate
threadedBootstrapper = expr (flag BootstrapThreadedRts)
--- | Whether or not the bootstrapping compiler provides an event-logging RTS.
-eventLoggingBootstrapper :: Predicate
-eventLoggingBootstrapper = expr (flag BootstrapEventLoggingRts)
-
-- | Is a certain package /not/ built right now?
notPackage :: Package -> Predicate
notPackage = notM . package
diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs
index 6c47c2fba1..9dd481d7fe 100644
--- a/hadrian/src/Settings/Builders/Ghc.hs
+++ b/hadrian/src/Settings/Builders/Ghc.hs
@@ -240,12 +240,9 @@ wayGhcArgs = do
, (Threaded `wayUnit` way) ? arg "-optc-DTHREADED_RTS"
, (Debug `wayUnit` way) ? arg "-optc-DDEBUG"
, (Profiling `wayUnit` way) ? arg "-prof"
- , supportsEventlog way ? arg "-eventlog"
, (way == debug || way == debugDynamic) ?
pure ["-ticky", "-DTICKY_TICKY"] ]
- where supportsEventlog w = any (`wayUnit` w) [Logging, Profiling, Debug]
-
packageGhcArgs :: Args
packageGhcArgs = do
package <- getPackage
diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs
index 3b3498461c..b13f65cd92 100644
--- a/hadrian/src/Settings/Default.hs
+++ b/hadrian/src/Settings/Default.hs
@@ -178,12 +178,10 @@ defaultRtsWays = Set.fromList <$>
[ pure [vanilla, threaded]
, notStage0 ? pure
[ profiling, threadedProfiling, debugProfiling, threadedDebugProfiling
- , logging, threadedLogging
, debug, threadedDebug
]
, notStage0 ? platformSupportsSharedLibs ? pure
- [ dynamic, threadedDynamic, debugDynamic, loggingDynamic
- , threadedDebugDynamic, threadedLoggingDynamic
+ [ dynamic, threadedDynamic, debugDynamic, threadedDebugDynamic
]
]
diff --git a/hadrian/src/Settings/Flavours/Benchmark.hs b/hadrian/src/Settings/Flavours/Benchmark.hs
index e4c5de0199..4e5cea0635 100644
--- a/hadrian/src/Settings/Flavours/Benchmark.hs
+++ b/hadrian/src/Settings/Flavours/Benchmark.hs
@@ -11,7 +11,7 @@ benchmarkFlavour = defaultFlavour
{ name = "bench"
, args = defaultBuilderArgs <> benchmarkArgs <> defaultPackageArgs
, libraryWays = pure $ Set.fromList [vanilla]
- , rtsWays = pure $ Set.fromList [vanilla, threaded, logging, threadedLogging] }
+ , rtsWays = pure $ Set.fromList [vanilla, threaded] }
benchmarkArgs :: Args
benchmarkArgs = sourceArgs SourceArgs
diff --git a/hadrian/src/Settings/Flavours/Development.hs b/hadrian/src/Settings/Flavours/Development.hs
index 7e83c5641d..75c0886bce 100644
--- a/hadrian/src/Settings/Flavours/Development.hs
+++ b/hadrian/src/Settings/Flavours/Development.hs
@@ -13,7 +13,7 @@ developmentFlavour ghcStage = defaultFlavour
{ name = "devel" ++ show (fromEnum ghcStage)
, args = defaultBuilderArgs <> developmentArgs ghcStage <> defaultPackageArgs
, libraryWays = pure $ Set.fromList [vanilla]
- , rtsWays = pure $ Set.fromList [vanilla, logging, debug, threaded, threadedLogging, threadedDebug]
+ , rtsWays = pure $ Set.fromList [vanilla, debug, threaded, threadedDebug]
, dynamicGhcPrograms = return False
, ghcDebugAssertions = True }
diff --git a/hadrian/src/Settings/Flavours/Quick.hs b/hadrian/src/Settings/Flavours/Quick.hs
index 2ddf45b1a1..afffa4ceb7 100644
--- a/hadrian/src/Settings/Flavours/Quick.hs
+++ b/hadrian/src/Settings/Flavours/Quick.hs
@@ -23,11 +23,10 @@ quickFlavour = defaultFlavour
, rtsWays = Set.fromList <$>
mconcat
[ pure
- [ vanilla, threaded, logging, debug
- , threadedDebug, threadedLogging, threaded ]
+ [ vanilla, threaded, debug
+ , threadedDebug, threaded ]
, notStage0 ? platformSupportsSharedLibs ? pure
- [ dynamic, debugDynamic, threadedDynamic, loggingDynamic
- , threadedDebugDynamic, threadedLoggingDynamic ]
+ [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic ]
] }
quickArgs :: Args
diff --git a/hadrian/src/Settings/Flavours/QuickCross.hs b/hadrian/src/Settings/Flavours/QuickCross.hs
index 35b0dcc988..45e23402e4 100644
--- a/hadrian/src/Settings/Flavours/QuickCross.hs
+++ b/hadrian/src/Settings/Flavours/QuickCross.hs
@@ -20,11 +20,10 @@ quickCrossFlavour = defaultFlavour
, rtsWays = Set.fromList <$>
mconcat
[ pure
- [ vanilla, threaded, logging, debug
- , threadedDebug, threadedLogging, threaded ]
+ [ vanilla, threaded, debug, threadedDebug, threaded ]
, notStage0 ? platformSupportsSharedLibs ? pure
- [ dynamic, debugDynamic, threadedDynamic, loggingDynamic
- , threadedDebugDynamic, threadedLoggingDynamic ]
+ [ dynamic, debugDynamic, threadedDynamic
+ , threadedDebugDynamic ]
] }
quickCrossArgs :: Args
diff --git a/hadrian/src/Settings/Flavours/Quickest.hs b/hadrian/src/Settings/Flavours/Quickest.hs
index 6ab1ed3068..ee695d99b1 100644
--- a/hadrian/src/Settings/Flavours/Quickest.hs
+++ b/hadrian/src/Settings/Flavours/Quickest.hs
@@ -12,7 +12,7 @@ quickestFlavour = defaultFlavour
{ name = "quickest"
, args = defaultBuilderArgs <> quickestArgs <> defaultPackageArgs
, libraryWays = pure (Set.fromList [vanilla])
- , rtsWays = pure (Set.fromList [vanilla, threaded, threadedLogging, logging])
+ , rtsWays = pure (Set.fromList [vanilla, threaded])
, dynamicGhcPrograms = return False }
quickestArgs :: Args
diff --git a/hadrian/src/Settings/Flavours/Validate.hs b/hadrian/src/Settings/Flavours/Validate.hs
index 913e431b58..e722d16061 100644
--- a/hadrian/src/Settings/Flavours/Validate.hs
+++ b/hadrian/src/Settings/Flavours/Validate.hs
@@ -18,10 +18,9 @@ validateFlavour = werror $ defaultFlavour
, notStage0 ? platformSupportsSharedLibs ? pure [dynamic]
]
, rtsWays = Set.fromList <$>
- mconcat [ pure [vanilla, threaded, debug, logging, threadedDebug, threadedLogging]
+ mconcat [ pure [vanilla, threaded, debug, threadedDebug]
, notStage0 ? platformSupportsSharedLibs ? pure
[ dynamic, threadedDynamic, debugDynamic, threadedDebugDynamic
- , loggingDynamic, threadedLoggingDynamic
]
]
}
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index d4b8810810..d88c96115e 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -94,9 +94,6 @@ packageArgs = do
-- We build a threaded stage N, N>1 if the configuration calls
-- for it.
((ghcThreaded <$> expr flavour) `cabalFlag` "threaded")
- -- Don't try to build stage 1 with an event-logging RTS if
- -- the bootstrapping compiler doesn't support it.
- , orM [notStage0, eventLoggingBootstrapper] `cabalFlag` "eventlog"
]
]
@@ -376,7 +373,6 @@ rtsPackageArgs = package rts ? do
[ builder (Cabal Flags) ? mconcat
[ any (wayUnit Profiling) rtsWays `cabalFlag` "profiling"
, any (wayUnit Debug) rtsWays `cabalFlag` "debug"
- , any (wayUnit Logging) rtsWays `cabalFlag` "logging"
, any (wayUnit Dynamic) rtsWays `cabalFlag` "dynamic"
, useSystemFfi `cabalFlag` "use-system-libffi"
, useLibffiForAdjustors `cabalFlag` "libffi-adjustors"
diff --git a/hadrian/src/Way.hs b/hadrian/src/Way.hs
index 99aa7e28a9..044d781661 100644
--- a/hadrian/src/Way.hs
+++ b/hadrian/src/Way.hs
@@ -1,10 +1,10 @@
module Way (
WayUnit (..), Way, wayUnit, addWayUnit, removeWayUnit, wayFromUnits, allWays,
- vanilla, profiling, dynamic, profilingDynamic, threaded, debug, logging,
- threadedDebug, threadedProfiling, threadedLogging, threadedDynamic,
+ vanilla, profiling, dynamic, profilingDynamic, threaded, debug,
+ threadedDebug, threadedProfiling, threadedDynamic,
threadedDebugProfiling, threadedDebugDynamic, threadedProfilingDynamic,
- threadedLoggingDynamic, debugProfiling, debugDynamic, loggingDynamic,
+ debugProfiling, debugDynamic,
wayPrefix, waySuffix, hisuf, osuf, hcsuf, obootsuf, hibootsuf, ssuf
) where
@@ -28,10 +28,6 @@ profilingDynamic :: Way
profilingDynamic = wayFromUnits [Profiling, Dynamic]
-- RTS only ways below. See compiler/GHC/Driver/Session.hs.
--- | Build RTS with event logging.
-logging :: Way
-logging = wayFromUnits [Logging]
-
-- | Build multithreaded RTS.
threaded :: Way
threaded = wayFromUnits [Threaded]
@@ -41,28 +37,25 @@ debug :: Way
debug = wayFromUnits [Debug]
-- | Various combinations of RTS only ways.
-threadedDebug, threadedProfiling, threadedLogging, threadedDynamic,
+threadedDebug, threadedProfiling, threadedDynamic,
threadedDebugProfiling, threadedDebugDynamic, threadedProfilingDynamic,
- threadedLoggingDynamic, debugProfiling, debugDynamic, loggingDynamic :: Way
+ debugProfiling, debugDynamic :: Way
threadedDebug = wayFromUnits [Threaded, Debug]
threadedProfiling = wayFromUnits [Threaded, Profiling]
-threadedLogging = wayFromUnits [Threaded, Logging]
threadedDynamic = wayFromUnits [Threaded, Dynamic]
threadedDebugProfiling = wayFromUnits [Threaded, Debug, Profiling]
threadedDebugDynamic = wayFromUnits [Threaded, Debug, Dynamic]
threadedProfilingDynamic = wayFromUnits [Threaded, Profiling, Dynamic]
-threadedLoggingDynamic = wayFromUnits [Threaded, Logging, Dynamic]
debugProfiling = wayFromUnits [Debug, Profiling]
debugDynamic = wayFromUnits [Debug, Dynamic]
-loggingDynamic = wayFromUnits [Logging, Dynamic]
-- | All ways supported by the build system.
allWays :: [Way]
allWays =
- [ vanilla, profiling, dynamic, profilingDynamic, threaded, debug, logging
- , threadedDebug, threadedProfiling, threadedLogging, threadedDynamic
+ [ vanilla, profiling, dynamic, profilingDynamic, threaded, debug
+ , threadedDebug, threadedProfiling, threadedDynamic
, threadedDebugProfiling, threadedDebugDynamic, threadedProfilingDynamic
- , threadedLoggingDynamic, debugProfiling, debugDynamic, loggingDynamic ]
+ , debugProfiling, debugDynamic ]
wayPrefix :: Way -> String
wayPrefix way | way == vanilla = ""