[commit: ghc] master: rts: fix filename case for mingw32 target (30d6373)

git at git.haskell.org git at git.haskell.org
Tue Dec 5 07:50:54 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/30d6373e6715a05c02775b336e832341a6fc0524/ghc

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

commit 30d6373e6715a05c02775b336e832341a6fc0524
Author: Sergei Trofimovich <slyfox at gentoo.org>
Date:   Tue Dec 5 07:49:24 2017 +0000

    rts: fix filename case for mingw32 target
    
    The failure is visible when we build a cross-compiler
    from linux to mingw32 as:
    
    ```
        $ ./configure --host=x86_64-pc-linux-gnu \
                      --target=x86_64-w64-mingw32
        $ make
        rts/linker/PEi386.c:159:10: error:
             fatal error: Psapi.h: No such file or directory
             #include <Psapi.h>
                      ^~~~~~~~~
            |
        159 | #include <Psapi.h>
            |          ^
    ```
    
    The problem here is case-sensitive linux filesystem. On windows
    it does not matter what case is used for includes and libraries.
    
    mingw32 provides all libraries and headers lowercase. This change
    fixes case for <dbghelp.h>, <psapi.h>, -ldbghelp, -lpsapi.
    
    Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
    
    Reviewers: bgamari, erikd, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4247


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

30d6373e6715a05c02775b336e832341a6fc0524
 rts/linker/PEi386.c  | 2 +-
 rts/package.conf.in  | 4 ++--
 rts/rts.cabal.in     | 4 ++--
 rts/win32/veh_excn.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index 3dcf8c4..364f778 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -156,7 +156,7 @@ static uint8_t* cstring_from_COFF_symbol_name(
 #include <inttypes.h>
 #include <dbghelp.h>
 #include <stdlib.h>
-#include <Psapi.h>
+#include <psapi.h>
 
 #if defined(x86_64_HOST_ARCH)
 static size_t makeSymbolExtra_PEi386(
diff --git a/rts/package.conf.in b/rts/package.conf.in
index 52d7ef8..1746af5 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -45,8 +45,8 @@ extra-libraries:
                               ,"wsock32"    /* for the linker */
                               ,"gdi32"      /* for the linker */
                               ,"winmm"      /* for the linker */
-                              ,"Dbghelp"    /* for crash dump */
-                              ,"Psapi"      /* for process information.  */
+                              ,"dbghelp"    /* for crash dump */
+                              ,"psapi"      /* for process information.  */
 #endif
 #if NEED_PTHREAD_LIB
                               , "pthread"   /* for pthread_getthreadid_np, pthread_create, etc. */
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index 71aef3d..53b6271 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -58,9 +58,9 @@ library
           -- for the linker
           wsock32 gdi32 winmm
           -- for crash dump
-          Dbghelp
+          dbghelp
           -- for process information
-          Psapi
+          psapi
     if flag(need-pthread)
        -- for pthread_getthreadid_np, pthread_create, ...
        extra-libraries: pthread
diff --git a/rts/win32/veh_excn.c b/rts/win32/veh_excn.c
index fd50562..4b7d29a 100644
--- a/rts/win32/veh_excn.c
+++ b/rts/win32/veh_excn.c
@@ -20,7 +20,7 @@
 #include <stdio.h>
 #include <excpt.h>
 #include <inttypes.h>
-#include <Dbghelp.h>
+#include <dbghelp.h>
 
 /////////////////////////////////
 // Exception / signal handlers.



More information about the ghc-commits mailing list