From: Simon Marlow Date: Thu, 21 Aug 2008 15:55:49 +0000 (+0000) Subject: Don't use the cc-options from packages when compiling .hc files X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=39271273d6b1fd2cdfe92be1fa30a7eec3cc9107 Don't use the cc-options from packages when compiling .hc files Now that we don't include any header files in .hc apart from our own, the cc-options from packages are at best superfluous, so don't pass them. We still pass them to .c compilations, although I've just made changes to Cabal so that cc-options from a .cabal file are not copied into the InstalledPackageInfo. Most uses of cc-options in Cabal are clearly intended to be local to the package, but they were being propagated everywhere, almost certainly unintentionally. The way is left open for Cabal to allow packages to specify cc-options that get propagated in the future, if we find a use case for this. --- diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index d6b5e0e..e246b8b 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -852,7 +852,13 @@ runPhase cc_phase _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc let verb = getVerbFlag dflags - pkg_extra_cc_opts <- getPackageExtraCcOpts dflags pkgs + -- cc-options are not passed when compiling .hc files. Our + -- hc code doesn't not #include any header files anyway, so these + -- options aren't necessary. + pkg_extra_cc_opts <- + if cc_phase `eqPhase` HCc + then return [] + else getPackageExtraCcOpts dflags pkgs #ifdef darwin_TARGET_OS pkg_framework_paths <- getPackageFrameworkPath dflags pkgs