Index: ubuntu/compiler/typecheck/TcForeign.lhs
===================================================================
--- ubuntu.orig/compiler/typecheck/TcForeign.lhs	2011-01-13 10:50:13.220639888 +0000
+++ ubuntu/compiler/typecheck/TcForeign.lhs	2011-01-13 10:50:17.020935631 +0000
@@ -30,10 +30,6 @@
 import ForeignCall
 import ErrUtils
 import Id
-#if alpha_TARGET_ARCH
-import Type
-import SMRep
-#endif
 import Name
 import TcType
 import DynFlags
@@ -113,7 +109,6 @@
         [arg1_ty] -> do checkForeignArgs isFFIExternalTy arg1_tys
                         checkForeignRes nonIOok  isFFIExportResultTy res1_ty
                         checkForeignRes mustBeIO isFFIDynResultTy    res_ty
-                        checkFEDArgs arg1_tys
                   where
                      (arg1_tys, res1_ty) = tcSplitFunTys arg1_ty
         _ -> addErrTc (illegalForeignTyErr empty sig_ty)
@@ -173,30 +168,8 @@
   = addWarn (ptext (sLit "possible missing & in foreign import of FunPtr"))
   | otherwise
   = return ()
-\end{code}
-
-On an Alpha, with foreign export dynamic, due to a giant hack when
-building adjustor thunks, we only allow 4 integer arguments with
-foreign export dynamic (i.e., 32 bytes of arguments after padding each
-argument to a quadword, excluding floating-point arguments).
-
-The check is needed for both via-C and native-code routes
-
-\begin{code}
 #include "nativeGen/NCG.h"
 
-checkFEDArgs :: [Type] -> TcM ()
-#if alpha_TARGET_ARCH
-checkFEDArgs arg_tys
-  = check (integral_args <= 32) err
-  where
-    integral_args = sum [ (widthInBytes . argMachRep . primRepToCgRep) prim_rep
-			| prim_rep <- map typePrimRep arg_tys,
-			  primRepHint prim_rep /= FloatHint ]
-    err = ptext (sLit "On Alpha, I can only handle 32 bytes of non-floating-point arguments to foreign export dynamic")
-#else
-checkFEDArgs _ = return ()
-#endif
 \end{code}
 
 
Index: ubuntu/rts/eventlog/EventLog.c
===================================================================
--- ubuntu.orig/rts/eventlog/EventLog.c	2011-01-13 10:50:13.200638329 +0000
+++ ubuntu/rts/eventlog/EventLog.c	2011-01-13 10:50:17.020935631 +0000
@@ -83,7 +83,7 @@
 
 static void postEventType(EventsBuf *eb, EventType *et);
 
-static void postLogMsg(EventsBuf *eb, EventTypeNum type, char *msg, va_list ap);
+static void postLogMsg(EventsBuf *eb, EventTypeNum type, char *msg, va_list *ap);
 
 static void postBlockMarker(EventsBuf *eb);
 static void closeBlockMarker(EventsBuf *ebuf);
@@ -399,12 +399,16 @@
 
 #define BUF 512
 
-void postLogMsg(EventsBuf *eb, EventTypeNum type, char *msg, va_list ap)
+void postLogMsg(EventsBuf *eb, EventTypeNum type, char *msg, va_list *ap)
 {
     char buf[BUF];
     nat size;
 
-    size = vsnprintf(buf,BUF,msg,ap);
+    if (ap != NULL)
+        size = vsnprintf(buf,BUF,msg,*ap);
+    else
+        size = snprintf(buf,BUF,msg);
+
     if (size > BUF) {
         buf[BUF-1] = '\0';
         size = BUF;
@@ -423,13 +427,13 @@
 void postMsg(char *msg, va_list ap)
 {
     ACQUIRE_LOCK(&eventBufMutex);
-    postLogMsg(&eventBuf, EVENT_LOG_MSG, msg, ap);
+    postLogMsg(&eventBuf, EVENT_LOG_MSG, msg, &ap);
     RELEASE_LOCK(&eventBufMutex);
 }
 
 void postCapMsg(Capability *cap, char *msg, va_list ap)
 {
-    postLogMsg(&capEventBuf[cap->no], EVENT_LOG_MSG, msg, ap);
+    postLogMsg(&capEventBuf[cap->no], EVENT_LOG_MSG, msg, &ap);
 }
 
 void postUserMsg(Capability *cap, char *msg, va_list ap)
Index: ubuntu/rts/Trace.c
===================================================================
--- ubuntu.orig/rts/Trace.c	2011-01-13 10:50:13.210639103 +0000
+++ ubuntu/rts/Trace.c	2011-01-13 10:50:17.020935631 +0000
@@ -218,13 +218,16 @@
 }
 
 #ifdef DEBUG
-static void traceCap_stderr(Capability *cap, char *msg, va_list ap)
+static void traceCap_stderr(Capability *cap, char *msg, va_list *ap)
 {
     ACQUIRE_LOCK(&trace_utx);
 
     tracePreface();
     debugBelch("cap %2d: ", cap->no);
-    vdebugBelch(msg,ap);
+    if(ap != NULL)
+        vdebugBelch(msg,*ap);
+    else
+        debugBelch("\n");
     debugBelch("\n");
 
     RELEASE_LOCK(&trace_utx);
@@ -238,7 +241,7 @@
     
 #ifdef DEBUG
     if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
-        traceCap_stderr(cap, msg, ap);
+        traceCap_stderr(cap, msg, &ap);
     } else
 #endif
     {
