aarch64/bcopy: use only aligned accesses to memory
@@ -11,6 +11,13 @@ CLANG_ABIFLAGS := -target aarch64-elf
ELFTYPE := elf64-littleaarch64
ELFARCH := aarch64
+# NOTE(pj): We set A, SA, SA0 bits for SCTLR_EL1 register (sys/aarch64/boot.c)
+# as a result not aligned access to memory causes an exception. It's okay but
+# user-space (taken from NetBSD) doesn't care about that by default. It
+# requies STRICT_ALIGNMENT to be defined. It's also important for the kernel
+# because we share bcopy (memcpy) implementation with user-space.
+CPPFLAGS += -DSTRICT_ALIGNMENT=1
+
ifeq ($(KERNEL), 1)
CFLAGS += -mcpu=cortex-a53+nofp -march=armv8-a+nofp -mgeneral-regs-only
ifeq ($(KASAN), 1)
