From fafcf2a0935449e1d372655c96d5c6cdb43791a2 Mon Sep 17 00:00:00 2001 From: cuiziwei Date: Mon, 14 Oct 2024 14:23:57 +0800 Subject: [PATCH] Change the judgment of GCCVER version to greater equal. Signed-off-by: cuiziwei --- arch/arm/src/cmake/gcc.cmake | 2 +- arch/arm/src/common/Toolchain.defs | 2 +- libs/libxx/libcxx.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/cmake/gcc.cmake b/arch/arm/src/cmake/gcc.cmake index 1a4414314403b..e4e91e3198623 100644 --- a/arch/arm/src/cmake/gcc.cmake +++ b/arch/arm/src/cmake/gcc.cmake @@ -68,7 +68,7 @@ string(REGEX MATCH "\\+\\+.* ([0-9]+)\\.[0-9]+" GCC_VERSION_REGEX "${GCC_VERSION_OUTPUT}") set(GCCVER ${CMAKE_MATCH_1}) -if(GCCVER EQUAL 12) +if(GCCVER GREATER_EQUAL 12) add_compile_options(--param=min-pagesize=0) if(CONFIG_ARCH_RAMFUNCS) add_link_options(-Wl,--no-warn-rwx-segments) diff --git a/arch/arm/src/common/Toolchain.defs b/arch/arm/src/common/Toolchain.defs index 7c3e01082c434..acc943434e80c 100644 --- a/arch/arm/src/common/Toolchain.defs +++ b/arch/arm/src/common/Toolchain.defs @@ -309,7 +309,7 @@ else # Wrong warning array subscript [0] is outside array bounds: # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 - ifeq ($(GCCVER),12) + ifeq ($(shell expr $(GCCVER) \>= 12), 1) ARCHOPTIMIZATION += --param=min-pagesize=0 ifeq ($(CONFIG_ARCH_RAMFUNCS),y) LDFLAGS += --no-warn-rwx-segments diff --git a/libs/libxx/libcxx.cmake b/libs/libxx/libcxx.cmake index 7eaa6739584ed..62f9e6d9b029f 100644 --- a/libs/libxx/libcxx.cmake +++ b/libs/libxx/libcxx.cmake @@ -95,7 +95,7 @@ list(APPEND SRCS ${SRCSTMP}) set(FLAGS -Wno-attributes -Wno-deprecated-declarations -Wno-shadow -Wno-sign-compare) -if(GCCVER EQUAL 12) +if(GCCVER GREATER_EQUAL 12) list(APPEND FLAGS -Wno-maybe-uninitialized -Wno-alloc-size-larger-than) endif()