From d1d270917745c29c03ce08c4a17b73969b1ee06a Mon Sep 17 00:00:00 2001 From: guoshichao Date: Mon, 14 Oct 2024 22:00:09 +0800 Subject: [PATCH] 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 --- boards/arm/mps/mps2-an500/scripts/Make.defs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/boards/arm/mps/mps2-an500/scripts/Make.defs b/boards/arm/mps/mps2-an500/scripts/Make.defs index 84f445475f..f33d6fb03d 100644 --- a/boards/arm/mps/mps2-an500/scripts/Make.defs +++ b/boards/arm/mps/mps2-an500/scripts/Make.defs @@ -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