mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
Meta: Disable -Wcast-align
warning on RISC-V
Also explicitly specify `-mstrict-align` (The current default `-mcpu` on gcc doesn't support unaligned accesses, so aligned memory accesses are already implicitly required). The `-Wcast-align` warning seems to oversensitive as it flags code like this: https://godbolt.org/z/c8481o8aa This used to be added for aarch64 ina473cfd71b
, but was later removed in11896868d6
.
This commit is contained in:
parent
7768f97333
commit
f04a2b81be
1 changed files with 6 additions and 0 deletions
|
@ -46,3 +46,9 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
|
|||
link_directories(${TOOLCHAIN_ROOT}/lib/clang/${LLVM_MAJOR_VERSION}/lib/${SERENITY_ARCH}-pc-serenity/)
|
||||
endif()
|
||||
|
||||
if ("${SERENITY_ARCH}" STREQUAL "riscv64")
|
||||
# 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()
|
||||
|
|
Loading…
Reference in a new issue