simonmar:
> Looking back through the mail archives, these errors started occurring
> on 11 March:
> 
>   http://www.haskell.org//pipermail/cvs-ghc/2005-March/023893.html
> 
> And the most likely breaking commit is this one:
> 
>   http://www.haskell.org//pipermail/cvs-ghc/2005-March/023883.html
> 
> What's strange is that this commit has been merged into STABLE, but
> you're not seeing any breakage on STABLE.

Looks like it was the change pushing the obscure_ccall code into
inline assembly. Reverting this for  OpenBSD only (so its allocated RWX
once at startup) fixes the problems. This also explains why stable 
didn't break -- the inline asm change isn't in stable. 
I'll do some more testing, though.


--- /home/dons/head-gcc3/fptools/ghc/rts/Adjustor.c     Wed Mar 16 19:01:28 2005
+++ ./Adjustor.c        Fri Jul  1 14:19:16 2005
@@ -122,6 +122,7 @@
   returning in some static piece of memory and arrange
   to return to it before tail jumping from the adjustor thunk.
 */
+#if !defined(openbsd_HOST_OS)
 __asm__ (
    ".globl " UNDERSCORE "obscure_ccall_ret_code\n"
    UNDERSCORE "obscure_ccall_ret_code:\n\t"
@@ -129,8 +130,14 @@
    "ret"
   );
 extern void obscure_ccall_ret_code(void);
+
+#else /* defined(openbsd_HOST_OS) */
+/* allocated dynamically, so we can set the permissions */
+static unsigned char *obscure_ccall_ret_code;
 #endif
 
+#endif /* i386 */
+
 #if defined(x86_64_HOST_ARCH)
 __asm__ (
    ".globl " UNDERSCORE "obscure_ccall_ret_code\n"
@@ -1063,4 +1070,14 @@
 void
 initAdjustor(void)
 {
+#if defined(i386_HOST_ARCH) && defined(openbsd_HOST_OS)
+       obscure_ccall_ret_code = mallocBytesRWX(4);
+
+       obscure_ccall_ret_code[0x00] = (unsigned char)0x83;  /* addl $0x4,
+                                                           %esp */
+       obscure_ccall_ret_code[0x01] = (unsigned char)0xc4;
+       obscure_ccall_ret_code[0x02] = (unsigned char)0x04;
+
+       obscure_ccall_ret_code[0x03] = (unsigned char)0xc3;  /* ret */
+#endif
 }


_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to