On sparc, pass -mcpu=v9 when assembling with object splitting enabled
authorIan Lynagh <igloo@earth.li>
Wed, 11 Feb 2009 14:16:00 +0000 (14:16 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 11 Feb 2009 14:16:00 +0000 (14:16 +0000)
Fixes trac #2872.

compiler/main/DriverPipeline.hs

index 8f7b05c..32cb4b8 100644 (file)
@@ -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)