From 57d26da8cd35d248916a037c6934d4ef526e7e13 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sat, 29 Oct 2005 18:13:52 +0000 Subject: [PATCH 1/1] [project @ 2005-10-29 18:13:52 by krasimir] The guessed output file should have ".exe" extension on Windows. ld tends to add .exe automatically if the output file doesn't have extension but if we don't add the extension explicitly then the doesFileExists check in DriverPipeline.link will fail. --- ghc/compiler/main/GHC.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ghc/compiler/main/GHC.hs b/ghc/compiler/main/GHC.hs index 2ff5229..fec3dfc 100644 --- a/ghc/compiler/main/GHC.hs +++ b/ghc/compiler/main/GHC.hs @@ -365,7 +365,11 @@ guessOutputFile s = modifySession s $ \env -> let isMain = (== mainModIs dflags) . ms_mod [ms] <- return (filter isMain mod_graph) ml_hs_file (ms_location ms) +#if defined(mingw32_HOST_OS) + guessedName = fmap (\fname -> basenameOf fname `joinFileExt` "exe") mainModuleSrcPath +#else guessedName = fmap basenameOf mainModuleSrcPath +#endif in case outputFile dflags of Just _ -> env -- 1.7.10.4