X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fphases.sgml;h=e0f92b3fd23b408d63061bdb816631ddabf936dc;hb=3087014ae03067cf0f9c9e0d8d49fb885e2cd0a8;hp=fa0ae08f9c94da9efce5963b87a5a7164949a20d;hpb=f319fdf906aa9fb7996ae33ad244b5e29a077b94;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/phases.sgml b/ghc/docs/users_guide/phases.sgml index fa0ae08..e0f92b3 100644 --- a/ghc/docs/users_guide/phases.sgml +++ b/ghc/docs/users_guide/phases.sgml @@ -555,6 +555,27 @@ strmod = "\ + + + specifying your own main function + + The normal rule in Haskell is that your program must supply a main + function in module Main. When testing, it is often convenient + to change which function is the "main" one, and the flag + allows you to do so. The thing can be one of: + + A lower-case identifier foo. GHC assumes that the main function is Main.foo. + An module name A. GHC assumes that the main function is A.main. + An qualified name A.foo. GHC assumes that the main function is A.foo. + + Strictly speaking, is not a link-phase flag at all; it has no effect on the link step. + The flag must be specified when compiling the module containing the specified main function (e.g. module A + in the latter two items above. It has no effect for other modules (and hence can safely be given to ghc --make). + + + + + linking Haskell libraries with foreign code @@ -563,8 +584,8 @@ strmod = "\ as part of another (non-Haskell) program, the RTS will not be supplying its definition of main() at link-time, you will have to. To signal that to the - driver script when linking, use - . + compiler when linking, use + . See also . Notice that since the command-line passed to the linker is rather involved, you probably want to use @@ -573,6 +594,13 @@ strmod = "\ though, just try linking once with on to see what options the driver passes through to the linker. + + The flag can also be + used to persuade the compiler to do the link step in + mode when there is no Haskell + Main module present (normally the + compiler will not attempt linking when there is no + Main).