From 5af932f6e7882874791f6fe7fa60927f11654671 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Mon, 15 Aug 2022 22:44:06 +0900 Subject: [PATCH] cmake: Set GCC min-pagesize parameter to 0 GCC 11 and above may generate a warning when dereferencing a constant address pointer whose address is below the value specified by the `min-pagesize` parameter. This commit sets the `min-pagesize` parameter to 0 such that GCC never generates the warnings for any constant address pointers. For more details, refer to the GCC PR99578. Signed-off-by: Stephanos Ioannidis --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4f2e6a41ad..ef654819a23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,6 +383,13 @@ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") # GCC assumed zephyr_cc_option(-fno-reorder-functions) + # GCC 11 and above may generate a warning when dereferencing a constant + # address pointer whose address is below the value specified by the + # `min-pagesize` parameter (defaults to 0x1000). The `min-pagesize` parameter + # is set to 0 such that GCC never generates any warnings for the constant + # address pointers. For more details, refer to the GCC PR99578. + zephyr_cc_option(--param=min-pagesize=0) + if(NOT ${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "xcc") zephyr_cc_option(-fno-defer-pop) endif()