X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=docs%2Fcomm%2Fthe-beast%2Fmain.html;fp=docs%2Fcomm%2Fthe-beast%2Fmain.html;h=332ffaa501633aaed778f86b445f92080a4dad2f;hp=0000000000000000000000000000000000000000;hb=0065d5ab628975892cea1ec7303f968c3338cbe1;hpb=28a464a75e14cece5db40f2765a29348273ff2d2 diff --git a/docs/comm/the-beast/main.html b/docs/comm/the-beast/main.html new file mode 100644 index 0000000..332ffaa --- /dev/null +++ b/docs/comm/the-beast/main.html @@ -0,0 +1,35 @@ + + +
+ +-fmain-is
flag. The trouble is
+that the runtime system is fixed, so what symbol should it link to?
+
+The current solution is this. Suppose the main function is Foo.run
.
+
Foo
, GHC adds an extra definition:
++ :Main.main = runIO Foo.run ++Now the RTS can invoke
:Main.main
to start the program. (This extra
+definition is inserted in TcRnDriver.checkMain.)
+init_:Main
, so when compiling the main module (Foo in this case),
+as well as generating init_Foo
as usual, GHC also generates
++ init_zcMain() { init_Foo; } ++This extra initialisation code is generated in CodeGen.mkModuleInit. +