Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
5872bf59
Commit
5872bf59
authored
May 06, 2012
by
Ian Lynagh
Browse files
Working towards fixing DLLs on Win64
parent
6dcf0012
Changes
11
Hide whitespace changes
Inline
Side-by-side
includes/RtsAPI.h
View file @
5872bf59
...
...
@@ -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(i386_HOST_ARCH) && defined(__PIC__
) && !defined(COMPILING_BASE_PACKAGE)
#if defined(
COMPILING_WINDOWS_DLL
) && !defined(COMPILING_BASE_PACKAGE)
__declspec
(
dllimport
)
extern
StgWord
base_GHCziTopHandler_runIO_closure
[];
__declspec
(
dllimport
)
extern
StgWord
base_GHCziTopHandler_runNonIO_closure
[];
#else
...
...
includes/stg/DLL.h
View file @
5872bf59
...
...
@@ -14,7 +14,7 @@
#ifndef __STGDLL_H__
#define __STGDLL_H__ 1
#if defined(
__PIC__) && defined(mingw32_HOST_OS) && defined(i386_HOST_ARCH
)
#if defined(
COMPILING_WINDOWS_DLL
)
# 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) && defined(i386_HOST_ARCH
)
# if defined(
COMPILING_WINDOWS_DLL
)
# define DLL_IMPORT_DATA_VAR(x) _imp__##x
# else
# define DLL_IMPORT_DATA_VAR(x) x
...
...
rts/Linker.c
View file @
5872bf59
...
...
@@ -986,7 +986,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) && defined(i386_HOST_ARCH
)
#if defined(
COMPILING_WINDOWS_DLL
)
#define RTS_INTCHAR_SYMBOLS
#else
#define RTS_INTCHAR_SYMBOLS \
...
...
@@ -1314,7 +1314,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) && defined(i386_HOST_ARCH
)
#if defined(
COMPILING_WINDOWS_DLL
)
#define SymE_HasProto(vvv) SymE_HasProto(vvv);
#define SymE_NeedsProto(vvv) extern void _imp__ ## vvv (void);
#else
...
...
rts/RetainerProfile.c
View file @
5872bf59
...
...
@@ -366,7 +366,7 @@ find_srt( stackPos *info )
bitmap
=
info
->
next
.
srt
.
srt_bitmap
;
while
(
bitmap
!=
0
)
{
if
((
bitmap
&
1
)
!=
0
)
{
#if defined(
__PIC__) && defined(mingw32_HOST_OS
)
#if defined(
COMPILING_WINDOWS_DLL
)
if
((
unsigned
long
)(
*
(
info
->
next
.
srt
.
srt
))
&
0x1
)
c
=
(
*
(
StgClosure
**
)((
unsigned
long
)
*
(
info
->
next
.
srt
.
srt
))
&
~
0x1
);
else
...
...
@@ -1235,7 +1235,7 @@ retainSRT (StgClosure **srt, nat srt_bitmap, StgClosure *c, retainer c_child_r)
while
(
bitmap
!=
0
)
{
if
((
bitmap
&
1
)
!=
0
)
{
#if defined(
__PIC__) && defined(mingw32_HOST_OS
)
#if defined(
COMPILING_WINDOWS_DLL
)
if
(
(
unsigned
long
)(
*
srt
)
&
0x1
)
{
retainClosure
(
*
(
StgClosure
**
)
((
unsigned
long
)
(
*
srt
)
&
~
0x1
),
c
,
c_child_r
);
...
...
rts/RtsDllMain.c
View file @
5872bf59
...
...
@@ -16,7 +16,7 @@
#endif
/* I'd be mildly surprised if this wasn't defined, but still. */
#if defined(
__PIC__) && defined(mingw32_HOST_OS
)
#if defined(
COMPILING_WINDOWS_DLL
)
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstance
STG_UNUSED
...
...
@@ -40,4 +40,4 @@ DllMain ( HINSTANCE hInstance STG_UNUSED
return
TRUE
;
}
#endif
/* defined(__PIC__) && defined(mingw32_HOST_OS) */
#endif
rts/RtsDllMain.h
View file @
5872bf59
...
...
@@ -6,7 +6,7 @@
#endif
/* I'd be mildly surprised if this wasn't defined, but still. */
#if defined(
__PIC__) && defined(mingw32_HOST_OS
)
#if defined(
COMPILING_WINDOWS_DLL
)
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstance
...
...
rts/StgMiscClosures.cmm
View file @
5872bf59
...
...
@@ -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
)
&&
defined
(
i386_HOST_ARCH
)
#if
defined
(
COMPILING_WINDOWS_DLL
)
/*
* 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
)
&&
defined
(
i386_HOST_ARCH
))
#if
!
(
defined
(
COMPILING_WINDOWS_DLL
))
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) && defined(i386_HOST_ARCH))
#endif
rts/ghc.mk
View file @
5872bf59
...
...
@@ -134,6 +134,12 @@ rts_dist_$1_HC_OPTS = $$(GhcRtsHcOpts)
rts_dist_$1_CC_OPTS
=
$
$(GhcRtsCcOpts)
endif
ifneq
"$$(findstring dyn, $1)" ""
ifeq
"$$(HostOS_CPP)" "mingw32"
rts_dist_$1_CC_OPTS
+=
-DCOMPILING_WINDOWS_DLL
endif
endif
ifneq
"$$(findstring thr, $1)" ""
rts_$1_EXTRA_C_SRCS
=
rts/dist/build/sm/Evac_thr.c rts/dist/build/sm/Scav_thr.c
endif
...
...
rts/sm/Evac.c
View file @
5872bf59
...
...
@@ -555,7 +555,7 @@ loop:
//
case
CONSTR_0_1
:
{
#if defined(
__PIC__) && defined(mingw32_HOST_OS)
#if defined(
COMPILING_WINDOWS_DLL)
copy_tag_nolock
(
p
,
info
,
q
,
sizeofW
(
StgHeader
)
+
1
,
gen_no
,
tag
);
#else
StgWord
w
=
(
StgWord
)
q
->
payload
[
0
];
...
...
rts/sm/Scav.c
View file @
5872bf59
...
...
@@ -313,7 +313,7 @@ scavenge_srt (StgClosure **srt, nat srt_bitmap)
while
(
bitmap
!=
0
)
{
if
((
bitmap
&
1
)
!=
0
)
{
#if defined(
__PIC__) && defined(mingw32_HOST_OS
)
#if defined(
COMPILING_WINDOWS_DLL
)
// Special-case to handle references to closures hiding out in DLLs, since
// double indirections required to get at those. The code generator knows
// which is which when generating the SRT, so it stores the (indirect)
...
...
rts/win32/ThrIOManager.c
View file @
5872bf59
...
...
@@ -152,7 +152,7 @@ ioManagerStart (void)
Capability
*
cap
;
if
(
io_manager_event
==
INVALID_HANDLE_VALUE
)
{
cap
=
rts_lock
();
#if defined(
mingw32_HOST_OS) && defined(i386_HOST_ARCH) && defined(__PIC__
)
#if defined(
COMPILING_WINDOWS_DLL
)
rts_evalIO
(
&
cap
,
_imp__base_GHCziConcziIO_ensureIOManagerIsRunning_closure
,
NULL
);
#else
rts_evalIO
(
&
cap
,
&
base_GHCziConcziIO_ensureIOManagerIsRunning_closure
,
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment