board: Remove -fno-omit-frame-pointer from Make.defs

except sim arch, since this flag is set inside Toolschain.defs now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-01-20 01:51:55 +08:00 committed by Petro Karashchenko
parent c5c50acb93
commit 04297c3ca3
9 changed files with 33 additions and 14 deletions

View file

@ -88,7 +88,7 @@ Creating the project
include(cmake/stm32f4discovery.cmake)
set(AC_COMMON_FLAGS "${AC_COMMON_FLAGS} -fno-builtin -Wall -Wshadow -Wundef -fno-strict-aliasing -fomit-frame-pointer -Os")
set(AC_COMMON_FLAGS "${AC_COMMON_FLAGS} -fno-builtin -Wall -Wshadow -Wundef -fno-strict-aliasing -Os")
set(AC_COMMON_FLAGS "${AC_COMMON_FLAGS} -D_DEBUG -D_LIBCPP_BUILD_STATIC -D_LIBCPP_NO_EXCEPTIONS ")
set(AC_COMMON_FLAGS "${AC_COMMON_FLAGS} -fno-exceptions -fcheck-new -fno-rtti -pedantic ")
set(AC_COMMON_FLAGS "${AC_COMMON_FLAGS} -nostdinc++")

View file

@ -78,3 +78,9 @@ ifeq ($(CONFIG_SPARC_TOOLCHAIN),CODEREDW)
LDFLAGS += -nostartfiles -nodefaultlibs
LDSCRIPT = sparc-elf-debug.ld
endif
ifeq ($(CONFIG_FRAME_POINTER),y)
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
MAXOPTIMIZATION += -fomit-frame-pointer
endif

View file

@ -45,8 +45,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif
ARCHCPUFLAGS += -mno-relax
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-omit-frame-pointer
ARCHCXXFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-omit-frame-pointer -fno-exceptions -fcheck-new -std=c++17 -D__NuttX__ -pipe -nostdinc++
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
ARCHCXXFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-exceptions -fcheck-new -std=c++17 -D__NuttX__ -pipe -nostdinc++
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10

View file

@ -52,7 +52,7 @@ endif
ARCHCPUFLAGS += -mcmodel=medany
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-omit-frame-pointer
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef

View file

@ -57,7 +57,7 @@ endif
ARCHCPUFLAGS += -mcmodel=medany
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-omit-frame-pointer
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef

View file

@ -52,7 +52,7 @@ endif
ARCHCPUFLAGS += -mcmodel=medany
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections -fno-omit-frame-pointer
ARCHCFLAGS = -fno-builtin -ffunction-sections -fdata-sections
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef

View file

@ -134,16 +134,24 @@ ifeq ($(CONFIG_LIBCXX),y)
endif
ifeq ($(CONFIG_SIM_ASAN),y)
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
CFLAGS += -fsanitize=address
CXXFLAGS += -fsanitize=address
else ifeq ($(CONFIG_MM_KASAN),y)
CFLAGS += -fsanitize=kernel-address
CXXFLAGS += -fsanitize=kernel-address
endif
ifeq ($(CONFIG_SIM_UBSAN),y)
CFLAGS += -fsanitize=undefined -fno-omit-frame-pointer
CXXFLAGS += -fsanitize=undefined -fno-omit-frame-pointer
CFLAGS += -fsanitize=undefined
CXXFLAGS += -fsanitize=undefined
endif
ifeq ($(CONFIG_FRAME_POINTER),y)
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
CXXFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
CFLAGS += -fomit-frame-pointer
CXXFLAGS += -fomit-frame-pointer
endif
# Loadable module definitions
@ -210,15 +218,20 @@ ifeq ($(CONFIG_SIM_M32),y)
endif
ifeq ($(CONFIG_SIM_ASAN),y)
CCLINKFLAGS += -fsanitize=address -fno-omit-frame-pointer
CCLINKFLAGS += -fsanitize=address
else ifeq ($(CONFIG_MM_KASAN),y)
CCLINKFLAGS += -fsanitize=kernel-address
endif
ifeq ($(CONFIG_SIM_UBSAN),y)
CCLINKFLAGS += -fsanitize=undefined -fno-omit-frame-pointer
CCLINKFLAGS += -fsanitize=undefined
endif
ifeq ($(CONFIG_FRAME_POINTER),y)
CCLINKFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
CCLINKFLAGS += -fomit-frame-pointer
endif
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(HOSTINCLUDES) $(EXTRAFLAGS) -D__SIM__ -pipe

View file

@ -55,7 +55,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
endif
ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fomit-frame-pointer
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif
# ARCHOPTIMIZATION += -fno-zero-initialized-in-bss

View file

@ -55,7 +55,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
endif
ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fomit-frame-pointer
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif
# ARCHOPTIMIZATION += -fno-zero-initialized-in-bss