Commit 04f67c99 authored by Tamar Christina's avatar Tamar Christina Committed by Ben Gamari

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
parent 2484d4da
......@@ -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
~~~~~~~~~~~~
......
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment