From d4c5f29ceced0891dfad266ef1daa54975547068 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Fri, 4 Feb 2022 18:56:41 -0500 Subject: driver: Drop hacks surrounding windres invocation Drop hack for #1828, among others as they appear to be unnecessary when using `llvm-windres`. --- compiler/GHC/SysTools/Tasks.hs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'compiler') diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs index ded526513a..d6532a6234 100644 --- a/compiler/GHC/SysTools/Tasks.hs +++ b/compiler/GHC/SysTools/Tasks.hs @@ -374,25 +374,11 @@ runRanlib logger dflags args = traceToolCommand logger "ranlib" $ do runWindres :: Logger -> DynFlags -> [Option] -> IO () runWindres logger dflags args = traceToolCommand logger "windres" $ do - let cc = pgm_c dflags - cc_args = map Option (sOpt_c (settings dflags)) + let cc_args = map Option (sOpt_c (settings dflags)) windres = pgm_windres dflags opts = map Option (getOpts dflags opt_windres) - quote x = "\"" ++ x ++ "\"" - args' = -- If windres.exe and gcc.exe are in a directory containing - -- spaces then windres fails to run gcc. We therefore need - -- to tell it what command to use... - [ Option ("--preprocessor=" ++ quote cc) ] - ++ map (Option . ("--preprocessor-arg=" ++) . quote) - (map showOpt opts ++ ["-E", "-xc", "-DRC_INVOKED"]) - -- ...but if we do that then if windres calls popen then - -- it can't understand the quoting, so we have to use - -- --use-temp-file so that it interprets it correctly. - -- See #1828. - ++ [ Option "--use-temp-file" ] - ++ args mb_env <- getGccEnv cc_args - runSomethingFiltered logger id "Windres" windres args' Nothing mb_env + runSomethingFiltered logger id "Windres" windres (opts ++ args) Nothing mb_env touch :: Logger -> DynFlags -> String -> String -> IO () touch logger dflags purpose arg = traceToolCommand logger "touch" $ -- cgit v1.2.1