[commit: ghc] master: Expand list of always loaded Windows shared libs (04f67c9)

git at git.haskell.org git at git.haskell.org
Tue Feb 14 15:54:38 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/04f67c9970c0e2599e0b2a29353b1acec72dacf0/ghc

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

commit 04f67c9970c0e2599e0b2a29353b1acec72dacf0
Author: Tamar Christina <tamar at zhox.com>
Date:   Tue Feb 14 09:43:02 2017 -0500

    Expand list of always loaded Windows shared libs
    
    When the `GCC` driver envokes the pipeline a `SPEC` is used to determine
    how to configure the compiler and which libraries to pass along.
    
    For Windows/mingw, this specfile is
    https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/mingw32.h
    
    This expands the list of base DLLs with the ones that GCC always links,
    and adds extra sibling dlls of `stdc++` in case it is linked in.
    
    Following D3028 this patch only needs to load the always load only the
    top level individual shared libs.
    
    Test Plan: ./validate
    
    Reviewers: RyanGlScott, austin, bgamari, erikd, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: RyanGlScott, thomie, #ghc_windows_task_force
    
    Differential Revision: https://phabricator.haskell.org/D3029


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

04f67c9970c0e2599e0b2a29353b1acec72dacf0
 docs/users_guide/8.2.1-notes.rst | 3 +++
 rts/linker/PEi386.c              | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/docs/users_guide/8.2.1-notes.rst b/docs/users_guide/8.2.1-notes.rst
index 45ed589..00e6c7c 100644
--- a/docs/users_guide/8.2.1-notes.rst
+++ b/docs/users_guide/8.2.1-notes.rst
@@ -263,6 +263,9 @@ Runtime system
   Enabling external tools to collect and analyze the event log data while the
   application is still running.
 
+- advapi32, shell32 and user32 are now automatically loaded in GHCi. libGCC is also
+  loaded when a depencency requires it. See :ghc-ticket:`13189`.
+
 Build system
 ~~~~~~~~~~~~
 
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index f29bb8b..bfac34f 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -107,9 +107,15 @@ void initLinker_PEi386()
      * These two libraries cause problems when added to the static link,
      * but are necessary for resolving symbols in GHCi, hence we load
      * them manually here.
+     *
+     * Most of these are included by base, but GCC always includes them
+     * So lets make sure we always have them too.
      */
     addDLL(WSTR("msvcrt"));
     addDLL(WSTR("kernel32"));
+    addDLL(WSTR("advapi32"));
+    addDLL(WSTR("shell32"));
+    addDLL(WSTR("user32"));
     addDLLHandle(WSTR("*.exe"), GetModuleHandle(NULL));
 #endif
 }



More information about the ghc-commits mailing list