If we are given -Werror, then pass -Werror to cpp
[ghc-hetmet.git] / compiler / main / DriverPipeline.hs
index 53ace5c..32cb4b8 100644 (file)
@@ -1071,8 +1071,8 @@ runPhase SplitMangle _stop hsc_env _basename _suff input_fn _get_output_fn maybe
            dflags' = dflags { splitInfo = Just (split_s_prefix, n_files) }
 
        -- Remember to delete all these files
-       addFilesToClean [ split_s_prefix ++ "__" ++ show n ++ ".s"
-                       | n <- [1..n_files]]
+       addFilesToClean dflags' [ split_s_prefix ++ "__" ++ show n ++ ".s"
+                               | n <- [1..n_files]]
 
        return (SplitAs, dflags', maybe_loc, "**splitmangle**")
          -- we don't use the filename
@@ -1143,6 +1143,16 @@ runPhase SplitAs _stop hsc_env _basename _suff _input_fn get_output_fn maybe_loc
         let assemble_file n
               = SysTools.runAs dflags
                          (map SysTools.Option as_opts ++
+#ifdef sparc_TARGET_ARCH
+        -- We only support SparcV9 and better because V8 lacks an atomic CAS
+        -- instruction so we have to make sure that the assembler accepts the
+        -- instruction set. Note that the user can still override this
+        -- (e.g., -mcpu=ultrasparc). GCC picks the "best" -mcpu flag
+        -- regardless of the ordering.
+        --
+        -- This is a temporary hack.
+                          [ SysTools.Option "-mcpu=v9" ] ++
+#endif
                           [ SysTools.Option "-c"
                           , SysTools.Option "-o"
                           , SysTools.FileOption "" (split_obj n)