ghs: fix the build warning with ghs compiler

the detailed warning info:
ccarm: Warning: Unknown option "-Wno-cpp" ignored.  Did you mean "--nocpp"?
ccarm: Warning: Unknown option "-pipe" passed to linker

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao 2024-10-14 22:00:09 +08:00 committed by Xiang Xiao
parent 632feb2b51
commit d1d2709177
1 changed files with 15 additions and 3 deletions

View File

@ -38,11 +38,23 @@ endif
ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES)
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
CFLAGS += $(subst -Wno-cpp,,$(EXTRAFLAGS))
endif
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES)
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
CXXFLAGS += $(subst -Wno-cpp,,$(EXTRAFLAGS))
endif
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES)
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
CPPFLAGS += $(subst -Wno-cpp,,$(EXTRAFLAGS))
else
CFLAGS += $(EXTRAFLAGS)
CPPFLAGS += $(EXTRAFLAGS)
endif
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
# NXFLAT module definitions