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