Description: patch nursery to adhere to armhf float alignment requirements
Bug: https://github.com/perl6/nqp/issues/431
Author: Robert Lemmen <robertle@semistable.com>
--- a/src/gc/allocation.c
+++ b/src/gc/allocation.c
@@ -19,6 +19,10 @@ void * MVM_gc_allocate_nursery(MVMThreadContext *tc, size_t size) {
 
     /* Guard against 0-byte allocation. */
     if (size > 0) {
+#if !defined(MVM_CAN_UNALIGNED_INT64) || !defined(MVM_CAN_UNALIGNED_NUM64)
+        /* Round up size to next multiple of 8, to ensure alignment. */
+        size = (size + 7) & ~7;
+#endif
         /* Do a GC run if this allocation won't fit in what we have
          * left in the nursery. Note this is a loop to handle a
          * pathological case: all the objects in the nursery are very
--- a/src/gc/collect.c
+++ b/src/gc/collect.c
@@ -310,7 +310,12 @@ static void process_worklist(MVMThreadContext *tc, MVMGCWorklist *worklist, Work
                 /* No, so it will live in the nursery for another GC
                  * iteration. Allocate space in the nursery. */
                 new_addr = (MVMCollectable *)tc->nursery_alloc;
+#if !defined(MVM_CAN_UNALIGNED_INT64) || !defined(MVM_CAN_UNALIGNED_NUM64)
+                /* Round up size to next multiple of 8, see MVM_gc_allocate_nursery */
+                tc->nursery_alloc = (char *)tc->nursery_alloc + ((item->size + 7) & ~7);
+#else
                 tc->nursery_alloc = (char *)tc->nursery_alloc + item->size;
+#endif
                 GCDEBUG_LOG(tc, MVM_GC_DEBUG_COLLECT, "Thread %d run %d : copying an object %p (reprid %d) of size %d to tospace %p\n",
                     item, REPR(item)->ID, item->size, new_addr);
 
@@ -615,7 +620,12 @@ void MVM_gc_collect_free_nursery_uncopied(MVMThreadContext *tc, void *limit) {
         }
 
         /* Go to the next item. */
+#if !defined(MVM_CAN_UNALIGNED_INT64) || !defined(MVM_CAN_UNALIGNED_NUM64)
+        /* Round up size to next multiple of 8, see MVM_gc_allocate_nursery */
+        scan = (char *)scan + ((item->size + 7) & ~7);
+#else
         scan = (char *)scan + item->size;
+#endif
     }
 }
