diff --git a/Meta/CMake/serenity_compile_options.cmake b/Meta/CMake/serenity_compile_options.cmake index 603e4664e3..849a11e8e5 100644 --- a/Meta/CMake/serenity_compile_options.cmake +++ b/Meta/CMake/serenity_compile_options.cmake @@ -52,3 +52,10 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$") # Clang doesn't add compiler_rt to the search path when compiling with -nostdlib. link_directories(${TOOLCHAIN_ROOT}/lib/clang/${CMAKE_CXX_COMPILER_VERSION}/lib/${SERENITY_ARCH}-pc-serenity/) endif() + +if ("${SERENITY_ARCH}" STREQUAL "aarch64") + # Unaligned memory access will cause a trap, so to make sure the compiler doesn't generate + # those unaligned accesses, the strict-align flag is added. + # FIXME: Remove -Wno-cast-align when we are able to build everything without this warning turned on. + add_compile_options(-mstrict-align -Wno-cast-align) +endif()