Support the MergeStub phase when building with dynamic-too
authorIan Lynagh <ian@well-typed.com>
Sat, 5 Jan 2013 15:41:05 +0000 (15:41 +0000)
committerIan Lynagh <ian@well-typed.com>
Thu, 10 Jan 2013 18:29:53 +0000 (18:29 +0000)
compiler/main/DriverPipeline.hs

index 849532d..866ae8c 100644 (file)
@@ -1457,6 +1457,12 @@ runPhase MergeStub input_fn dflags
          panic "runPhase(MergeStub): no stub"
        Just stub_o -> do
          liftIO $ joinObjectFiles dflags [input_fn, stub_o] output_fn
+         whenGeneratingDynamicToo dflags $ do
+           liftIO $ debugTraceMsg dflags 4
+                        (text "Merging stub again for -dynamic-too")
+           let dyn_input_fn  = replaceExtension input_fn  (dynObjectSuf dflags)
+               dyn_output_fn = replaceExtension output_fn (dynObjectSuf dflags)
+           liftIO $ joinObjectFiles dflags [dyn_input_fn, stub_o] dyn_output_fn
          return (StopLn, output_fn)
 
 -- warning suppression