kconfig: add CONFIG_CC_COVERAGE
Make it possible to use gcc code coverage analysis. v1 -> v2: - Kconfig: remove not needed 'default n' - Makefile: use consistent spacing Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
cd5d274252
commit
52ff8020d0
4
.gitignore
vendored
4
.gitignore
vendored
@ -85,3 +85,7 @@ GTAGS
|
|||||||
*.orig
|
*.orig
|
||||||
*~
|
*~
|
||||||
\#*#
|
\#*#
|
||||||
|
|
||||||
|
# gcc code coverage files
|
||||||
|
*.gcda
|
||||||
|
*.gcno
|
||||||
|
7
Kconfig
7
Kconfig
@ -59,6 +59,13 @@ config CC_OPTIMIZE_FOR_SIZE
|
|||||||
|
|
||||||
This option is enabled by default for U-Boot.
|
This option is enabled by default for U-Boot.
|
||||||
|
|
||||||
|
config CC_COVERAGE
|
||||||
|
bool "Enable code coverage analysis"
|
||||||
|
depends on SANDBOX
|
||||||
|
help
|
||||||
|
Enabling this option will pass "--coverage" to gcc to compile
|
||||||
|
and link code instrumented for coverage analysis.
|
||||||
|
|
||||||
config DISTRO_DEFAULTS
|
config DISTRO_DEFAULTS
|
||||||
bool "Select defaults suitable for booting general purpose Linux distributions"
|
bool "Select defaults suitable for booting general purpose Linux distributions"
|
||||||
default y if ARCH_SUNXI || TEGRA
|
default y if ARCH_SUNXI || TEGRA
|
||||||
|
6
Makefile
6
Makefile
@ -725,6 +725,12 @@ else
|
|||||||
PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
|
PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
|
||||||
endif
|
endif
|
||||||
PLATFORM_LIBS += $(PLATFORM_LIBGCC)
|
PLATFORM_LIBS += $(PLATFORM_LIBGCC)
|
||||||
|
|
||||||
|
ifdef CONFIG_CC_COVERAGE
|
||||||
|
KBUILD_CFLAGS += --coverage
|
||||||
|
PLATFORM_LIBGCC += -lgcov
|
||||||
|
endif
|
||||||
|
|
||||||
export PLATFORM_LIBS
|
export PLATFORM_LIBS
|
||||||
export PLATFORM_LIBGCC
|
export PLATFORM_LIBGCC
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user