X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FDriverPipeline.hs;h=2719470aaa82cead8b19bfb31fc172a2145939df;hp=aeac000b23a82117e53aac12a1eb6aec454c671b;hb=c5f7496604b096277e3ba57fcb6ed85422613c75;hpb=00f44fdc013f29c645d2b69ac5614c2af2a76c7e diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index aeac000..2719470 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -55,7 +55,6 @@ import Platform import Exception import Data.IORef ( readIORef ) -import Distribution.System import System.Directory import System.FilePath import System.IO @@ -1092,7 +1091,7 @@ runPhase cc_phase input_fn dflags -- These symbols are imported into the stub.c file via RtsAPI.h, and the -- way we do the import depends on whether we're currently compiling -- the base package or not. - ++ (if cTargetOS == Windows && + ++ (if platformOS (targetPlatform dflags) == OSMinGW32 && thisPackage dflags == basePackageId then [ "-DCOMPILING_BASE_PACKAGE" ] else []) @@ -1329,7 +1328,7 @@ runPhase LlvmLlc input_fn dflags return (LlvmMangle, output_fn) where -- Bug in LLVM at O3 on OSX. - llvmOpts = if cTargetOS == OSX + llvmOpts = if platformOS (targetPlatform dflags) == OSDarwin then ["-O1", "-O2", "-O2"] else ["-O1", "-O2", "-O3"] @@ -1646,7 +1645,7 @@ linkBinary dflags o_files dep_packages = do -- Permit the linker to auto link _symbol to _imp_symbol. -- This lets us link against DLLs without needing an "import library". - ++ (if cTargetOS == Windows + ++ (if platformOS (targetPlatform dflags) == OSMinGW32 then ["-Wl,--enable-auto-import"] else []) @@ -1680,13 +1679,13 @@ linkBinary dflags o_files dep_packages = do exeFileName :: DynFlags -> FilePath exeFileName dflags | Just s <- outputFile dflags = - if cTargetOS == Windows + if platformOS (targetPlatform dflags) == OSMinGW32 then if null (takeExtension s) then s <.> "exe" else s else s | otherwise = - if cTargetOS == Windows + if platformOS (targetPlatform dflags) == OSMinGW32 then "main.exe" else "a.out"