Kernel/aarch64: Add -mstrict-align flag to Kernel build

The ARM CPU is set up to trap on unaligned accesses, however the
compiler will still generate them if this flag is not set. We also need
the -Wno-cast-align as there are some files in AK that don't build
without the flag.
This commit is contained in:
Timon Kruiper 2022-12-20 19:49:35 +01:00 committed by Sam Atkins
parent 0226390b21
commit a473cfd71b
Notes: sideshowbarker 2024-07-17 10:31:19 +09:00

View file

@ -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)