Index: rts/sm/HeapAlloc.h
--- rts/sm/HeapAlloc.h.orig
+++ rts/sm/HeapAlloc.h
@@ -10,6 +10,14 @@
 
 #include "BeginPrivate.h"
 
+#if defined(THREADED_RTS)
+// needed for HEAP_ALLOCED below
+extern SpinLock gc_alloc_block_sync;
+#endif
+
+#define ACQUIRE_ALLOC_BLOCK_SPIN_LOCK() ACQUIRE_SPIN_LOCK(&gc_alloc_block_sync)
+#define RELEASE_ALLOC_BLOCK_SPIN_LOCK() RELEASE_SPIN_LOCK(&gc_alloc_block_sync)
+
 /* -----------------------------------------------------------------------------
    The HEAP_ALLOCED() test.
 
