From 525ba87b2f167350a622d9c997f5ea48ced65b52 Mon Sep 17 00:00:00 2001 From: Steven Bellock Date: Sun, 29 Sep 2024 14:27:34 -0700 Subject: [PATCH] Remove cast-align for RISC-V Fix #2836. Signed-off-by: Steven Bellock --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12c70a92cb2..92a9789db87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,7 +215,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(TOOLCHAIN STREQUAL "GCC") set(CMAKE_C_COMPILER gcc) - add_compile_options(-std=c99 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -Wno-address -fpie -fno-asynchronous-unwind-tables -DUSING_LTO -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare -Werror-implicit-function-declaration -Wcast-qual -Wcast-align) + add_compile_options(-std=c99 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -Wno-address -fpie -fno-asynchronous-unwind-tables -DUSING_LTO -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare -Werror-implicit-function-declaration -Wcast-qual) + if (NOT ARCH STREQUAL "riscv32" AND "riscv64") + add_compile_options(-Wcast-align) + endif() if (ARCH STREQUAL "x64") add_compile_options(-mno-red-zone) endif()