Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/7a60d63582cfb54dac941c0c7bc96343503f4f7e >--------------------------------------------------------------- commit 7a60d63582cfb54dac941c0c7bc96343503f4f7e Author: Ian Lynagh <[email protected]> Date: Fri Mar 16 23:03:02 2012 +0000 Soem more Wind64 fixes We may need to do this differently once we get as far as building the RTS in the dyn ways. >--------------------------------------------------------------- includes/RtsAPI.h | 2 +- includes/stg/DLL.h | 4 ++-- rts/Interpreter.c | 4 +++- rts/Linker.c | 37 ++++++++++++++++++++++--------------- rts/StgMiscClosures.cmm | 6 +++--- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h index e3b3f7d..7f41ebc 100644 --- a/includes/RtsAPI.h +++ b/includes/RtsAPI.h @@ -232,7 +232,7 @@ SchedulerStatus rts_getSchedStatus (Capability *cap); // Note that RtsAPI.h is also included by foreign export stubs in // the base package itself. // -#if defined(mingw32_HOST_OS) && defined(__PIC__) && !defined(COMPILING_BASE_PACKAGE) +#if defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH) && defined(__PIC__) && !defined(COMPILING_BASE_PACKAGE) __declspec(dllimport) extern StgWord base_GHCziTopHandler_runIO_closure[]; __declspec(dllimport) extern StgWord base_GHCziTopHandler_runNonIO_closure[]; #else diff --git a/includes/stg/DLL.h b/includes/stg/DLL.h index 7d40960..b7030b0 100644 --- a/includes/stg/DLL.h +++ b/includes/stg/DLL.h @@ -14,7 +14,7 @@ #ifndef __STGDLL_H__ #define __STGDLL_H__ 1 -#if defined(__PIC__) && defined(mingw32_HOST_OS) +#if defined(__PIC__) && defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH) # define DLL_IMPORT_DATA_REF(x) (_imp__##x) # define DLL_IMPORT_DATA_VARNAME(x) *_imp__##x # if __GNUC__ && !defined(__declspec) @@ -45,7 +45,7 @@ #else #define DLL_IMPORT #define DLL_IMPORT_RTS DLLIMPORT -# if defined(__PIC__) && defined(mingw32_HOST_OS) +# if defined(__PIC__) && defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH) # define DLL_IMPORT_DATA_VAR(x) _imp__##x # else # define DLL_IMPORT_DATA_VAR(x) x diff --git a/rts/Interpreter.c b/rts/Interpreter.c index 2eac1cd..a18e7ca 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -31,9 +31,11 @@ // When building the RTS in the non-dyn way on Windows, we don't // want declspec(__dllimport__) on the front of function prototypes // from libffi. -#if defined(mingw32_HOST_OS) && !defined(__PIC__) +#if defined(mingw32_HOST_OS) +#if (defined(i386_HOST_ARCH) && !defined(__PIC__)) || defined(x86_64_HOST_ARCH) # define LIBFFI_NOT_DLL #endif +#endif #include "ffi.h" diff --git a/rts/Linker.c b/rts/Linker.c index 9fb3f68..6fd36d8 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -396,10 +396,7 @@ typedef struct _RtsSymbolVal { SymI_HasProto(utime) \ SymI_HasProto(waitpid) -#elif !defined(mingw32_HOST_OS) -#define RTS_MINGW_ONLY_SYMBOLS /**/ -#define RTS_CYGWIN_ONLY_SYMBOLS /**/ -#else /* defined(mingw32_HOST_OS) */ +#elif defined(mingw32_HOST_OS) #define RTS_POSIX_ONLY_SYMBOLS /**/ #define RTS_CYGWIN_ONLY_SYMBOLS /**/ @@ -415,6 +412,12 @@ typedef struct _RtsSymbolVal { #define RTS___MINGW_VFPRINTF_SYM /**/ #endif +#if defined(i386_HOST_ARCH) +#define RTS_MINGW32_ONLY(X) X +#else +#define RTS_MINGW32_ONLY(X) /**/ +#endif + /* These are statically linked from the mingw libraries into the ghc executable, so we have to employ this hack. */ #define RTS_MINGW_ONLY_SYMBOLS \ @@ -444,7 +447,7 @@ typedef struct _RtsSymbolVal { SymI_HasProto(strcpy) \ SymI_HasProto(strncpy) \ SymI_HasProto(abort) \ - SymI_NeedsProto(_alloca) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(_alloca)) \ SymI_HasProto(isxdigit) \ SymI_HasProto(isupper) \ SymI_HasProto(ispunct) \ @@ -495,21 +498,25 @@ typedef struct _RtsSymbolVal { SymI_HasProto(rts_InstallConsoleEvent) \ SymI_HasProto(rts_ConsoleHandlerDone) \ SymI_NeedsProto(mktime) \ - SymI_NeedsProto(_imp___timezone) \ - SymI_NeedsProto(_imp___tzname) \ - SymI_NeedsProto(_imp__tzname) \ - SymI_NeedsProto(_imp___iob) \ - SymI_NeedsProto(_imp___osver) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(_imp___timezone)) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(_imp___tzname)) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(_imp__tzname)) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(_imp___iob)) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(_imp___osver)) \ SymI_NeedsProto(localtime) \ SymI_NeedsProto(gmtime) \ SymI_NeedsProto(opendir) \ SymI_NeedsProto(readdir) \ SymI_NeedsProto(rewinddir) \ - SymI_NeedsProto(_imp____mb_cur_max) \ - SymI_NeedsProto(_imp___pctype) \ - SymI_NeedsProto(__chkstk) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(_imp____mb_cur_max)) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(_imp___pctype)) \ + RTS_MINGW32_ONLY(SymI_NeedsProto(__chkstk)) \ RTS_MINGW_GETTIMEOFDAY_SYM \ SymI_NeedsProto(closedir) + +#else +#define RTS_MINGW_ONLY_SYMBOLS /**/ +#define RTS_CYGWIN_ONLY_SYMBOLS /**/ #endif @@ -742,7 +749,7 @@ typedef struct _RtsSymbolVal { // We don't do this when compiling to Windows DLLs at the moment because // it doesn't support cross package data references well. // -#if defined(__PIC__) && defined(mingw32_HOST_OS) +#if defined(__PIC__) && defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH) #define RTS_INTCHAR_SYMBOLS #else #define RTS_INTCHAR_SYMBOLS \ @@ -1069,7 +1076,7 @@ typedef struct _RtsSymbolVal { /* entirely bogus claims about types of these symbols */ #define SymI_NeedsProto(vvv) extern void vvv(void); -#if defined(__PIC__) && defined(mingw32_HOST_OS) +#if defined(__PIC__) && defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH) #define SymE_HasProto(vvv) SymE_HasProto(vvv); #define SymE_NeedsProto(vvv) extern void _imp__ ## vvv (void); #else diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index e4b128f..763c85b 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -576,7 +576,7 @@ INFO_TABLE_CONSTR(stg_MVAR_TSO_QUEUE,2,0,0,PRIM,"MVAR_TSO_QUEUE","MVAR_TSO_QUEUE replace them with references to the static objects. ------------------------------------------------------------------------- */ -#if defined(__PIC__) && defined(mingw32_HOST_OS) +#if defined(__PIC__) && defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH) /* * When sticking the RTS in a Windows DLL, we delay populating the * Charlike and Intlike tables until load-time, which is only @@ -601,7 +601,7 @@ INFO_TABLE_CONSTR(stg_MVAR_TSO_QUEUE,2,0,0,PRIM,"MVAR_TSO_QUEUE","MVAR_TSO_QUEUE * on the fact that static closures live in the data section. */ -#if !(defined(__PIC__) && defined(mingw32_HOST_OS)) +#if !(defined(__PIC__) && defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH)) section "data" { stg_CHARLIKE_closure: CHARLIKE_HDR(0) @@ -899,4 +899,4 @@ section "data" { INTLIKE_HDR(16) /* MAX_INTLIKE == 16 */ } -#endif // !(defined(__PIC__) && defined(mingw32_HOST_OS)) +#endif // !(defined(__PIC__) && defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH)) _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
