[commit: ghc] master: Better import library support for Windows (93489cd)

git at git.haskell.org git at git.haskell.org
Fri Jun 2 16:28:06 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/93489cd3b4c1b0d17506a12a9b964c0082ddb7a8/ghc

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

commit 93489cd3b4c1b0d17506a12a9b964c0082ddb7a8
Author: Tamar Christina <tamar at zhox.com>
Date:   Fri Jun 2 11:47:57 2017 -0400

    Better import library support for Windows
    
    The import library support added for 7.10.3 was only a partial one.
    This support was predicated on using file extensions to determine
    whether or not a library was an import library. It also couldn't handle
    libraries with multiple dll pointers.
    
    This is a rewrite of that patch and fully integrating it into the normal
    archive parsing and loading routines. This solves a host of issues,
    among others allowing us to finally use `-lgcc_s`.
    
    This also fixes a problem with our previous implementation, where we
    just loaded the DLL and moved on. Doing this had the potential of using
    the wrong symbol at resolve time. Say a DLL already loaded (A.dll) has
    symbol a exported (dependency of another dll perhaps).
    
    We find an import library `B.lib` explicitly defining an export of `a`.
    we load `B.dll` but this gets put after `A.dll`, at resolve time we
    would use the value from `A` instead of `B` which is what we wanted.
    
    Test Plan: ./valide and make test TEST=13606
    
    Reviewers: austin, bgamari, erikd, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, RyanGlScott, thomie, #ghc_windows_task_force
    
    GHC Trac Issues: #13606, #12499, #12498
    
    Differential Revision: https://phabricator.haskell.org/D3513


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

93489cd3b4c1b0d17506a12a9b964c0082ddb7a8
 docs/users_guide/8.4.1-notes.rst               |   4 +
 rts/Linker.c                                   |   5 +-
 rts/LinkerInternals.h                          |  14 +-
 rts/RtsSymbolInfo.c                            | 113 ++++++---
 rts/RtsSymbolInfo.h                            |  23 +-
 rts/linker/LoadArchive.c                       |  26 +--
 rts/linker/PEi386.c                            | 310 ++++++++++++++++++-------
 rts/linker/PEi386.h                            |   5 +-
 testsuite/tests/ghci/linking/dyn/Makefile      |   4 +
 testsuite/tests/ghci/linking/dyn/T13606.hs     | 128 ++++++++++
 testsuite/tests/ghci/linking/dyn/T13606.stdout |   2 +
 testsuite/tests/ghci/linking/dyn/Triangle.fx   |  10 +
 testsuite/tests/ghci/linking/dyn/all.T         |   4 +
 13 files changed, 498 insertions(+), 150 deletions(-)

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

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 93489cd3b4c1b0d17506a12a9b964c0082ddb7a8


More information about the ghc-commits mailing list