Backport "Fixes to dealing with the export of main" to ghc-9.0
This is a backport of commit 8fe274e2 (!5178 (closed)) to the ghc-9.0
branch.
Fixes #19397 (closed).
This is a backport of commit 8fe274e2 (!5178 (closed)) to the ghc-9.0
branch.
Fixes #19397 (closed).