summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-07-02 18:34:02 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-06 13:38:06 -0400
commit354ac99de09ce2b08bf81a704a304c25957ad5c4 (patch)
treef6429748aaa2b321d038c676189055274fa4e85b /compiler
parent4002bd1dcee0d05927abc669d6848c43b124c253 (diff)
downloadhaskell-354ac99de09ce2b08bf81a704a304c25957ad5c4.tar.gz
Use target platform in guessOutputFile
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/Driver/Make.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index 7796fe61af..ae12059726 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -41,6 +41,7 @@ module GHC.Driver.Make (
) where
import GHC.Prelude
+import GHC.Platform
import GHC.Tc.Utils.Backpack
import GHC.Tc.Utils.Monad ( initIfaceCheck )
@@ -87,7 +88,6 @@ import GHC.Utils.Error
import GHC.Utils.Logger
import GHC.Utils.Fingerprint
import GHC.Utils.TmpFs
-import GHC.Utils.Constants (isWindowsHost)
import GHC.Types.Basic
import GHC.Types.Error
@@ -697,6 +697,7 @@ discardIC hsc_env
guessOutputFile :: GhcMonad m => m ()
guessOutputFile = modifySession $ \env ->
let dflags = hsc_dflags env
+ platform = targetPlatform dflags
-- Force mod_graph to avoid leaking env
!mod_graph = hsc_mod_graph env
mainModuleSrcPath :: Maybe String
@@ -709,7 +710,7 @@ guessOutputFile = modifySession $ \env ->
-- we must add the .exe extension unconditionally here, otherwise
-- when name has an extension of its own, the .exe extension will
-- not be added by GHC.Driver.Pipeline.exeFileName. See #2248
- name' <- if isWindowsHost --FIXME: should be the target platform
+ name' <- if platformOS platform == OSMinGW32
then fmap (<.> "exe") name
else name
mainModuleSrcPath' <- mainModuleSrcPath