From 5bd3072ac30216a505151601884ac88bf404c9f2 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 11 Feb 2009 14:16:00 +0000 Subject: [PATCH] On sparc, pass -mcpu=v9 when assembling with object splitting enabled Fixes trac #2872. --- compiler/main/DriverPipeline.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 8f7b05c..32cb4b8 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -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) -- 1.7.10.4