Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/1df28a805b465a28b61f4cfe4db28f247a183206

>---------------------------------------------------------------

commit 1df28a805b465a28b61f4cfe4db28f247a183206
Author: Simon Marlow <[email protected]>
Date:   Tue Nov 15 15:43:28 2011 +0000

    Generate the C main() function when linking a binary (fixes #5373)
    
    Rather than have main() be statically compiled as part of the RTS, we
    now generate it into the tiny C file that we compile when linking a
    binary.
    
    The main motivation is that we want to pass the settings for the
    -rtsotps and -with-rtsopts flags into the RTS, rather than relying on
    fragile linking semantics to override the defaults, which don't work
    with DLLs on Windows (#5373).  In order to do this, we need to extend
    the API for initialising the RTS, so now we have:
    
    void hs_init_ghc (int *argc, char **argv[],   // program arguments
                      RtsConfig rts_config);      // RTS configuration
    
    hs_init_ghc() can optionally be used instead of hs_init(), and allows
    passing in configuration options for the RTS.  RtsConfig is a struct,
    which currently has two fields:
    
    typedef struct {
        RtsOptsEnabledEnum rts_opts_enabled;
        const char *rts_opts;
    } RtsConfig;
    
    but might have more in the future.  There is a default value for the
    struct, defaultRtsConfig, the idea being that you start with this and
    override individual fields as necessary.
    
    In fact, main() was in a separate static library, libHSrtsmain.a.
    That's now gone.

 compiler/main/DriverPipeline.hs      |   49 +++++++++++++++++----------------
 includes/Rts.h                       |    1 +
 includes/RtsAPI.h                    |   46 +++++++++++++++++++++++++++++---
 includes/RtsOpts.h                   |   20 --------------
 rts/RtsMain.h => includes/rts/Main.h |    4 ++-
 rts/Main.c                           |   24 ----------------
 rts/RtsFlags.c                       |   26 +++++++++--------
 rts/RtsFlags.h                       |    4 ++-
 rts/RtsMain.c                        |   17 +++++++-----
 rts/RtsStartup.c                     |   14 +++++++++-
 rts/ghc.mk                           |   13 +--------
 rts/hooks/RtsOpts.c                  |   14 ---------
 12 files changed, 112 insertions(+), 120 deletions(-)


Diff suppressed because of size. To see it, use:

    git show 1df28a805b465a28b61f4cfe4db28f247a183206

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to