summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2017-01-15 13:07:36 +0000
committerTamar Christina <tamar@zhox.com>2017-01-15 13:07:36 +0000
commit331f88d0d878eae926b3c1c61a3ff344916b62ed (patch)
treeaa58aa1558ad924c4bb01ca77bc34943866c9a71 /rts
parentf63c8ef33ec9666688163abe4ccf2d6c0428a7e7 (diff)
downloadhaskell-331f88d0d878eae926b3c1c61a3ff344916b62ed.tar.gz
Fix abort and import lib search on Windows
Summary: Apparently `sysErrorBelch` doesn't terminate the program anymore making previously unreachable code now execute. If a dll is not found the error message we return needs to be a heap value. Secondly also allow the pattern `lib<name>` to be allowed for finding an import library with the name `lib<name>.dll.a`. Test Plan: ./validate, new tests T13082_good and T13082_fail Reviewers: austin, RyanGlScott, hvr, erikd, simonmar, bgamari Reviewed By: RyanGlScott, bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2941 GHC Trac Issues: #13082
Diffstat (limited to 'rts')
-rw-r--r--rts/linker/PEi386.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index 6cd48613cb..1d0682b04c 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -240,10 +240,11 @@ addDLL_PEi386( pathchar *dll_name )
error:
stgFree(buf);
- sysErrorBelch("addDLL: %" PATH_FMT " (Win32 error %lu)", dll_name, GetLastError());
+ char* errormsg = malloc(sizeof(char) * 80);
+ snprintf(errormsg, 80, "addDLL: %" PATH_FMT " or dependencies not loaded. (Win32 error %lu)", dll_name, GetLastError());
/* LoadLibrary failed; return a ptr to the error msg. */
- return "addDLL: could not load DLL";
+ return errormsg;
}
pathchar* findSystemLibrary_PEi386( pathchar* dll_name )