Change the judgment of GCCVER version to greater equal.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei 2024-10-14 14:23:57 +08:00 committed by GUIDINGLI
parent ae126a8065
commit 9d9857acd2
3 changed files with 3 additions and 3 deletions

View file

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

View file

@ -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

View file

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