When linking, put flags after the .o file.
authorDuncan Coutts <duncan@well-typed.com>
Sat, 5 Jun 2010 15:26:49 +0000 (15:26 +0000)
committerDuncan Coutts <duncan@well-typed.com>
Sat, 5 Jun 2010 15:26:49 +0000 (15:26 +0000)
Should fix ticket #4115
Do the same for the compiler flags, mainly for consistency.

Main.hs

diff --git a/Main.hs b/Main.hs
index bfda901..471e38f 100644 (file)
--- a/Main.hs
+++ b/Main.hs
@@ -616,16 +616,16 @@ output mb_libdir flags name toks = do
 
     rawSystemL ("compiling " ++ cProgName) beVerbose compiler
        (  ["-c"]
-        ++ [f | CompFlag f <- flags]
         ++ [cProgName]
         ++ ["-o", oProgName]
+        ++ [f | CompFlag f <- flags]
        )
     finallyRemove cProgName $ do
 
       rawSystemL ("linking " ++ oProgName) beVerbose linker
-        (  [f | LinkFlag f <- flags]
-        ++ [oProgName]
+        (  [oProgName]
         ++ ["-o", progName]
+        ++ [f | LinkFlag f <- flags]
        )
       finallyRemove oProgName $ do