Skip to content

Conversation

@angerman
Copy link

@angerman angerman commented Dec 3, 2025

Summary

This PR deprecates the -dynamic-too flag and removes the infrastructure that generated separate .dyn_o and .dyn_hi files alongside regular .o and .hi files.

  • The -dynamic-too flag now emits a deprecation warning and is a no-op
  • GHC no longer produces .dyn_o or .dyn_hi files
  • Only standard .o and .hi files are generated
  • ModLocation API preserved for compatibility (dyn paths return same as non-dyn paths)

Changes

File Changes
GHC/Driver/Session.hs Flag now deprecated with warning
GHC/Driver/Downsweep.hs Removed dynamic_too_enable auto-enablement
GHC/Driver/Pipeline.hs Removed backend double-run
GHC/Driver/DynFlags.hs Removed DynamicTooState, dynamicNow, setDynamicNow
GHC/Driver/Main.hs Simplified interface writing (single .hi)
GHC/Driver/Pipeline/Execute.hs Removed dynamicNow path checks
GHC/Iface/Load.hs Removed load_dynamic_too* functions
GHC/Iface/Recomp.hs Removed check_dyn_hi logic
GHC/Tc/Utils/Monad.hs Removed withoutDynamicNow
GHC/Unit/Finder.hs mkDynObjPath = mkObjPath, mkDynHiPath = mkHiPath
GHC/Linker/Loader.hs dyn_obj_file = obj_file
GHC/Linker/Deps.hs Updated comments

Breaking Changes

  • Build systems that rely on .dyn_o files will need to be updated to use regular .o files
  • The -dynamic-too flag no longer has any effect (deprecation warning emitted)

Test plan

  • Verify deprecation warning is emitted when using -dynamic-too
  • Verify only .o and .hi files are produced (no .dyn_o or .dyn_hi)
  • Run testsuite to check for regressions
  • Test TemplateHaskell compilation still works without auto-enablement

This commit deprecates the -dynamic-too flag and removes the infrastructure
that generated separate .dyn_o and .dyn_hi files alongside regular .o and .hi
files.

Key changes:
- Flag -dynamic-too now emits a deprecation warning and is a no-op
- Remove auto-enablement of -dynamic-too for TemplateHaskell
- Remove pipeline double-run that generated both static and dynamic objects
- Remove DynamicTooState type and dynamicNow field from DynFlags
- Remove dynamicTooState and setDynamicNow functions
- Unify dyn/non-dyn file paths (mkDynObjPath = mkObjPath, etc.)
- Remove dynamic interface loading and checking
- Update linker to use .o files for dynamic loading

The ModLocation fields (ml_dyn_obj_file, ml_dyn_hi_file) are kept for API
compatibility but now return the same paths as their non-dyn counterparts.

Build systems that rely on .dyn_o files will need to be updated to use
regular .o files instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants