compile/flags: add FRAME_POINTER into Toolchain.defs
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
8eb999ff03
commit
a42aa8415d
8
Kconfig
8
Kconfig
@ -1919,6 +1919,14 @@ config DEBUG_SYMBOLS
|
||||
---help---
|
||||
Build with debug symbols (needed for use with a debugger).
|
||||
|
||||
config FRAME_POINTER
|
||||
bool "Compile the NuttX with frame pointers"
|
||||
default n
|
||||
---help---
|
||||
If you say Y here the resulting NuttX image will be slightly
|
||||
larger and slower, but it gives very useful debugging information
|
||||
in case of bugs.
|
||||
|
||||
endmenu # Debug Options
|
||||
|
||||
config ARCH_HAVE_CUSTOMOPT
|
||||
|
@ -67,6 +67,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# NuttX buildroot under Linux or Cygwin
|
||||
|
||||
ifeq ($(CONFIG_ARM_TOOLCHAIN),BUILDROOT)
|
||||
|
@ -61,6 +61,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# NuttX buildroot under Linux or Cygwin
|
||||
|
||||
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),BUILDROOT)
|
||||
|
@ -79,6 +79,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ENDIAN_BIG),y)
|
||||
TARGET_ARCH := armeb
|
||||
else
|
||||
|
@ -75,6 +75,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# Parametrization for ARCHCPUFLAGS
|
||||
|
||||
ifeq ($(CONFIG_ARCH_CORTEXM4),y)
|
||||
|
@ -61,6 +61,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ENDIAN_BIG),y)
|
||||
TARGET_ARCH := armeb
|
||||
else
|
||||
|
@ -75,6 +75,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# Parametrization for ARCHCPUFLAGS
|
||||
ifeq ($(CONFIG_ARCH_CORTEXM23),y)
|
||||
TOOLCHAIN_MTUNE := -mtune=cortex-m23
|
||||
|
@ -43,7 +43,7 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce
|
||||
ARCHOPTIMIZATION += -ffunction-sections -fdata-sections
|
||||
ifneq ($(CONFIG_ARMV8M_STACKCHECK),y)
|
||||
#ARCHOPTIMIZATION += -flto -fuse-linker-plugin
|
||||
|
@ -259,6 +259,12 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),PINGUINOW)
|
||||
LDSCRIPT = mips-elf-debug.ld
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# Default toolchain
|
||||
|
||||
CC = $(CROSSDEV)gcc
|
||||
|
@ -53,6 +53,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# Generic GNU RVG toolchain
|
||||
|
||||
ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
|
||||
|
@ -53,6 +53,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# Generic GNU RVG toolchain
|
||||
|
||||
ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
|
||||
|
@ -61,7 +61,7 @@ config SIM_CYGWIN_DECORATED
|
||||
config SIM_ASAN
|
||||
bool "Address Sanitizer"
|
||||
default n
|
||||
depends on MM_CUSTOMIZE_MANAGER
|
||||
depends on MM_CUSTOMIZE_MANAGER && FRAME_POINTER
|
||||
---help---
|
||||
AddressSanitizer (ASan) is a fast compiler-based tool for detecting memory
|
||||
bugs in native code.
|
||||
@ -69,6 +69,7 @@ config SIM_ASAN
|
||||
config SIM_UBSAN
|
||||
bool "Undefined Behaviour Sanitizer"
|
||||
default n
|
||||
depends on FRAME_POINTER
|
||||
---help---
|
||||
Compile-time instrumentation is used to detect various undefined behaviours
|
||||
at runtime.
|
||||
|
@ -49,6 +49,12 @@ else
|
||||
MAXOPTIMIZATION ?= -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# Default toolchain
|
||||
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
|
||||
CC = $(CROSSDEV)xcc
|
||||
|
@ -29,7 +29,6 @@
|
||||
# reliable code generation.
|
||||
#
|
||||
|
||||
|
||||
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
|
||||
CROSSDEV = xt-
|
||||
endif
|
||||
@ -50,6 +49,12 @@ else
|
||||
MAXOPTIMIZATION := -Os
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FRAME_POINTER),y)
|
||||
MAXOPTIMIZATION += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
else
|
||||
MAXOPTIMIZATION += -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
# Default toolchain
|
||||
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
|
||||
CC = $(CROSSDEV)xcc
|
||||
|
Loading…
Reference in New Issue
Block a user