diff --git a/compiler/GHC/Driver/Downsweep.hs b/compiler/GHC/Driver/Downsweep.hs index 2912eddaf0de..62c58174ed34 100644 --- a/compiler/GHC/Driver/Downsweep.hs +++ b/compiler/GHC/Driver/Downsweep.hs @@ -940,12 +940,7 @@ enableCodeGenWhen logger tmpfs staticLife dynLife unit_env mod_graph = do } -- Recursive call to catch the other cases enable_code_gen_ms ms' - | dynamic_too_enable enable_spec ms -> do - let ms' = ms - { ms_hspp_opts = gopt_set (ms_hspp_opts ms) Opt_BuildDynamicToo - } - -- Recursive call to catch the other cases - enable_code_gen_ms ms' + -- Note: dynamic_too_enable case removed - -dynamic-too is deprecated | ext_interp_enable ms -> do let ms' = ms { ms_hspp_opts = gopt_set (ms_hspp_opts ms) Opt_ExternalInterpreter @@ -968,14 +963,10 @@ enableCodeGenWhen logger tmpfs staticLife dynLife unit_env mod_graph = do -- can't compile anything anyway! See #16219. isHomeUnitDefinite (ue_unitHomeUnit (ms_unitid ms) unit_env) + -- bytecode_and_enable: prefer bytecode over needing dynamic objects + -- Note: dynamic_too_enable logic removed - -dynamic-too is deprecated bytecode_and_enable enable_spec ms = - -- In the situation where we **would** need to enable dynamic-too - -- IF we had decided we needed objects - dynamic_too_enable EnableObject ms - -- but we prefer to use bytecode rather than objects - && prefer_bytecode - -- and we haven't already turned it on - && not generate_both + prefer_bytecode && not generate_both where lcl_dflags = ms_hspp_opts ms prefer_bytecode = case enable_spec of @@ -985,29 +976,6 @@ enableCodeGenWhen logger tmpfs staticLife dynLife unit_env mod_graph = do generate_both = gopt Opt_ByteCodeAndObjectCode lcl_dflags - -- #8180 - when using TemplateHaskell, switch on -dynamic-too so - -- the linker can correctly load the object files. This isn't necessary - -- when using -fexternal-interpreter. - -- FIXME: Duplicated from makeDynFlagsConsistent - dynamic_too_enable enable_spec ms - | sTargetRTSLinkerOnlySupportsSharedLibs $ settings lcl_dflags = - not isDynWay && not dyn_too_enabled - && enable_object - | otherwise = - hostIsDynamic && not hostIsProfiled && internalInterpreter && - not isDynWay && not isProfWay && not dyn_too_enabled - && enable_object - where - lcl_dflags = ms_hspp_opts ms - internalInterpreter = not (gopt Opt_ExternalInterpreter lcl_dflags) - dyn_too_enabled = gopt Opt_BuildDynamicToo lcl_dflags - isDynWay = hasWay (ways lcl_dflags) WayDyn - isProfWay = hasWay (ways lcl_dflags) WayProf - enable_object = case enable_spec of - EnableByteCode -> False - EnableByteCodeAndObject -> True - EnableObject -> True - -- #16331 - when no "internal interpreter" is available but we -- need to process some TemplateHaskell or QuasiQuotes, we automatically -- turn on -fexternal-interpreter. @@ -1148,8 +1116,8 @@ Potential TODOS: ~~~~~ * Remove -fwrite-interface and have interface files always written in -fno-code mode -* Both .o and .dyn_o files are generated for template haskell, but we only need - .dyn_o (for dynamically linked compilers) Fix it. (The needed way is 'hostFullWays') +* All .o files are now dynamic-capable (-dynamic-too is deprecated), so only + .o files are generated for template haskell. (The needed way is 'hostFullWays') * In make mode, a message like Compiling A (A.hs, /tmp/ghc_123.o) is shown if downsweep enabled object code generation for A. Perhaps we should diff --git a/compiler/GHC/Driver/DynFlags.hs b/compiler/GHC/Driver/DynFlags.hs index bfe6fd33fe39..237d2c06a8e9 100644 --- a/compiler/GHC/Driver/DynFlags.hs +++ b/compiler/GHC/Driver/DynFlags.hs @@ -22,7 +22,8 @@ module GHC.Driver.DynFlags ( xopt_DuplicateRecordFields, xopt_FieldSelectors, lang_set, - DynamicTooState(..), dynamicTooState, setDynamicNow, + -- Note: DynamicTooState, dynamicTooState, setDynamicNow removed + -- -dynamic-too is deprecated, only dynamic objects are produced OnOff(..), DynFlags(..), ParMakeCount(..), @@ -296,10 +297,7 @@ data DynFlags = DynFlags { dynOutputHi :: Maybe String, dynLibLoader :: DynLibLoader, - dynamicNow :: !Bool, -- ^ Indicate if we are now generating dynamic output - -- because of -dynamic-too. This predicate is - -- used to query the appropriate fields - -- (outputFile/dynOutputFile, ways, etc.) + -- Note: dynamicNow field removed - -dynamic-too is deprecated -- | This defaults to 'non-module'. It can be set by -- 'GHC.Driver.Pipeline.setDumpPrefix' or 'ghc.GHCi.UI.runStmt' based on @@ -655,7 +653,6 @@ defaultDynFlags mySettings = dynObjectSuf_ = "dyn_" ++ phaseInputExt StopLn, dynHiSuf_ = "dyn_hi", - dynamicNow = False, pluginModNames = [], pluginModNameOpts = [], @@ -982,27 +979,8 @@ positionIndependent dflags = gopt Opt_PIC dflags || gopt Opt_PIE dflags -- need Template-Haskell and GHC is dynamically linked (cf -- GHC.Driver.Pipeline.compileOne'). -- --- We used to try and fall back from a dynamic-too failure but this feature --- didn't work as expected (#20446) so it was removed to simplify the --- implementation and not obscure latent bugs. - -data DynamicTooState - = DT_Dont -- ^ Don't try to build dynamic objects too - | DT_OK -- ^ Will still try to generate dynamic objects - | DT_Dyn -- ^ Currently generating dynamic objects (in the backend) - deriving (Eq,Show,Ord) - -dynamicTooState :: DynFlags -> DynamicTooState -dynamicTooState dflags - | not (gopt Opt_BuildDynamicToo dflags) = DT_Dont - | dynamicNow dflags = DT_Dyn - | otherwise = DT_OK - -setDynamicNow :: DynFlags -> DynFlags -setDynamicNow dflags0 = - dflags0 - { dynamicNow = True - } +-- Note: DynamicTooState type and dynamicTooState/setDynamicNow functions removed +-- -dynamic-too is deprecated - only dynamic objects are produced now data PkgDbRef = GlobalPkgDb @@ -1063,18 +1041,7 @@ dopt_unset :: DynFlags -> DumpFlag -> DynFlags dopt_unset dfs f = dfs{ dumpFlags = EnumSet.delete f (dumpFlags dfs) } -- | Test whether a 'GeneralFlag' is set --- --- Note that `dynamicNow` (i.e., dynamic objects built with `-dynamic-too`) --- always implicitly enables Opt_PIC, Opt_ExternalDynamicRefs, and disables --- Opt_SplitSections. --- gopt :: GeneralFlag -> DynFlags -> Bool -gopt Opt_PIC dflags - | dynamicNow dflags = True -gopt Opt_ExternalDynamicRefs dflags - | dynamicNow dflags = True -gopt Opt_SplitSections dflags - | dynamicNow dflags = False gopt f dflags = f `EnumSet.member` generalFlags dflags -- | Set a 'GeneralFlag' @@ -1492,9 +1459,7 @@ languageExtensions (Just GHC2024) LangExt.RoleAnnotations] ways :: DynFlags -> Ways -ways dflags - | dynamicNow dflags = addWay WayDyn (targetWays_ dflags) - | otherwise = targetWays_ dflags +ways dflags = targetWays_ dflags -- | Get target profile targetProfile :: DynFlags -> Profile diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index 13e6c87fe93e..29f5df09833a 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -1377,8 +1377,10 @@ hscMaybeWriteIface logger dflags is_simple iface old_iface mod_location = do let force_write_interface = gopt Opt_WriteInterface dflags write_interface = backendWritesFiles (backend dflags) + -- Note: dynamicNow and DynamicTooState removed - -dynamic-too is deprecated + -- We now only write a single .hi file write_iface dflags' iface = - let !iface_name = if dynamicNow dflags' then ml_dyn_hi_file mod_location else ml_hi_file mod_location + let !iface_name = ml_hi_file mod_location profile = targetProfile dflags' in {-# SCC "writeIface" #-} @@ -1389,43 +1391,16 @@ hscMaybeWriteIface logger dflags is_simple iface old_iface mod_location = do if (write_interface || force_write_interface) then do - -- FIXME: with -dynamic-too, "change" is only meaningful for the - -- non-dynamic interface, not for the dynamic one. We should have another - -- flag for the dynamic interface. In the meantime: - -- - -- * when we write a single full interface, we check if we are - -- currently writing the dynamic interface due to -dynamic-too, in - -- which case we ignore "change". - -- - -- * when we write two simple interfaces at once because of - -- dynamic-too, we use "change" both for the non-dynamic and the - -- dynamic interfaces. Hopefully both the dynamic and the non-dynamic - -- interfaces stay in sync... - -- let change = old_iface /= Just (mi_iface_hash iface) - let dt = dynamicTooState dflags - when (logHasDumpFlag logger Opt_D_dump_if_trace) $ putMsg logger $ hang (text "Writing interface(s):") 2 $ vcat [ text "Kind:" <+> if is_simple then text "simple" else text "full" , text "Hash change:" <+> ppr change - , text "DynamicToo state:" <+> text (show dt) ] - if is_simple - then when change $ do -- FIXME: see 'change' comment above - write_iface dflags iface - case dt of - DT_Dont -> return () - DT_Dyn -> panic "Unexpected DT_Dyn state when writing simple interface" - DT_OK -> write_iface (setDynamicNow dflags) iface - else case dt of - DT_Dont | change -> write_iface dflags iface - DT_OK | change -> write_iface dflags iface - -- FIXME: see change' comment above - DT_Dyn -> write_iface dflags iface - _ -> return () + -- Simply write the interface if there was a change + when change $ write_iface dflags iface when (gopt Opt_WriteHie dflags) $ do -- This is slightly hacky. A hie file is considered to be up to date diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index 1b85504e21d5..cc443df0d270 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -786,19 +786,9 @@ hscBackendPipeline :: P m => PipeEnv -> HscEnv -> ModSummary -> HscBackendAction hscBackendPipeline pipe_env hsc_env mod_sum result = if backendGeneratesCode (backend (hsc_dflags hsc_env)) then do - res <- hscGenBackendPipeline pipe_env hsc_env mod_sum result - -- Only run dynamic-too if the backend generates object files - -- See Note [Writing interface files] - -- If we are writing a simple interface (not . backendWritesFiles), then - -- hscMaybeWriteIface in the regular pipeline will write both the hi and - -- dyn_hi files. This way we can avoid running the pipeline twice and - -- generating a duplicate linkable. - -- We must not run the backend a second time with `dynamicNow` enable because - -- all the work has already been done in the first pipeline. - when (gopt Opt_BuildDynamicToo (hsc_dflags hsc_env) && backendWritesFiles (backend (hsc_dflags hsc_env)) ) $ do - let dflags' = setDynamicNow (hsc_dflags hsc_env) -- set "dynamicNow" - () <$ hscGenBackendPipeline pipe_env (hscSetFlags dflags' hsc_env) mod_sum result - return res + -- Note: -dynamic-too is deprecated and ignored + -- We no longer run the backend twice - only dynamic objects are produced + hscGenBackendPipeline pipe_env hsc_env mod_sum result else case result of HscUpdate iface -> return (iface, emptyHomeModInfoLinkable) diff --git a/compiler/GHC/Driver/Pipeline/Execute.hs b/compiler/GHC/Driver/Pipeline/Execute.hs index f7a39668c0e6..106a28aaa7d4 100644 --- a/compiler/GHC/Driver/Pipeline/Execute.hs +++ b/compiler/GHC/Driver/Pipeline/Execute.hs @@ -545,7 +545,8 @@ runHscBackendPhase :: PipeEnv runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do let dflags = hsc_dflags hsc_env logger = hsc_logger hsc_env - o_file = if dynamicNow dflags then ml_dyn_obj_file location else ml_obj_file location -- The real object file + -- Note: dynamicNow removed - always use standard object file path + o_file = ml_obj_file location -- The real object file next_phase = hscPostBackendPhase src_flavour (backend dflags) case result of HscUpdate iface -> @@ -888,35 +889,26 @@ getOutputFilename getOutputFilename logger tmpfs stop_phase output basename dflags next_phase maybe_location -- 1. If we are generating object files for a .hs file, then return the odir as the ModLocation -- will have been modified to point to the accurate locations + -- Note: dynamicNow removed - always use standard object file path | StopLn <- next_phase, Just loc <- maybe_location = - return $ if dynamicNow dflags then ml_dyn_obj_file loc - else ml_obj_file loc + return $ ml_obj_file loc -- 2. If output style is persistent then | is_last_phase, Persistent <- output = persistent_fn -- 3. Specific file is only set when outputFile is set by -o -- If we are in dynamic mode but -dyno is not set then write to the same path as -- -o with a .dyn_* extension. This case is not triggered for object files which -- are always handled by the ModLocation. + -- Note: dynamicNow removed - always use standard output file | is_last_phase, SpecificFile <- output = - return $ - if dynamicNow dflags - then case dynOutputFile_ dflags of - Nothing -> let ofile = getOutputFile_ dflags - new_ext = case takeExtension ofile of - "" -> "dyn" - ext -> "dyn_" ++ tail ext - in replaceExtension ofile new_ext - Just fn -> fn - else getOutputFile_ dflags + return $ getOutputFile_ dflags | keep_this_output = persistent_fn | Temporary lifetime <- output = newTempName logger tmpfs (tmpDir dflags) lifetime suffix | otherwise = newTempName logger tmpfs (tmpDir dflags) TFL_CurrentModule suffix where - getOutputFile_ dflags = - case outputFile_ dflags of - Nothing -> pprPanic "SpecificFile: No filename" (ppr (dynamicNow dflags) $$ - text (fromMaybe "-" (dynOutputFile_ dflags))) + getOutputFile_ dflags' = + case outputFile_ dflags' of + Nothing -> pprPanic "SpecificFile: No filename" (text (fromMaybe "-" (dynOutputFile_ dflags'))) Just fn -> fn hcsuf = hcSuf dflags diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index f84fcc447cf6..7d616b0b9034 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -41,7 +41,8 @@ module GHC.Driver.Session ( xopt_DuplicateRecordFields, xopt_FieldSelectors, lang_set, - DynamicTooState(..), dynamicTooState, setDynamicNow, + -- Note: DynamicTooState, dynamicTooState, setDynamicNow removed + -- -dynamic-too is deprecated sccProfilingEnabled, needSourceNotes, OnOff(..), @@ -1325,8 +1326,10 @@ dynamic_flags_deps = [ , make_ord_flag defGhcFlag "ddump-file-prefix" (hasArg (setDumpPrefixForce . Just . flip (++) ".")) - , make_ord_flag defGhcFlag "dynamic-too" - (NoArg (setGeneralFlag Opt_BuildDynamicToo)) + -- -dynamic-too is deprecated and ignored - GHC now only produces dynamic objects + , make_dep_flag defGhcFlag "dynamic-too" + (NoArg (return ())) + "-dynamic-too is deprecated and ignored. Use -dynamic instead." ------- Keeping temporary files ------------------------------------- -- These can be singular (think ghc -c) or plural (think ghc --make) @@ -3547,8 +3550,12 @@ compilerInfo dflags ("Have native code generator", showBool $ platformNcgSupported platform), ("target has RTS linker", showBool $ platformHasRTSLinker platform), ("Target default backend", show $ platformDefaultBackend platform), - -- Whether or not we support @-dynamic-too@ - ("Support dynamic-too", showBool $ not isWindows), + -- -dynamic-too is deprecated and a no-op; all object files are now + -- dynamic-capable. Report NO so Cabal falls back to two-pass compilation. + -- TODO: Cabal should stop requiring .dyn_o files entirely; once it + -- understands that .o files are dynamic-capable, the two-pass + -- compilation and dyn_o suffix machinery can be removed. + ("Support dynamic-too", "NO"), -- Whether or not we support the @-j@ flag with @--make@. ("Support parallel --make", "YES"), -- Whether or not we support "Foo from foo-0.1-XXX:Foo" syntax in @@ -3582,7 +3589,6 @@ compilerInfo dflags showBool True = "YES" showBool False = "NO" platform = targetPlatform dflags - isWindows = platformOS platform == OSMinGW32 useInplaceMinGW = toolSettings_useInplaceMinGW $ toolSettings dflags expandDirectories :: FilePath -> Maybe FilePath -> String -> String expandDirectories topd mtoold = expandToolDir useInplaceMinGW mtoold . expandTopDir topd @@ -3664,17 +3670,7 @@ makeDynFlagsConsistent :: DynFlags -> (DynFlags, [Warn], [Located SDoc]) -- ensure that a later change doesn't invalidate an earlier check. -- Be careful not to introduce potential loops! makeDynFlagsConsistent dflags - -- Disable -dynamic-too on Windows (#8228, #7134, #5987) - | os == OSMinGW32 && gopt Opt_BuildDynamicToo dflags - = let dflags' = gopt_unset dflags Opt_BuildDynamicToo - warn = "-dynamic-too is not supported on Windows" - in loop dflags' warn - -- Disable -dynamic-too if we are are compiling with -dynamic already, otherwise - -- you get two dynamic object files (.o and .dyn_o). (#20436) - | ways dflags `hasWay` WayDyn && gopt Opt_BuildDynamicToo dflags - = let dflags' = gopt_unset dflags Opt_BuildDynamicToo - warn = "-dynamic-too is ignored when using -dynamic" - in loop dflags' warn + -- Note: -dynamic-too validation removed - flag is now deprecated and ignored | gopt Opt_SplitSections dflags , platformHasSubsectionsViaSymbols (targetPlatform dflags) @@ -3899,15 +3895,13 @@ decodeSize str foreign import ccall unsafe "setHeapSize" setHeapSize :: Int -> IO () foreign import ccall unsafe "enableTimingStats" enableTimingStats :: IO () +-- Note: dynamicNow removed - -dynamic-too is deprecated +-- Always use the non-dynamic output file paths outputFile :: DynFlags -> Maybe String -outputFile dflags - | dynamicNow dflags = dynOutputFile_ dflags - | otherwise = outputFile_ dflags +outputFile dflags = outputFile_ dflags objectSuf :: DynFlags -> String -objectSuf dflags - | dynamicNow dflags = dynObjectSuf_ dflags - | otherwise = objectSuf_ dflags +objectSuf dflags = objectSuf_ dflags -- | Pretty-print the difference between 2 DynFlags. -- diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs index 6e05fc64d1c7..8b4dc140b849 100644 --- a/compiler/GHC/Iface/Load.hs +++ b/compiler/GHC/Iface/Load.hs @@ -915,18 +915,14 @@ findAndReadIface hsc_env doc_str mod wanted_mod hi_boot_file = do && not (isOneShot (ghcMode dflags)) then return (Failed (HomeModError mod loc)) else do + -- Note: load_dynamic_too_maybe removed - -dynamic-too is deprecated + -- We no longer check for .dyn_hi files r <- read_file hooks logger name_cache unit_state dflags wanted_mod (ml_hi_file loc) case r of Failed err -> return (Failed $ BadIfaceFile err) Succeeded (iface,_fp) - -> do - r2 <- load_dynamic_too_maybe hooks logger name_cache unit_state - (setDynamicNow dflags) wanted_mod - iface loc - case r2 of - Failed sdoc -> return (Failed sdoc) - Succeeded {} -> return $ Succeeded (iface, loc) + -> return $ Succeeded (iface, loc) err -> do trace_if logger (text "...not found") return $ Failed $ cannotFindInterface @@ -936,33 +932,8 @@ findAndReadIface hsc_env doc_str mod wanted_mod hi_boot_file = do (moduleName mod) err --- | Check if we need to try the dynamic interface for -dynamic-too -load_dynamic_too_maybe :: Hooks -> Logger -> NameCache -> UnitState -> DynFlags - -> Module -> ModIface -> ModLocation - -> IO (MaybeErr MissingInterfaceError ()) -load_dynamic_too_maybe hooks logger name_cache unit_state dflags wanted_mod iface loc - -- Indefinite interfaces are ALWAYS non-dynamic. - | not (moduleIsDefinite (mi_module iface)) = return (Succeeded ()) - | gopt Opt_BuildDynamicToo dflags = load_dynamic_too hooks logger name_cache unit_state dflags wanted_mod iface loc - | otherwise = return (Succeeded ()) - -load_dynamic_too :: Hooks -> Logger -> NameCache -> UnitState -> DynFlags - -> Module -> ModIface -> ModLocation - -> IO (MaybeErr MissingInterfaceError ()) -load_dynamic_too hooks logger name_cache unit_state dflags wanted_mod iface loc = do - read_file hooks logger name_cache unit_state dflags wanted_mod (ml_dyn_hi_file loc) >>= \case - Succeeded (dynIface, _) - | mi_mod_hash iface == mi_mod_hash dynIface - -> return (Succeeded ()) - | otherwise -> - do return $ (Failed $ DynamicHashMismatchError wanted_mod loc) - Failed err -> - do return $ (Failed $ FailedToLoadDynamicInterface wanted_mod err) - - --((text "Failed to load dynamic interface file for" <+> ppr wanted_mod <> colon) $$ err)) - - - +-- Note: load_dynamic_too_maybe and load_dynamic_too removed +-- -dynamic-too is deprecated - we no longer check for .dyn_hi files read_file :: Hooks -> Logger -> NameCache -> UnitState -> DynFlags -> Module -> FilePath diff --git a/compiler/GHC/Iface/Recomp.hs b/compiler/GHC/Iface/Recomp.hs index f8081a21945b..d17944a57098 100644 --- a/compiler/GHC/Iface/Recomp.hs +++ b/compiler/GHC/Iface/Recomp.hs @@ -318,22 +318,12 @@ check_old_iface hsc_env mod_summary maybe_iface Succeeded iface -> do trace_if logger (text "Read the interface file" <+> text iface_path) return $ Just iface + -- Note: check_dyn_hi removed - -dynamic-too is deprecated + -- We no longer check for .dyn_hi files check_dyn_hi :: ModIface -> IfG (MaybeValidated ModIface) -> IfG (MaybeValidated ModIface) - check_dyn_hi normal_iface recomp_check | gopt Opt_BuildDynamicToo dflags = do - res <- recomp_check - case res of - UpToDateItem _ -> do - maybe_dyn_iface <- liftIO $ loadIface (setDynamicNow dflags) (msDynHiFilePath mod_summary) - case maybe_dyn_iface of - Nothing -> return $ outOfDateItemBecause MissingDynHiFile Nothing - Just dyn_iface | mi_iface_hash dyn_iface - /= mi_iface_hash normal_iface - -> return $ outOfDateItemBecause MismatchedDynHiFile Nothing - Just {} -> return res - _ -> return res - check_dyn_hi _ recomp_check = recomp_check + check_dyn_hi _normal_iface recomp_check = recomp_check src_changed @@ -1888,19 +1878,9 @@ mkHashFun hsc_env eps name -- requirements; we didn't do any /real/ typechecking -- so there's no guarantee everything is loaded. -- Kind of a heinous hack. + -- Note: withoutDynamicNow call removed - -dynamic-too is deprecated + -- We no longer need to disable dynamic-too for backpack initIfaceLoad hsc_env . withIfaceErr ctx - $ withoutDynamicNow - -- If you try and load interfaces when dynamic-too - -- enabled then it attempts to load the dyn_hi and hi - -- interface files. Backpack doesn't really care about - -- dynamic object files as it isn't doing any code - -- generation so -dynamic-too is turned off. - -- Some tests fail without doing this (such as T16219), - -- but they fail because dyn_hi files are not found for - -- one of the dependencies (because they are deliberately turned off) - -- Why is this check turned off here? That is unclear but - -- just one of the many horrible hacks in the backpack - -- implementation. $ loadInterface (text "lookupVers2") mod ImportBySystem return $ snd (mi_hash_fn iface occ `orElse` pprPanic "lookupVers1" (ppr mod <+> ppr occ)) diff --git a/compiler/GHC/Linker/Deps.hs b/compiler/GHC/Linker/Deps.hs index 0f36a791b47c..ceff6ec31b9b 100644 --- a/compiler/GHC/Linker/Deps.hs +++ b/compiler/GHC/Linker/Deps.hs @@ -51,7 +51,7 @@ import System.Directory data LinkDepsOpts = LinkDepsOpts { ldObjSuffix :: !String -- ^ Suffix of .o files - , ldForceDyn :: !Bool -- ^ Always use .dyn_o? + , ldForceDyn :: !Bool -- ^ Force dynamic loading (legacy, .dyn_o deprecated) , ldUnitEnv :: !UnitEnv , ldPprOpts :: !SDocContext -- ^ Rendering options for error messages , ldUseByteCode :: !Bool -- ^ Use bytecode rather than objects @@ -239,14 +239,17 @@ throwProgramError opts doc = throwGhcExceptionIO (ProgramError (renderWithContex checkNonStdWay :: LinkDepsOpts -> Interp -> SrcSpan -> IO (Maybe FilePath) checkNonStdWay _opts interp _srcspan -- On some targets (e.g. wasm) the RTS linker only supports loading - -- dynamic code, in which case we need to ensure the .dyn_o object - -- is picked (instead of .o which is also present because of - -- -dynamic-too) + -- dynamic code. Since -dynamic-too is deprecated and all .o files are + -- now dynamic-capable, we just need to check that WayDyn is present + -- (or that the ways match modulo WayDyn). | ldForceDyn _opts = do let target_ways = fullWays $ ldWays _opts - pure $ if target_ways `hasWay` WayDyn + -- All .o files are dynamic-capable now, so WayDyn doesn't need + -- a separate object suffix. Just check non-dynamic ways match. + pure $ if removeWay WayDyn target_ways == removeWay WayDyn hostFullWays then Nothing - else Just $ waysTag (WayDyn `addWay` target_ways) ++ "_o" + else let tag = waysTag (removeWay WayDyn hostFullWays) + in Just $ if null tag then "o" else tag ++ "_o" | ExternalInterp {} <- interpInstance interp = return Nothing -- with -fexternal-interpreter we load the .o files, whatever way @@ -257,17 +260,20 @@ checkNonStdWay _opts interp _srcspan -- complain that they are redundant. #if defined(HAVE_INTERNAL_INTERPRETER) checkNonStdWay opts _interp srcspan - | hostFullWays == targetFullWays = return Nothing - -- Only if we are compiling with the same ways as GHC is built - -- with, can we dynamically load those object files. (see #3604) + -- Since -dynamic-too is deprecated, all .o files are dynamic-capable. + -- WayDyn no longer affects the object file suffix, so we compare ways + -- ignoring WayDyn. (see #3604) + | hostNonDynWays == targetNonDynWays = return Nothing - | ldObjSuffix opts == normalObjectSuffix && not (null targetFullWays) + | ldObjSuffix opts == normalObjectSuffix && not (null targetNonDynWays) = failNonStd opts srcspan | otherwise = return (Just (hostWayTag ++ "o")) where - targetFullWays = fullWays (ldWays opts) - hostWayTag = case waysTag hostFullWays of + -- Compare ways ignoring WayDyn since all .o files are dynamic-capable + targetNonDynWays = removeWay WayDyn $ fullWays (ldWays opts) + hostNonDynWays = removeWay WayDyn hostFullWays + hostWayTag = case waysTag hostNonDynWays of "" -> "" tag -> tag ++ "_" @@ -293,16 +299,11 @@ failNonStd opts srcspan = dieWith opts srcspan $ | hostIsDynamic = Dyn | hostIsProfiled = Prof | otherwise = Normal - buildTwiceMsg = case (ghciWay, compWay) of - (Normal, Dyn) -> dynamicTooMsg - (Dyn, Normal) -> dynamicTooMsg - _ -> + buildTwiceMsg = text " (2) Build the program twice: once" <+> pprWay' ghciWay <> text ", and then" $$ text " " <> pprWay' compWay <+> text "using -osuf to set a different object file suffix." - dynamicTooMsg = text " (2) Use -dynamic-too," <+> - text "and use -osuf and -dynosuf to set object file suffixes as needed." pprWay' :: Way' -> SDoc pprWay' way = text $ case way of Normal -> "the normal way" diff --git a/compiler/GHC/Linker/Loader.hs b/compiler/GHC/Linker/Loader.hs index b9b4399d4bf0..c37ade491d04 100644 --- a/compiler/GHC/Linker/Loader.hs +++ b/compiler/GHC/Linker/Loader.hs @@ -1476,7 +1476,9 @@ locateLib interp hsc_env is_hs lib_dirs gcc_dirs lib0 obj_file | is_hs && loading_profiled_hs_libs = lib <.> "p_o" | otherwise = lib <.> "o" - dyn_obj_file = lib <.> "dyn_o" + -- Note: -dynamic-too is deprecated - .dyn_o files no longer produced + -- dyn_obj_file now same as obj_file + dyn_obj_file = obj_file arch_files | verbatim = [lib] | otherwise = [ "lib" ++ lib ++ lib_tag <.> "a" diff --git a/compiler/GHC/Platform/Profile.hs b/compiler/GHC/Platform/Profile.hs index d474ff34c8e7..eb30fc98add6 100644 --- a/compiler/GHC/Platform/Profile.hs +++ b/compiler/GHC/Platform/Profile.hs @@ -50,4 +50,8 @@ profileBuildTag profile | otherwise = wayTag where platform = profilePlatform profile - wayTag = waysBuildTag (profileWays profile) + -- Ignore WayDyn: since -dynamic-too is deprecated, all .hi and .o files + -- are unified (no separate .dyn_hi / .dyn_o). WayDyn no longer affects + -- the ABI of interface or object files, so it must not contribute to the + -- build tag used for interface file compatibility checks. + wayTag = waysBuildTag (removeWay WayDyn (profileWays profile)) diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs index 088b9f9a3320..b7ccf8df07f3 100644 --- a/compiler/GHC/Tc/Utils/Monad.hs +++ b/compiler/GHC/Tc/Utils/Monad.hs @@ -25,7 +25,7 @@ module GHC.Tc.Utils.Monad( whenDOptM, whenGOptM, whenWOptM, whenXOptM, unlessXOptM, getGhcMode, - withoutDynamicNow, + -- Note: withoutDynamicNow removed - -dynamic-too is deprecated getEpsVar, getEps, updateEps, updateEps_, @@ -624,8 +624,8 @@ unlessXOptM flag thing_inside = do b <- xoptM flag getGhcMode :: TcRnIf gbl lcl GhcMode getGhcMode = ghcMode <$> getDynFlags -withoutDynamicNow :: TcRnIf gbl lcl a -> TcRnIf gbl lcl a -withoutDynamicNow = updTopFlags (\dflags -> dflags { dynamicNow = False}) +-- Note: withoutDynamicNow removed - -dynamic-too is deprecated +-- This function was used to disable dynamic-too mode, which no longer exists updTopFlags :: (DynFlags -> DynFlags) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a updTopFlags f = updTopEnv (hscUpdateFlags f) diff --git a/compiler/GHC/Unit/Finder.hs b/compiler/GHC/Unit/Finder.hs index cb91559cfee3..f02ad465f196 100644 --- a/compiler/GHC/Unit/Finder.hs +++ b/compiler/GHC/Unit/Finder.hs @@ -514,13 +514,18 @@ findPackageModule_ fc fopts mod pkg_conf = do (ppr (moduleUnit mod) <+> ppr (unitId pkg_conf)) modLocationCache fc mod $ let - tag = waysBuildTag (finder_ways fopts) + -- Ignore WayDyn when computing the build tag for package interface + -- lookups: since dynamic-too is deprecated, all .hi and .o files are + -- unified (no separate .dyn_hi / .dyn_o). Only non-dynamic ways + -- (e.g. profiling) contribute to the suffix. + tag = waysBuildTag (removeWay WayDyn (finder_ways fopts)) -- hi-suffix for packages depends on the build tag. package_hisuf | null tag = os "hi" | otherwise = os (tag ++ "_hi") - package_dynhisuf = os $ waysBuildTag (addWay WayDyn (finder_ways fopts)) ++ "_hi" + package_dynhisuf | null tag = os "hi" + | otherwise = os (tag ++ "_hi") mk_hi_loc = mkHiOnlyModLocation fopts package_hisuf package_dynhisuf @@ -649,22 +654,24 @@ mkHomeModHiOnlyLocation fopts mod path basename = -- This function is used to make a ModLocation for a package module. Hence why -- we explicitly pass in the interface file suffixes. +-- Note: -dynamic-too is deprecated - dynhisuf parameter kept for API compat +-- but now dyn paths are same as non-dyn paths mkHiOnlyModLocation :: FinderOpts -> FileExt -> FileExt -> OsPath -> OsPath -> ModLocation -mkHiOnlyModLocation fopts hisuf dynhisuf path basename +mkHiOnlyModLocation fopts hisuf _dynhisuf path basename = let full_basename = path basename obj_fn = mkObjPath fopts full_basename basename dyn_obj_fn = mkDynObjPath fopts full_basename basename hie_fn = mkHiePath fopts full_basename basename + hi_fn = full_basename <.> hisuf in OsPathModLocation{ ml_hs_file_ospath = Nothing, - ml_hi_file_ospath = full_basename <.> hisuf, + ml_hi_file_ospath = hi_fn, -- Remove the .hi-boot suffix from -- hi_file, if it had one. We always -- want the name of the real .hi file -- in the ml_hi_file field. ml_dyn_obj_file_ospath = dyn_obj_fn, - -- MP: TODO - ml_dyn_hi_file_ospath = full_basename <.> dynhisuf, + ml_dyn_hi_file_ospath = hi_fn, -- Same as non-dyn ml_obj_file_ospath = obj_fn, ml_hie_file_ospath = hie_fn } @@ -686,18 +693,13 @@ mkObjPath fopts basename mod_basename = obj_basename <.> osuf -- | Constructs the filename of a .dyn_o file for a given source file. -- Does /not/ check whether the .dyn_o file exists +-- Note: -dynamic-too is deprecated - now returns same path as mkObjPath mkDynObjPath :: FinderOpts -> OsPath -- the filename of the source file, minus the extension -> OsPath -- the module name with dots replaced by slashes -> OsPath -mkDynObjPath fopts basename mod_basename = obj_basename <.> dynosuf - where - odir = finder_objectDir fopts - dynosuf = finder_dynObjectSuf fopts - - obj_basename | Just dir <- odir = dir mod_basename - | otherwise = basename +mkDynObjPath fopts basename mod_basename = mkObjPath fopts basename mod_basename -- | Constructs the filename of a .hi file for a given source file. @@ -717,18 +719,13 @@ mkHiPath fopts basename mod_basename = hi_basename <.> hisuf -- | Constructs the filename of a .dyn_hi file for a given source file. -- Does /not/ check whether the .dyn_hi file exists +-- Note: -dynamic-too is deprecated - now returns same path as mkHiPath mkDynHiPath :: FinderOpts -> OsPath -- the filename of the source file, minus the extension -> OsPath -- the module name with dots replaced by slashes -> OsPath -mkDynHiPath fopts basename mod_basename = hi_basename <.> dynhisuf - where - hidir = finder_hiDir fopts - dynhisuf = finder_dynHiSuf fopts - - hi_basename | Just dir <- hidir = dir mod_basename - | otherwise = basename +mkDynHiPath fopts basename mod_basename = mkHiPath fopts basename mod_basename -- | Constructs the filename of a .hie file for a given source file. -- Does /not/ check whether the .hie file exists diff --git a/testsuite/tests/driver/T12983/build.sh b/testsuite/tests/driver/T12983/build.sh index 9026802e08f2..433de5063c03 100755 --- a/testsuite/tests/driver/T12983/build.sh +++ b/testsuite/tests/driver/T12983/build.sh @@ -2,7 +2,7 @@ GHC="${TEST_HC}" -flags="${TEST_HC_OPTS} -O0 -fhide-source-paths -isrc -ibuild -dynamic-too -outputdir build -package template-haskell" +flags="${TEST_HC_OPTS} -O0 -fhide-source-paths -isrc -ibuild -dynamic -outputdir build -package template-haskell" function compile() { diff --git a/testsuite/tests/driver/T20348/Makefile b/testsuite/tests/driver/T20348/Makefile index 5b78c12bf5fe..e83b5882d9ab 100644 --- a/testsuite/tests/driver/T20348/Makefile +++ b/testsuite/tests/driver/T20348/Makefile @@ -9,53 +9,17 @@ checkExists = [ -f $1 ] || echo $1 missing clean: rm -f *.o rm -f *.hi - rm -f *.dyn_o - rm -f *.dyn_hi T20348: clean - # First run: should produce .hi, .o, .dyn_hi, .dyn_o files. + # First run: should produce .hi and .o files. echo 'first run' '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fwrite-interface B.hs $(call checkExists,A.hi) $(call checkExists,A.o) - $(call checkExists,A.dyn_hi) - $(call checkExists,A.dyn_o) # Second run: should not recompile. echo 'second run' '$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fwrite-interface A.hs -T20348A: clean - '$(TEST_HC)' $(TEST_HC_OPTS) -c -o A2.o -ohi A2.hi -dynohi A2.dyn_hi A.hs -dynamic-too - $(call checkExists,A2.hi) - $(call checkExists,A2.o) - $(call checkExists,A2.dyn_hi) - $(call checkExists,A2.dyn_o) - -T20348B: clean - '$(TEST_HC)' $(TEST_HC_OPTS) -c -o A2.o -ohi A2.hi A.hs -dynamic-too - $(call checkExists,A2.hi) - $(call checkExists,A2.o) - $(call checkExists,A.dyn_hi) - $(call checkExists,A2.dyn_o) - -T20348C: clean - '$(TEST_HC)' $(TEST_HC_OPTS) -c -o A2.o -dyno A2.dyn_o A.hs -dynamic-too - $(call checkExists,A.hi) - $(call checkExists,A2.o) - $(call checkExists,A.dyn_hi) - $(call checkExists,A2.dyn_o) - -T20348D: clean - '$(TEST_HC)' $(TEST_HC_OPTS) -c -dyno A2.dyn_o A.hs -dynamic-too - $(call checkExists,A.hi) - $(call checkExists,A.o) - $(call checkExists,A.dyn_hi) - $(call checkExists,A2.dyn_o) - -T20348E: clean - '$(TEST_HC)' $(TEST_HC_OPTS) -S -o A2.s A.hs -dynamic-too - $(call checkExists,A2.s) - $(call checkExists,A2.dyn_s) - - +# T20348A-E tested -dynamic-too output file options which no longer exist. +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. diff --git a/testsuite/tests/driver/T20348/T20348.stdout b/testsuite/tests/driver/T20348/T20348.stdout index 02f97c659bea..92d591d37a38 100644 --- a/testsuite/tests/driver/T20348/T20348.stdout +++ b/testsuite/tests/driver/T20348/T20348.stdout @@ -1,4 +1,4 @@ first run -[1 of 2] Compiling A ( A.hs, A.o, A.dyn_o ) +[1 of 2] Compiling A ( A.hs, A.o ) [2 of 2] Compiling B ( B.hs, nothing ) second run diff --git a/testsuite/tests/driver/T20348/all.T b/testsuite/tests/driver/T20348/all.T index 969c43621036..36006c47ad2a 100644 --- a/testsuite/tests/driver/T20348/all.T +++ b/testsuite/tests/driver/T20348/all.T @@ -1,8 +1,11 @@ # N.B. this package requires a dynamically-linked ghc-bin, since it assumes # that TH evaluation will build dynamic objects. test('T20348', [extra_files(['A.hs', 'B.hs']), unless(have_dynamic(), skip)], makefile_test, []) -test('T20348A', [extra_files(['A.hs']), unless(have_dynamic(), skip)], makefile_test, []) -test('T20348B', [extra_files(['A.hs']), unless(have_dynamic(), skip)], makefile_test, []) -test('T20348C', [extra_files(['A.hs']), unless(have_dynamic(), skip)], makefile_test, []) -test('T20348D', [extra_files(['A.hs']), unless(have_dynamic(), skip)], makefile_test, []) -test('T20348E', [extra_files(['A.hs']), unless(have_dynamic(), skip), when(unregisterised(), skip)], makefile_test, []) + +# T20348A-E tested -dynamic-too output file options which no longer exist. +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. +test('T20348A', [extra_files(['A.hs']), skip], makefile_test, []) +test('T20348B', [extra_files(['A.hs']), skip], makefile_test, []) +test('T20348C', [extra_files(['A.hs']), skip], makefile_test, []) +test('T20348D', [extra_files(['A.hs']), skip], makefile_test, []) +test('T20348E', [extra_files(['A.hs']), skip], makefile_test, []) diff --git a/testsuite/tests/driver/T20436/Makefile b/testsuite/tests/driver/T20436/Makefile index de28eab08d41..00c2da25f758 100644 --- a/testsuite/tests/driver/T20436/Makefile +++ b/testsuite/tests/driver/T20436/Makefile @@ -2,7 +2,7 @@ TOP=../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk -# Test for passing -dynamic and -dynamic-too together +# Test that -dynamic-too produces a deprecation warning checkExists = [ -f $1 ] || echo $1 missing checkNotExists = [ ! -f $1 ] || echo $1 not missing @@ -10,8 +10,6 @@ checkNotExists = [ ! -f $1 ] || echo $1 not missing clean: rm -f *.o rm -f *.hi - rm -f *.dyn_o - rm -f *.dyn_hi T20436: clean '$(TEST_HC)' $(TEST_HC_OPTS) -dynamic -dynamic-too -v0 A.hs @@ -19,5 +17,3 @@ T20436: clean $(call checkExists,A.o) $(call checkNotExists,A.dyn_hi) $(call checkNotExists,A.dyn_o) - - diff --git a/testsuite/tests/driver/T20436/T20436.stderr b/testsuite/tests/driver/T20436/T20436.stderr index 85ac12692dbc..4ae02ad9ec6c 100644 --- a/testsuite/tests/driver/T20436/T20436.stderr +++ b/testsuite/tests/driver/T20436/T20436.stderr @@ -1,3 +1,2 @@ - -when making flags consistent: warning: [GHC-74335] [-Winconsistent-flags (in -Wdefault)] - -dynamic-too is ignored when using -dynamic +on the commandline: warning: [GHC-53692] [-Wdeprecated-flags] + -dynamic-too is deprecated: -dynamic-too is deprecated and ignored. Use -dynamic instead. diff --git a/testsuite/tests/driver/T20696/T20696-static.stderr-wasm32-unknown-wasi b/testsuite/tests/driver/T20696/T20696-static.stderr-wasm32-unknown-wasi index 54d5ad5bddcc..bafc33dbe736 100644 --- a/testsuite/tests/driver/T20696/T20696-static.stderr-wasm32-unknown-wasi +++ b/testsuite/tests/driver/T20696/T20696-static.stderr-wasm32-unknown-wasi @@ -1,3 +1,3 @@ -[1 of 3] Compiling C ( C.hs, C.o, C.dyn_o ) +[1 of 3] Compiling C ( C.hs, C.o ) [2 of 3] Compiling B ( B.hs, B.o ) [3 of 3] Compiling A ( A.hs, A.o ) diff --git a/testsuite/tests/driver/T20696/T20696.stderr b/testsuite/tests/driver/T20696/T20696.stderr index 54d5ad5bddcc..bafc33dbe736 100644 --- a/testsuite/tests/driver/T20696/T20696.stderr +++ b/testsuite/tests/driver/T20696/T20696.stderr @@ -1,3 +1,3 @@ -[1 of 3] Compiling C ( C.hs, C.o, C.dyn_o ) +[1 of 3] Compiling C ( C.hs, C.o ) [2 of 3] Compiling B ( B.hs, B.o ) [3 of 3] Compiling A ( A.hs, A.o ) diff --git a/testsuite/tests/driver/T21035/Makefile b/testsuite/tests/driver/T21035/Makefile index b2eaa93f04fe..ad148e708050 100644 --- a/testsuite/tests/driver/T21035/Makefile +++ b/testsuite/tests/driver/T21035/Makefile @@ -24,8 +24,9 @@ hsdep-empty-lib/pkgdb/package.cache: cat-hsdep-info.sh GHC_PKG='$(GHC_PKG)' ./cat-hsdep-info.sh hsdep-empty-lib > hsdep-empty-lib/pkgdb/hsdep-0.1.conf '$(GHC_PKG)' recache --package-db hsdep-empty-lib/pkgdb -hsdep/libHShsdep-0.1-ghc8.10.7.so: hsdep/HsDep.dyn_o - '$(TEST_HC)' $(TEST_HC_OPTS) -shared -dynamic -o hsdep/libHShsdep-0.1-ghc8.10.7.so hsdep/HsDep.dyn_o +# All .o files are now dynamic-capable, so use .o directly for shared lib +hsdep/libHShsdep-0.1-ghc8.10.7.so: hsdep/HsDep.o + '$(TEST_HC)' $(TEST_HC_OPTS) -shared -dynamic -o hsdep/libHShsdep-0.1-ghc8.10.7.so hsdep/HsDep.o hsdep-empty-lib/libHShsdep-0.1-ghc8.10.7.so: mkdir -p hsdep-empty-lib @@ -33,8 +34,10 @@ hsdep-empty-lib/libHShsdep-0.1-ghc8.10.7.so: '$(TEST_HC)' $(EXTRA_HC_OPTS) -shared -dynamic -o hsdep-empty-lib/libHShsdep-0.1-ghc8.10.7.so empty.c rm empty.c -hsdep/HsDep.dyn_hi hsdep/HsDep.dyn_o hsdep/HsDep.hi hsdep/HsDep.o: hsdep/HsDep.hs - '$(TEST_HC)' $(EXTRA_HC_OPTS) -c -dynamic-too -this-unit-id hsdep-0.1 hsdep/HsDep.hs -dynhisuf dyn_hi -dynosuf dyn_o +# Compile without -dynamic: all .o files are now dynamic-capable, +# and the .hi profile tag must be "" (not "dyn") for non-dynamic consumers. +hsdep/HsDep.hi hsdep/HsDep.o: hsdep/HsDep.hs + '$(TEST_HC)' $(EXTRA_HC_OPTS) -c -this-unit-id hsdep-0.1 hsdep/HsDep.hs T21035: a.out diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 66674ca80566..afe269b7f62d 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -325,7 +325,7 @@ test('T22669', req_interp, makefile_test, []) test('T23339', req_c, makefile_test, []) test('T23339B', [extra_files(['T23339.hs']), req_c], makefile_test, []) test('T23613', normal, compile_and_run, ['-this-unit-id=foo']) -test('T23944', [unless(have_dynamic(), skip), extra_files(['T23944A.hs'])], multimod_compile, ['T23944 T23944A', '-fprefer-byte-code -fbyte-code -fno-code -dynamic-too -fwrite-interface']) +test('T23944', [unless(have_dynamic(), skip), extra_files(['T23944A.hs'])], multimod_compile, ['T23944 T23944A', '-fprefer-byte-code -fbyte-code -fno-code -fwrite-interface']) test('T24286', [cxx_src, unless(have_profiling(), skip), extra_files(['T24286.cpp'])], compile, ['-prof -no-hs-main']) test('T24839', [unless(arch('x86_64') or arch('aarch64'), skip), extra_files(["t24839_sub.S"])], compile_and_run, ['t24839_sub.S']) test('t25150', [extra_files(["t25150"])], multimod_compile, ['Main.hs', '-v0 -working-dir t25150/dir a.c']) diff --git a/testsuite/tests/driver/dynamicToo/all.T b/testsuite/tests/driver/dynamicToo/all.T index 28fedc786372..dde2a5a8cb14 100644 --- a/testsuite/tests/driver/dynamicToo/all.T +++ b/testsuite/tests/driver/dynamicToo/all.T @@ -1,15 +1,18 @@ +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. +# These tests exercised -dynamic-too functionality that no longer exists. + test('dynamicToo003', [extra_files(['A003.hs']), - unless(have_vanilla(), skip), unless(have_dynamic(), skip)], + skip], # -dynamic-too is deprecated makefile_test, []) test('dynamicTooRecomp', [extra_files(['ARecomp.hs']), - unless(have_vanilla(), skip), unless(have_dynamic(), skip)], + skip], # -dynamic-too is deprecated makefile_test, []) test('dynamicTooOnlyInterface', [extra_files(['ARecomp.hs']), - unless(have_vanilla(), skip), unless(have_dynamic(), skip)], + skip], # -dynamic-too is deprecated makefile_test, []) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T index 58539df19ebf..306e9982440b 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T @@ -1,6 +1,8 @@ +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. +# These tests exercised -dynamic-too functionality that no longer exists. + opts = [ extra_files(['A.hs', 'B1.hs', 'B2.hs', 'C.hs']), - when(opsys('mingw32'), expect_broken(7665)), unless(have_vanilla(), skip), - unless(have_dynamic(), skip) ] + skip ] # -dynamic-too is deprecated test('dynamicToo001', [opts], makefile_test, []) test('dynamicToo001MakeA', [opts], makefile_test, []) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo001boot/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo001boot/test.T index bca0be654faf..5aa5025931c4 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo001boot/test.T +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001boot/test.T @@ -1,6 +1,5 @@ - +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. test('dynamicToo001boot', [extra_files(['A.hs', 'B1.hs-boot', 'B2.hs-boot', 'C.hs']), - when(opsys('mingw32'), expect_broken(7665)), unless(have_vanilla(), skip), - unless(have_dynamic(), skip)], + skip], # -dynamic-too is deprecated makefile_test, []) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T index 64e7817d6f30..b27221899360 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T +++ b/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T @@ -1,5 +1,5 @@ - +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. test('dynamicToo002', [extra_files(['A.hs', 'B.hs', 'C.hs']), - unless(have_vanilla(), skip), unless(have_dynamic(), skip)], + skip], # -dynamic-too is deprecated makefile_test, []) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo004/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo004/test.T index e551c952df62..2565aa878c35 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo004/test.T +++ b/testsuite/tests/driver/dynamicToo/dynamicToo004/test.T @@ -1,8 +1,5 @@ - +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. test('dynamicToo004', [extra_files(['Setup.hs', 'pkg1/', 'pkg1dyn/', 'pkg2/', 'prog.hs']), - expect_broken(7665), - unless(have_vanilla(), skip), - unless(have_dynamic(), skip)], + skip], # -dynamic-too is deprecated makefile_test, []) - diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T index 58eb6f77ac28..c2ff77758ab8 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T @@ -1,5 +1,5 @@ - +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. test('dynamicToo005', [extra_files(['dynamicToo005.bkp']), - unless(have_vanilla(), skip), unless(have_dynamic(), skip)], + skip], # -dynamic-too is deprecated makefile_test, []) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/all.T b/testsuite/tests/driver/dynamicToo/dynamicToo006/all.T index f9cd52351aab..61dd09e50d81 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo006/all.T +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/all.T @@ -1,3 +1,5 @@ +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. test('dynamicToo006', - [normalise_slashes, extra_files(['Main.hs']), unless(have_dynamic(), skip)], + [normalise_slashes, extra_files(['Main.hs']), + skip], # -dynamic-too is deprecated makefile_test, ['main']) diff --git a/testsuite/tests/driver/dynamicToo/dynamicTooMake/test.T b/testsuite/tests/driver/dynamicToo/dynamicTooMake/test.T index f771282e691b..81662e5a56e1 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicTooMake/test.T +++ b/testsuite/tests/driver/dynamicToo/dynamicTooMake/test.T @@ -1,9 +1,5 @@ - +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. test('dynamicTooMake', [extra_files(['p', 'q', 'Setup.hs']), - when(opsys('mingw32'), expect_broken(7665)), unless(have_vanilla(), skip), - unless(have_dynamic(), skip), - copy_files, - grep_errmsg("Dynamic hash") - ], + skip], # -dynamic-too is deprecated makefile_test, []) diff --git a/testsuite/tests/driver/fat-iface/fat015.stderr b/testsuite/tests/driver/fat-iface/fat015.stderr index 8fb591873050..8e1a25196598 100644 --- a/testsuite/tests/driver/fat-iface/fat015.stderr +++ b/testsuite/tests/driver/fat-iface/fat015.stderr @@ -1,6 +1,6 @@ -[1 of 6] Compiling FatQuote ( FatQuote.hs, FatQuote.o, FatQuote.dyn_o, interpreted ) +[1 of 6] Compiling FatQuote ( FatQuote.hs, FatQuote.o, interpreted ) [2 of 6] Compiling FatQuote1 ( FatQuote1.hs, interpreted ) -[3 of 6] Compiling FatQuote2 ( FatQuote2.hs, FatQuote2.o, FatQuote2.dyn_o ) +[3 of 6] Compiling FatQuote2 ( FatQuote2.hs, FatQuote2.o ) [4 of 6] Compiling FatTH1 ( FatTH1.hs, nothing ) [5 of 6] Compiling FatTH2 ( FatTH2.hs, nothing ) [6 of 6] Compiling FatTHTop ( FatTHTop.hs, nothing ) diff --git a/testsuite/tests/driver/implicit-dyn-too/all.T b/testsuite/tests/driver/implicit-dyn-too/all.T index 073b9c8d3a83..fefd1551cc00 100644 --- a/testsuite/tests/driver/implicit-dyn-too/all.T +++ b/testsuite/tests/driver/implicit-dyn-too/all.T @@ -1,3 +1,4 @@ -test('implicit-dyn-too', [when(opsys('mingw32'),skip) - ,unless(have_dynamic(), skip) - ,extra_files(['QuasiExpr.hs', 'QuasiQuote.hs']) ], makefile_test, []) +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. +# This test exercised implicit -dynamic-too recompilation which no longer exists. +test('implicit-dyn-too', [skip], # -dynamic-too is deprecated + makefile_test, []) diff --git a/testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits_single5.stdout b/testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits_single5.stdout index f0e62c8a5553..c1c9b467a9a7 100644 --- a/testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits_single5.stdout +++ b/testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits_single5.stdout @@ -1 +1 @@ -[1 of 1] Compiling TH ( th/TH.hs, th/TH.o, th/TH.dyn_o ) +[1 of 1] Compiling TH ( th/TH.hs, th/TH.o ) diff --git a/testsuite/tests/driver/recomp-boot-dyn-too/all.T b/testsuite/tests/driver/recomp-boot-dyn-too/all.T index 8d4d6657c0dd..c56b2aa5f43d 100644 --- a/testsuite/tests/driver/recomp-boot-dyn-too/all.T +++ b/testsuite/tests/driver/recomp-boot-dyn-too/all.T @@ -1,4 +1,3 @@ -test('recomp-boot-dyn-too', [ unless(have_dynamic(), skip) - , extra_files(['A.hs', 'B1.hs', 'B2.hs', 'A.hs-boot']) - , when(fast(), skip)], +# -dynamic-too is deprecated and a no-op; all .o files are now dynamic-capable. +test('recomp-boot-dyn-too', [ skip ], # -dynamic-too is deprecated makefile_test, []) diff --git a/testsuite/tests/driver/recompPluginPackage/q/q.cabal b/testsuite/tests/driver/recompPluginPackage/q/q.cabal index 8216113fceda..e3f62da3cad2 100644 --- a/testsuite/tests/driver/recompPluginPackage/q/q.cabal +++ b/testsuite/tests/driver/recompPluginPackage/q/q.cabal @@ -22,5 +22,5 @@ executable q -- other-extensions: build-depends: base >=4.14 && <5, p, ghc -- hs-source-dirs: - ghc-options: -dynamic-too + ghc-options: -dynamic default-language: Haskell2010 diff --git a/testsuite/tests/driver/recompPluginPackage/recompPluginPackage.stderr-mingw32 b/testsuite/tests/driver/recompPluginPackage/recompPluginPackage.stderr-mingw32 index 46497c66183c..8b137891791f 100644 --- a/testsuite/tests/driver/recompPluginPackage/recompPluginPackage.stderr-mingw32 +++ b/testsuite/tests/driver/recompPluginPackage/recompPluginPackage.stderr-mingw32 @@ -1,12 +1 @@ -when making flags consistent: warning: - -dynamic-too is not supported on Windows - -when making flags consistent: warning: - -dynamic-too is not supported on Windows - -when making flags consistent: warning: - -dynamic-too is not supported on Windows - -when making flags consistent: warning: - -dynamic-too is not supported on Windows diff --git a/testsuite/tests/lib/integer/all.T b/testsuite/tests/lib/integer/all.T index 3fe705344d56..e7d06de7fe8a 100644 --- a/testsuite/tests/lib/integer/all.T +++ b/testsuite/tests/lib/integer/all.T @@ -17,8 +17,8 @@ test('bignumMatch', [], compile, ['']) test('T18813', [], compile_and_run, ['']) test('T19170', [], compile_and_run, ['']) -# skipped on Windows (doesn't support `-dynamic-too`) -test('T19264', [when(opsys('mingw32'),skip),unless(have_dynamic(),skip),extra_files(['T19264b.hs'])], compile, ['-dynamic-too --make -v0']) +# -dynamic-too is deprecated; use -dynamic instead +test('T19264', [when(opsys('mingw32'),skip),unless(have_dynamic(),skip),extra_files(['T19264b.hs'])], compile, ['-dynamic --make -v0']) test('integerImportExport', normal, compile_and_run, ['']) diff --git a/testsuite/tests/profiling/should_compile/Makefile b/testsuite/tests/profiling/should_compile/Makefile index 012890aa9da8..fef23072c621 100644 --- a/testsuite/tests/profiling/should_compile/Makefile +++ b/testsuite/tests/profiling/should_compile/Makefile @@ -3,6 +3,6 @@ include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk T14931: - "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi T14931_State.hs + "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c -O -dynamic T14931_State.hs "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c -O -prof -osuf p_o -hisuf p_hi T14931_State.hs "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -c -O -prof -osuf p_o -hisuf p_hi T14931_Bug.hs diff --git a/testsuite/tests/simplStg/should_compile/T22840.stderr b/testsuite/tests/simplStg/should_compile/T22840.stderr index cdcd8ad478ae..88bce8231699 100644 --- a/testsuite/tests/simplStg/should_compile/T22840.stderr +++ b/testsuite/tests/simplStg/should_compile/T22840.stderr @@ -1,6 +1,6 @@ -[1 of 3] Compiling T22840A ( T22840A.hs, T22840A.o, T22840A.dyn_o ) -[2 of 3] Compiling T22840B ( T22840B.hs, T22840B.o, T22840B.dyn_o, interpreted ) -[3 of 3] Compiling C ( T22840.hs, T22840.o, T22840.dyn_o, interpreted ) +[1 of 3] Compiling T22840A ( T22840A.hs, T22840A.o, interpreted ) +[2 of 3] Compiling T22840B ( T22840B.hs, T22840B.o, interpreted ) +[3 of 3] Compiling C ( T22840.hs, T22840.o, interpreted ) start Just end diff --git a/testsuite/tests/simplStg/should_compile/all.T b/testsuite/tests/simplStg/should_compile/all.T index 4bff79965d72..520a4914a603 100644 --- a/testsuite/tests/simplStg/should_compile/all.T +++ b/testsuite/tests/simplStg/should_compile/all.T @@ -21,7 +21,7 @@ test('T22840', [extra_files( ]), # barf signature mismatch on wasm32 due to -dtag-inference-checks when(arch('wasm32'), skip), - when(not(have_dynamic()),skip)], multimod_compile, ['T22840', '-dynamic-too -dtag-inference-checks']) + when(not(have_dynamic()),skip)], multimod_compile, ['T22840', '-dynamic -dtag-inference-checks']) test('inferTags003', [ only_ways(['optasm']), grep_errmsg(r'(call stg\_ap\_0)', [1]) ], compile, ['-ddump-cmm -dno-typeable-binds -O']) diff --git a/testsuite/tests/splice-imports/SI07.stderr b/testsuite/tests/splice-imports/SI07.stderr index 89690a63d518..2e1ad1da9df7 100644 --- a/testsuite/tests/splice-imports/SI07.stderr +++ b/testsuite/tests/splice-imports/SI07.stderr @@ -1,3 +1,3 @@ -[1 of 3] Compiling SI05A ( SI05A.hs, SI05A.o, SI05A.dyn_o ) +[1 of 3] Compiling SI05A ( SI05A.hs, SI05A.o ) [2 of 3] Compiling SI07A ( SI07A.hs, nothing ) [3 of 3] Compiling SI07 ( SI07.hs, nothing )