diff --git a/Cabal/src/Distribution/Simple/GHC.hs b/Cabal/src/Distribution/Simple/GHC.hs index 9d653f85829..25073f4cb7e 100644 --- a/Cabal/src/Distribution/Simple/GHC.hs +++ b/Cabal/src/Distribution/Simple/GHC.hs @@ -1858,6 +1858,7 @@ libAbiHash :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO String libAbiHash verbosity _pkg_descr lbi lib clbi = do let +<<<<<<< HEAD libBi = libBuildInfo lib comp = compiler lbi platform = hostPlatform lbi @@ -1893,6 +1894,43 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do | withSharedLib lbi = sharedArgs | withProfLib lbi = profArgs | otherwise = error "libAbiHash: Can't find an enabled library way" +======= + libBi = libBuildInfo lib + comp = compiler lbi + platform = hostPlatform lbi + vanillaArgs = + (componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi)) + `mappend` mempty + { ghcOptMode = toFlag GhcModeAbiHash + , ghcOptInputModules = toNubListR $ exposedModules lib + } + sharedArgs = + vanillaArgs + `mappend` mempty + { ghcOptDynLinkMode = toFlag GhcDynamicOnly + , ghcOptFPic = toFlag True + , ghcOptHiSuffix = toFlag "dyn_hi" + , ghcOptObjSuffix = toFlag "dyn_o" + , ghcOptExtra = hcSharedOptions GHC libBi + } + profArgs = + vanillaArgs + `mappend` mempty + { ghcOptProfilingMode = toFlag True + , ghcOptProfilingAuto = + Internal.profDetailLevelFlag + True + (withProfLibDetail lbi) + , ghcOptHiSuffix = toFlag "p_hi" + , ghcOptObjSuffix = toFlag "p_o" + , ghcOptExtra = hcProfOptions GHC libBi + } + ghcArgs + | withVanillaLib lbi = vanillaArgs + | withSharedLib lbi = sharedArgs + | withProfLib lbi = profArgs + | otherwise = error "libAbiHash: Can't find an enabled library way" +>>>>>>> 01cfac0e6 (Revert #3639 (Don't pass -package-db and -package flags to --abi-hash) (#9384)) (ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi) hash <- getProgramInvocationOutput verbosity diff --git a/Cabal/src/Distribution/Simple/GHCJS.hs b/Cabal/src/Distribution/Simple/GHCJS.hs index c8721746a6a..fc9dbf84050 100644 --- a/Cabal/src/Distribution/Simple/GHCJS.hs +++ b/Cabal/src/Distribution/Simple/GHCJS.hs @@ -1570,6 +1570,7 @@ libAbiHash :: Verbosity -> PackageDescription -> LocalBuildInfo -> Library -> ComponentLocalBuildInfo -> IO String libAbiHash verbosity _pkg_descr lbi lib clbi = do let +<<<<<<< HEAD libBi = libBuildInfo lib comp = compiler lbi platform = hostPlatform lbi @@ -1605,6 +1606,43 @@ libAbiHash verbosity _pkg_descr lbi lib clbi = do | withSharedLib lbi = sharedArgs | withProfLib lbi = profArgs | otherwise = error "libAbiHash: Can't find an enabled library way" +======= + libBi = libBuildInfo lib + comp = compiler lbi + platform = hostPlatform lbi + vanillaArgs = + (componentGhcOptions verbosity lbi libBi clbi (componentBuildDir lbi clbi)) + `mappend` mempty + { ghcOptMode = toFlag GhcModeAbiHash + , ghcOptInputModules = toNubListR $ exposedModules lib + } + sharedArgs = + vanillaArgs + `mappend` mempty + { ghcOptDynLinkMode = toFlag GhcDynamicOnly + , ghcOptFPic = toFlag True + , ghcOptHiSuffix = toFlag "js_dyn_hi" + , ghcOptObjSuffix = toFlag "js_dyn_o" + , ghcOptExtra = hcSharedOptions GHC libBi + } + profArgs = + vanillaArgs + `mappend` mempty + { ghcOptProfilingMode = toFlag True + , ghcOptProfilingAuto = + Internal.profDetailLevelFlag + True + (withProfLibDetail lbi) + , ghcOptHiSuffix = toFlag "js_p_hi" + , ghcOptObjSuffix = toFlag "js_p_o" + , ghcOptExtra = hcProfOptions GHC libBi + } + ghcArgs + | withVanillaLib lbi = vanillaArgs + | withSharedLib lbi = sharedArgs + | withProfLib lbi = profArgs + | otherwise = error "libAbiHash: Can't find an enabled library way" +>>>>>>> 01cfac0e6 (Revert #3639 (Don't pass -package-db and -package flags to --abi-hash) (#9384)) (ghcjsProg, _) <- requireProgram verbosity ghcjsProgram (withPrograms lbi) hash <- getProgramInvocationOutput verbosity