openbsd-ports/lang/ghc/patches/patch-rts_Adjustor_c
kili 87a3f71582 Update to 6.6.1. With helpful hints from Don Stewart and espie@.
Thanks to all the testers and to steven@, who was so kind to
build the HC files for bootstrapping on amd64.
2007-07-21 17:14:57 +00:00

52 lines
1.6 KiB
Plaintext

$OpenBSD: patch-rts_Adjustor_c,v 1.1 2007/07/21 17:14:58 kili Exp $
--- rts/Adjustor.c.orig Wed Apr 25 19:10:41 2007
+++ rts/Adjustor.c Thu May 31 22:08:54 2007
@@ -85,12 +85,8 @@ static void GNUC3_ATTRIBUTE(used) obscure_ccall_wrapp
}
extern void obscure_ccall_ret_code(void);
-#if defined(openbsd_HOST_OS)
-static unsigned char *obscure_ccall_ret_code_dyn;
#endif
-#endif
-
#if defined(x86_64_HOST_ARCH)
static void GNUC3_ATTRIBUTE(used) obscure_ccall_wrapper(void)
{
@@ -324,11 +320,7 @@ createAdjustor(int cconv, StgStablePtr hptr,
adj_code[0x0a] = (unsigned char)0x68; /* pushl obscure_ccall_ret_code */
*((StgFunPtr*)(adj_code + 0x0b)) =
-#if !defined(openbsd_HOST_OS)
(StgFunPtr)obscure_ccall_ret_code;
-#else
- (StgFunPtr)obscure_ccall_ret_code_dyn;
-#endif
adj_code[0x0f] = (unsigned char)0xff; /* jmp *%eax */
adj_code[0x10] = (unsigned char)0xe0;
@@ -1100,22 +1092,4 @@ if ( *(unsigned char*)ptr != 0xe8 ) {
*((unsigned char*)ptr) = '\0';
freeExec(ptr);
-}
-
-
-/*
- * Function: initAdjustor()
- *
- * Perform initialisation of adjustor thunk layer (if needed.)
- */
-void
-initAdjustor(void)
-{
-#if defined(i386_HOST_ARCH) && defined(openbsd_HOST_OS)
- obscure_ccall_ret_code_dyn = allocateExec(4);
- obscure_ccall_ret_code_dyn[0] = ((unsigned char *)obscure_ccall_ret_code)[0];
- obscure_ccall_ret_code_dyn[1] = ((unsigned char *)obscure_ccall_ret_code)[1];
- obscure_ccall_ret_code_dyn[2] = ((unsigned char *)obscure_ccall_ret_code)[2];
- obscure_ccall_ret_code_dyn[3] = ((unsigned char *)obscure_ccall_ret_code)[3];
-#endif
}