1
0
Fork 0
forked from nuttx/nuttx-update

nuttx: Fix build warning with can't found xt-g++

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei 2024-10-29 15:52:02 +08:00 committed by Xiang Xiao
parent 62194400f9
commit d42f16939e
7 changed files with 46 additions and 34 deletions

View file

@ -57,7 +57,7 @@ set(NO_LTO "-fno-lto")
# array subscript [0] is outside array bounds:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
if(CONFIG_ARCH_TOOLCHAIN_GNU)
if(CONFIG_ARCH_TOOLCHAIN_GNU AND NOT CONFIG_ARCH_TOOLCHAIN_CLANG)
execute_process(COMMAND ${CMAKE_C_COMPILER} --version
OUTPUT_VARIABLE GCC_VERSION_OUTPUT)
string(REGEX MATCH "([0-9]+)\\.[0-9]+" GCC_VERSION_REGEX

View file

@ -312,6 +312,7 @@ else
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
ifeq ($(GCCVER),)
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
endif
@ -324,6 +325,7 @@ else
endif
endif
endif
endif
LDFLAGS += --entry=__start
LDFLAGS += --print-memory-usage

View file

@ -189,6 +189,7 @@ ifeq ($(CONFIG_LTO_FULL),y)
endif
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
ifeq ($(GCCVER),)
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
endif
@ -198,6 +199,7 @@ ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
LDFLAGS += --print-memory-usage
endif
endif
# Add the builtin library

View file

@ -189,7 +189,7 @@ if(CONFIG_DEBUG_SYMBOLS)
add_compile_options(${CONFIG_DEBUG_SYMBOLS_LEVEL})
endif()
if(CONFIG_ARCH_TOOLCHAIN_GNU)
if(CONFIG_ARCH_TOOLCHAIN_GNU AND NOT CONFIG_ARCH_TOOLCHAIN_CLANG)
if(NOT GCCVER)
execute_process(COMMAND ${CMAKE_C_COMPILER} --version
OUTPUT_VARIABLE GCC_VERSION_OUTPUT)

View file

@ -209,10 +209,6 @@ ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
ARCHCPUEXTFLAGS := $(ARCHCPUEXTFLAGS)v
endif
ifeq ($(GCCVER),)
export GCCVER = ${shell $(CROSSDEV)gcc --version | grep gcc | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | tail -n 1 | cut -d"." -f1 }
endif
ifeq ($(CONFIG_ARCH_RV_ISA_ZICSR_ZIFENCEI),y)
ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
ARCHCPUEXTFLAGS := $(ARCHCPUEXTFLAGS)_zicsr_zifencei
@ -385,6 +381,14 @@ else
LDFLAGS += --print-memory-usage
endif
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
ifeq ($(GCCVER),)
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
endif
endif
endif
# Add the builtin library
COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)

View file

@ -111,12 +111,6 @@ ifneq ($(CONFIG_LIBCXXTOOLCHAIN),y)
ARCHCXXFLAGS += -nostdinc++
endif
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(GCCVER),)
export GCCVER = $(shell $(CXX) --version | grep ++ | sed -E 's/.* ([0-9]+\.[0-9]+).*/\1/' | cut -d'.' -f1)
endif
endif
ifneq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
ARCHCFLAGS += -Wno-psabi
ARCHCXXFLAGS += -Wno-psabi
@ -185,6 +179,14 @@ NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
ifeq ($(GCCVER),)
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
endif
endif
endif
# Add the builtin library
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name))

View file

@ -115,12 +115,6 @@ ifneq ($(CONFIG_LIBCXXTOOLCHAIN),y)
ARCHCXXFLAGS += -nostdinc++
endif
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(GCCVER),)
export GCCVER = $(shell $(CXX) --version | grep ++ | sed -E 's/.* ([0-9]+\.[0-9]+).*/\1/' | cut -d'.' -f1)
endif
endif
ifneq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
ARCHCFLAGS += -Wno-psabi
ARCHCXXFLAGS += -Wno-psabi
@ -189,6 +183,14 @@ NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GNU),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),)
ifeq ($(GCCVER),)
export GCCVER := $(shell $(CC) --version | grep gcc | sed -E "s/.* ([0-9]+\.[0-9]+).*/\1/" | cut -d'.' -f1)
endif
endif
endif
# Add the builtin library
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name))