From dc055e5ce94940711e5c342afd13d6f5d9bafed4 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 5 Mar 2009 14:20:50 +0000 Subject: [PATCH] On OS X/x86, tell gcc to generate instructions for i686. Fixes trac #2983. By default, gcc on OS X will generate SSE instructions, which need things 16-byte aligned, but we don't 16-byte align things. Thus drop back to generic i686 compatibility. --- compiler/main/DriverPipeline.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 32cb4b8..4eccce3 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -993,6 +993,13 @@ runPhase cc_phase _stop hsc_env _basename _suff input_fn get_output_fn maybe_loc -- This is a temporary hack. ++ ["-mcpu=v9"] #endif +#if defined(darwin_TARGET_OS) && defined(i386_TARGET_ARCH) + -- By default, gcc on OS X will generate SSE + -- instructions, which need things 16-byte aligned, + -- but we don't 16-byte align things. Thus drop + -- back to generic i686 compatibility. Trac #2983. + ++ ["-march=i686"] +#endif ++ (if hcc && mangle then md_regd_c_flags else []) -- 1.7.10.4