Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Cabal/src/Distribution/Simple/Compiler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,13 @@ profilingVanillaSupported comp = waySupported "p" comp

-- | Is the compiler distributed with profiling dynamic libraries
profilingDynamicSupported :: Compiler -> Maybe Bool
profilingDynamicSupported comp =
-- Certainly not before this version, as it was not implemented yet.
if compilerVersion comp <= mkVersion [9, 11, 0]
then Just False
else waySupported "p_dyn" comp
profilingDynamicSupported comp
| GHC <- compilerFlavor comp
, -- Certainly not before 9.11, as prof+dyn was not implemented yet.
compilerVersion comp <= mkVersion [9, 11, 0] =
Just False
| otherwise =
waySupported "p_dyn" comp

-- | Either profiling dynamic is definitely supported or we don't know (so assume
-- it is)
Expand Down
11 changes: 9 additions & 2 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2316,10 +2316,15 @@ elaborateInstallPlan
{ withVanillaLib = perPkgOptionFlag pkgid True packageConfigVanillaLib -- TODO: [required feature]: also needs to be handled recursively
, withSharedLib = canBuildSharedLibs && pkgid `Set.member` pkgsUseSharedLibrary
, withStaticLib = perPkgOptionFlag pkgid False packageConfigStaticLib
, withDynExe = perPkgOptionFlag pkgid False packageConfigDynExe
, withDynExe =
perPkgOptionFlag pkgid False packageConfigDynExe
-- We can't produce a dynamic executable if the user
-- wants to enable executable profiling but the
-- compiler doesn't support prof+dyn.
&& (okProfDyn || not profExe)
, withFullyStaticExe = perPkgOptionFlag pkgid False packageConfigFullyStaticExe
, withGHCiLib = perPkgOptionFlag pkgid False packageConfigGHCiLib -- TODO: [required feature] needs to default to enabled on windows still
, withProfExe = perPkgOptionFlag pkgid False packageConfigProf
, withProfExe = profExe
, withProfLib = canBuildProfilingLibs && pkgid `Set.member` pkgsUseProfilingLibrary
, withProfLibShared = canBuildProfilingSharedLibs && pkgid `Set.member` pkgsUseProfilingLibraryShared
, exeCoverage = perPkgOptionFlag pkgid False packageConfigCoverage
Expand All @@ -2334,6 +2339,8 @@ elaborateInstallPlan
, withProfLibDetail = elabProfExeDetail
, withProfExeDetail = elabProfLibDetail
}
okProfDyn = profilingDynamicSupportedOrUnknown compiler
profExe = perPkgOptionFlag pkgid False packageConfigProf

( elabProfExeDetail
, elabProfLibDetail
Expand Down
Loading