toolchain/ghs: Fix green hills toolchain build Vela warnings

ccarm: Warning: Option "-fomit-frame-pointer" not supported in this product
ccarm: Warning: Unknown option "-Wno-cpp" ignored.  Did you mean "--nocpp"?
ccarm: Warning: Unknown option "-pipe" passed to linker
ccarm: Warning: Unknown option "-Wno-psabi" ignored.  Did you mean "-Wno-convert64"?
ccarm: Warning: Option "-fomit-frame-pointer" not supported in this product
ccarm: Warning: Unknown option "-Wno-cpp" ignored.  Did you mean "--nocpp"?
ccarm: Warning: Unknown option "-pipe" passed to linker
[asarm] (warning #2073) unknown option: -mimplicit-it=always
Warning: Unknown option "-pipe" passed to linker
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always
[asarm] (warning #2073) unknown option: -mthumb
[asarm] (warning #2073) unknown option: -mimplicit-it=always

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
This commit is contained in:
yanghuatao 2024-04-15 09:31:51 +08:00 committed by Xiang Xiao
parent 3bb30231a9
commit 33ddf1a297
3 changed files with 49 additions and 20 deletions

2
.gitignore vendored
View File

@ -1,5 +1,7 @@
*.a
*.adb
*.dba
*.dbo
*.asm
*.bin
*.d

View File

@ -117,7 +117,7 @@ ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),)
LDENDGROUP ?= -Wl,--end-group
LDFLAGS := $(addprefix -Xlinker ,$(LDFLAGS))
LDFLAGS += $(filter-out $(STRIPCFLAGS),$(CFLAGS))
else
else ifneq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
LDSTARTGROUP ?= --start-group
LDENDGROUP ?= --end-group
endif

View File

@ -47,7 +47,11 @@ endif
ifeq ($(CONFIG_FRAME_POINTER),y)
ARCHOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
ARCHOPTIMIZATION += -fomit-frame-pointer
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
ARCHOPTIMIZATION += -noga
else
ARCHOPTIMIZATION += -fomit-frame-pointer
endif
endif
ifeq ($(CONFIG_STACK_CANARIES),y)
@ -150,20 +154,24 @@ endif
ARCHCPUFLAGS += $(TOOLCHAIN_MARCH) $(TOOLCHAIN_MTUNE) $(TOOLCHAIN_MFLOAT)
ifeq ($(CONFIG_ARM_THUMB),y)
ARCHCPUFLAGS += -mthumb
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
ARCHCPUFLAGS += -thumb
else
ARCHCPUFLAGS += -mthumb
# GCC Manual:
# -mthumb
# ... If you want to force assembler files to be interpreted as Thumb
# code, either add a `.thumb' directive to the source or pass the
# -mthumb option directly to the assembler by prefixing it with -Wa.
# GCC Manual:
# -mthumb
# ... If you want to force assembler files to be interpreted as Thumb
# code, either add a `.thumb' directive to the source or pass the
# -mthumb option directly to the assembler by prefixing it with -Wa.
ARCHCPUFLAGS += -Wa,-mthumb
ARCHCPUFLAGS += -Wa,-mthumb
# Outputs an implicit IT block when there is a conditional instruction
# without an enclosing IT block.
# Outputs an implicit IT block when there is a conditional instruction
# without an enclosing IT block.
ARCHCPUFLAGS += -Wa,-mimplicit-it=always
ARCHCPUFLAGS += -Wa,-mimplicit-it=always
endif
endif
# Clang toolchain
@ -312,8 +320,13 @@ endif
# Architecture flags
ARCHCFLAGS += -Wstrict-prototypes -Wno-attributes -Wno-unknown-pragmas
ARCHCXXFLAGS += -Wno-attributes -Wno-unknown-pragmas
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
ARCHCFLAGS += -gcc -gnu99 -preprocess_assembly_files --diag_suppress=68,111,174,222,236,257,826,1143,1721
ARCHCXXFLAGS += --gnu_asm --diag_suppress=540,826
else
ARCHCFLAGS += -Wstrict-prototypes -Wno-attributes -Wno-unknown-pragmas
ARCHCXXFLAGS += -Wno-attributes -Wno-unknown-pragmas
endif
# When all C++ code is built using GCC 7.1 or a higher version,
# we can safely disregard warnings of the type "parameter passing for X changed in GCC 7.1."
@ -324,23 +337,37 @@ ifneq ($(CONFIG_LIBCXXTOOLCHAIN),y)
endif
ifneq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
ARCHCFLAGS += -Wno-psabi
ARCHCXXFLAGS += -Wno-psabi
ifneq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
ARCHCFLAGS += -Wno-psabi
ARCHCXXFLAGS += -Wno-psabi
endif
endif
ifneq ($(CONFIG_CXX_STANDARD),)
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
ARCHCXXFLAGS += --$(CONFIG_CXX_STANDARD)
else
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
endif
endif
ifneq ($(CONFIG_CXX_EXCEPTION),y)
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
ARCHCXXFLAGS += --no_exceptions -check=alloc
else
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
endif
endif
ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti
endif
ARCHOPTIMIZATION += -fno-common -Wall -Wshadow -Wundef
ifeq ($(CONFIG_ARM_TOOLCHAIN_GHS),y)
ARCHOPTIMIZATION += --no_commons
else
ARCHOPTIMIZATION += -fno-common
endif
ARCHOPTIMIZATION += -Wall -Wshadow -Wundef
ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y)
ARCHOPTIMIZATION += -nostdlib