Get correct options when calling 'clang' inplace of 'as' (#5903)
authorDavid Terei <davidterei@gmail.com>
Mon, 5 Mar 2012 04:53:37 +0000 (23:53 -0500)
committerDavid Terei <davidterei@gmail.com>
Tue, 13 Mar 2012 00:04:50 +0000 (17:04 -0700)
MERGED from commit 5e383469a9cb1fc17af3882f6217e5382a80fc67

compiler/main/DriverPipeline.hs

index 353a778..9de71ba 100644 (file)
@@ -1183,14 +1183,17 @@ runPhase As input_fn dflags
                         = do
                             llvmVer <- io $ figureLlvmVersion dflags
                             return $ case llvmVer of
-                                Just n | n >= 30 -> SysTools.runClang
-                                _                -> SysTools.runAs
+                                -- using cGccLinkerOpts here but not clear if
+                                -- opt_c isn't a better choice
+                                Just n | n >= 30 ->
+                                    (SysTools.runClang, cGccLinkerOpts)
+
+                                _ -> (SysTools.runAs, getOpts dflags opt_a)
 
                         | otherwise
-                        = return SysTools.runAs
+                        = return (SysTools.runAs, getOpts dflags opt_a)
 
-        as_prog <- whichAsProg
-        let as_opts = getOpts dflags opt_a
+        (as_prog, as_opts) <- whichAsProg
         let cmdline_include_paths = includePaths dflags
 
         next_phase <- maybeMergeStub