Fix stg_block_async on unreg compilers
authorIan Lynagh <igloo@earth.li>
Thu, 15 Mar 2012 15:07:59 +0000 (15:07 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 15 Mar 2012 15:57:13 +0000 (15:57 +0000)
This is only defined on Windows, so hadn't come up in our Linux
unreg builds.

rts/HeapStackCheck.cmm
rts/ghc.mk

index 74545af..7ba44d3 100644 (file)
@@ -679,10 +679,16 @@ INFO_TABLE_RET( stg_block_async, RET_SMALL, W_ unused )
     len = StgAsyncIOResult_len(ares);
     errC = StgAsyncIOResult_errCode(ares);
     foreign "C" free(ares "ptr");
+#ifdef GhcUnregisterised
+    Sp(1) = errC;
+    Sp(0) = len;
+    jump %ENTRY_CODE(Sp(2));
+#else
     R1 = len;
     Sp_adj(1);
     Sp(0) = errC;
     jump %ENTRY_CODE(Sp(1));
+#endif
 }
 
 stg_block_async
index fc634c7..99b917c 100644 (file)
@@ -311,6 +311,10 @@ rts/RtsUtils_CC_OPTS += -DTargetVendor=\"$(TargetVendor_CPP)\"
 rts/RtsUtils_CC_OPTS += -DGhcUnregisterised=\"$(GhcUnregisterised)\"
 rts/RtsUtils_CC_OPTS += -DGhcEnableTablesNextToCode=\"$(GhcEnableTablesNextToCode)\"
 
+ifeq "$(GhcUnregisterised)" "YES"
+rts/HeapStackCheck_HC_OPTS += -DGhcUnregisterised=1
+endif
+
 # Compile various performance-critical pieces *without* -fPIC -dynamic
 # even when building a shared library.  If we don't do this, then the
 # GC runs about 50% slower on x86 due to the overheads of PIC.  The