+ -- The C "main" function is not in the rts but in a separate static
+ -- library libHSrtsmain.a that sits next to the rts lib files. Assuming
+ -- we're using a Haskell main function then we need to link it in.
+ let no_hs_main = dopt Opt_NoHsMain dflags
+ let main_lib | no_hs_main = []
+ | otherwise = [ "-lHSrtsmain" ]
+ rtsEnabledObj <- if dopt Opt_RtsOptsEnabled dflags
+ then do fn <- mkExtraCObj dflags
+ ["#include \"Rts.h\"",
+ "const rtsBool rtsOptsEnabled = rtsTrue;"]
+ return [fn]
+ else return []
+ rtsOptsObj <- case rtsOpts dflags of
+ Just opts ->
+ do fn <- mkExtraCObj dflags
+ -- We assume that the Haskell "show" does
+ -- the right thing here
+ ["char *ghc_rts_opts = " ++ show opts ++ ";"]
+ return [fn]
+ Nothing -> return []
+