From: simonmar Date: Tue, 21 Mar 2000 14:33:18 +0000 (+0000) Subject: [project @ 2000-03-21 14:33:18 by simonmar] X-Git-Tag: Approximately_9120_patches~4937 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0a6a055d22d23ac900f2252911b32c8f43ae9da9;p=ghc-hetmet.git [project @ 2000-03-21 14:33:18 by simonmar] Call __init_PrelMain instead of __initMain. PrelMain lives above Main in the dependency tree, so this is more correct. --- diff --git a/ghc/rts/RtsStartup.c b/ghc/rts/RtsStartup.c index 795b22d..3a2b472 100644 --- a/ghc/rts/RtsStartup.c +++ b/ghc/rts/RtsStartup.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: RtsStartup.c,v 1.34 2000/03/14 14:34:47 sewardj Exp $ + * $Id: RtsStartup.c,v 1.35 2000/03/21 14:33:18 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -187,8 +187,8 @@ startupHaskell(int argc, char *argv[]) The code generator inserts a small function "__init_" in each module and calls the registration functions in each of the modules - it imports. So, if we call "__init_Main", each reachable module in the - program will be registered. + it imports. So, if we call "__init_PrelMain", each reachable module in the + program will be registered (because PrelMain.mainIO calls Main.main). The init* functions are compiled in the same way as STG code, i.e. without normal C call/return conventions. Hence we must use diff --git a/ghc/rts/StgStartup.hc b/ghc/rts/StgStartup.hc index cb8beca..40f1198 100644 --- a/ghc/rts/StgStartup.hc +++ b/ghc/rts/StgStartup.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: StgStartup.hc,v 1.8 2000/03/16 12:40:40 simonmar Exp $ + * $Id: StgStartup.hc,v 1.9 2000/03/21 14:33:18 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -131,7 +131,7 @@ STGFUN(stg_enterStackTop) Special STG entry points for module registration. This stuff is problematic for Hugs, because it introduces a - dependency between the RTS and the program (ie. __init_Main). So + dependency between the RTS and the program (ie. __init_PrelMain). So we currently disable module initialisation for Hugs. -------------------------------------------------------------------------- */ @@ -148,13 +148,13 @@ STGFUN(stg_init_ret) STGFUN(stg_init) { - EF_(__init_Main); + EF_(__init_PrelMain); EF_(__init_Prelude); FB_ Sp = (P_)init_stack; PUSH_INIT_STACK(stg_init_ret); PUSH_INIT_STACK(__init_Prelude); - JMP_(__init_Main); + JMP_(__init_PrelMain); FE_ }