@@ -63,12 +63,13 @@ let
6363 libDir = "lib/${ghcCommand}-${ghc.version}";
6464 packageCfgDir = "${libDir}/package.conf.d";
6565
66−in { identifier, component, fullName, flags ? {} }:
66+in { identifier, component, fullName, flags ? {}, needsProfiling ? false }:
6767 # Filters out only library packages that for this GHC target
6868 # TODO investigate why this is needed
6969 # TODO find out why p ? configFiles helps (for instance for `R1909.aarch64-unknown-linux-gnu.tests.cabal-22.run.x86_64-linux`)
70− let libDeps = lib.filter (p: (p ? configFiles) && p.configFiles.targetPrefix == ghc.targetPrefix)
71− (map getLibComponent component.depends);
70+ let libDeps = (if needsProfiling then (x: map (p: p.override { enableLibraryProfiling = true; }) x) else x: x)
71+ (lib.filter (p: (p ? configFiles) && p.configFiles.targetPrefix == ghc.targetPrefix)
72+ (map getLibComponent component.depends));
7273 cfgFiles =
7374 let xs = map
7475 (p: "${p.configFiles}")