X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FDriverPipeline.hs;h=8d31fd90c07a747514f1d4e266a3cdc894086d4a;hp=9bcc30aa991c6974bde0b37c6e0a34d15947285a;hb=6caa417ded740fb8eaa50669269e38c8129092f0;hpb=91bb651a14f8fe4163394f26af50fb8f76fa0607 diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 9bcc30a..8d31fd9 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -986,7 +986,7 @@ runPhase Cmm input_fn dflags -- way too many hacks, and I can't say I've ever used it anyway. runPhase cc_phase input_fn dflags - | cc_phase `eqPhase` Cc || cc_phase `eqPhase` Ccpp || cc_phase `eqPhase` HCc + | cc_phase `eqPhase` Cc || cc_phase `eqPhase` Ccpp || cc_phase `eqPhase` HCc || cc_phase `eqPhase` Cobjc = do let cc_opts = getOpts dflags opt_c hcc = cc_phase `eqPhase` HCc @@ -1054,15 +1054,16 @@ runPhase cc_phase input_fn dflags -- very weakly typed, being derived from C--. ["-fno-strict-aliasing"] + let gcc_lang_opt | cc_phase `eqPhase` Ccpp = "c++" + | cc_phase `eqPhase` Cobjc = "objective-c" + | otherwise = "c" io $ SysTools.runCc dflags ( -- force the C compiler to interpret this file as C when -- compiling .hc files, by adding the -x c option. -- Also useful for plain .c files, just in case GHC saw a -- -x c option. - [ SysTools.Option "-x", if cc_phase `eqPhase` Ccpp - then SysTools.Option "c++" - else SysTools.Option "c"] ++ - [ SysTools.FileOption "" input_fn + [ SysTools.Option "-x", SysTools.Option gcc_lang_opt + , SysTools.FileOption "" input_fn , SysTools.Option "-o" , SysTools.FileOption "" output_fn ]