diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 2f5400b3da..5b2f447e65 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -671,6 +671,10 @@ endif() if ("${SERENITY_ARCH}" STREQUAL "aarch64") add_compile_options(-fno-threadsafe-statics) + + # Unaligned memory access will cause a trap, so to make sure the compiler doesn't generate + # those unaligned accesses, this flag is added. + add_compile_options(-mstrict-align -Wno-cast-align) endif() add_compile_definitions(KERNEL)