build: Add STACK_USAGE(-fstack-usage) to assist the stack analysis

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-01-18 18:58:45 +08:00 committed by Gustavo Henrique Nihei
parent ab059a7ba3
commit fd64e38072
7 changed files with 28 additions and 0 deletions

1
.gitignore vendored
View File

@ -27,6 +27,7 @@
*.wsp
*.ddc
*.dds
*.su
*~
.depend
/.config

View File

@ -1945,6 +1945,13 @@ config STACK_CANARIES
Enabling this option can result in a significant increase
in footprint and an associated decrease in performance.
config STACK_USAGE
bool "Generate stack usage information"
help
Generate an extra file that specifies the maximum amount of stack used,
on a per-function basis. Please use https://github.com/HBehrens/puncover
or tools/showstack.sh to generate the more useful report.
config ARCH_HAVE_HEAPCHECK
bool
default n

View File

@ -54,6 +54,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_STACK_USAGE),y)
ARCHOPTIMIZATION += -fstack-usage
endif
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -63,6 +63,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_STACK_USAGE),y)
ARCHOPTIMIZATION += -fstack-usage
endif
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -75,6 +75,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_STACK_USAGE),y)
ARCHOPTIMIZATION += -fstack-usage
endif
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -75,6 +75,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_STACK_USAGE),y)
ARCHOPTIMIZATION += -fstack-usage
endif
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif

View File

@ -67,6 +67,10 @@ ifeq ($(CONFIG_STACK_CANARIES),y)
ARCHOPTIMIZATION += -fstack-protector-all
endif
ifeq ($(CONFIG_STACK_USAGE),y)
ARCHOPTIMIZATION += -fstack-usage
endif
ifeq ($(CONFIG_ARCH_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
endif