gcov: update gcov compilation parameters

profile-generate is used to generate compilation feedback optimization data, not just code coverage data

It will rely on the toolchain library:
nuttx/libs/libc/misc/lib_utsname.c:94:(.text.uname+0x2c): undefined reference to `__gcov_indirect_call_profiler_v4'
arm-none-eabi-ld: nuttx/libs/libc/misc/lib_utsname.c:113:(.text.uname+0x178): undefined reference to `__gcov_indirect_call'
arm-none-eabi-ld: nuttx/libs/libc/misc/lib_utsname.c:113:(.text.uname+0x188): undefined reference to `__gcov_time_profiler_counter'
arm-none-eabi-ld: nuttx/staging/libc.a(lib_utsname.o):(.data..LPBX0+0x30): undefined reference to `__gcov_merge_time_profile'

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2024-11-12 21:33:23 +08:00 committed by Xiang Xiao
parent 74cdb53027
commit 0194c2f88a
11 changed files with 11 additions and 11 deletions

View file

@ -136,7 +136,7 @@ if(CONFIG_STACK_USAGE_WARNING AND NOT "${CONFIG_STACK_USAGE_WARNING}" STREQUAL
endif()
if(CONFIG_COVERAGE_ALL)
add_compile_options(-fprofile-generate -ftest-coverage)
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
endif()
if(CONFIG_MM_UBSAN_ALL)

View file

@ -89,7 +89,7 @@ if(CONFIG_STACK_USAGE_WARNING AND NOT "${CONFIG_STACK_USAGE_WARNING}" STREQUAL
endif()
if(CONFIG_COVERAGE_ALL)
add_compile_options(-fprofile-generate -ftest-coverage)
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
endif()
if(CONFIG_PROFILE_ALL)

View file

@ -74,7 +74,7 @@ endif
ifeq ($(CONFIG_COVERAGE_ALL),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GCC),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
ARCHOPTIMIZATION += -fprofile-arcs -ftest-coverage -fno-inline
else ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
ARCHOPTIMIZATION += -fprofile-instr-generate -fcoverage-mapping
endif

View file

@ -98,7 +98,7 @@ endif
ifeq ($(CONFIG_COVERAGE_ALL),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GCC),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
ARCHOPTIMIZATION += -fprofile-arcs -ftest-coverage -fno-inline
else ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
ARCHOPTIMIZATION += -fprofile-instr-generate -fcoverage-mapping
endif

View file

@ -137,7 +137,7 @@ endif()
if(CONFIG_COVERAGE_ALL)
if(CONFIG_ARCH_TOOLCHAIN_GCC)
add_compile_options(-fprofile-generate -ftest-coverage)
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
elseif(CONFIG_ARCH_TOOLCHAIN_CLANG)
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
endif()

View file

@ -160,7 +160,7 @@ if(${CONFIG_STACK_USAGE_WARNING})
endif()
if(CONFIG_COVERAGE_ALL)
add_compile_options(-fprofile-generate -ftest-coverage)
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
endif()
add_compile_options(

View file

@ -87,7 +87,7 @@ if(CONFIG_STACK_USAGE_WARNING)
endif()
if(CONFIG_COVERAGE_ALL)
add_compile_options(-fprofile-generate -ftest-coverage)
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
endif()
if(CONFIG_PROFILE_ALL OR CONFIG_SIM_PROFILE)

View file

@ -85,7 +85,7 @@ if(CONFIG_STACK_CANARIES)
endif()
if(CONFIG_COVERAGE_ALL)
add_compile_options(-fprofile-generate -ftest-coverage)
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
endif()
# Optimization of unused sections

View file

@ -59,7 +59,7 @@ ifneq ($(CONFIG_STACK_USAGE_WARNING),0)
endif
ifeq ($(CONFIG_COVERAGE_ALL),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
ARCHOPTIMIZATION += -fprofile-arcs -ftest-coverage -fno-inline
endif
ifeq ($(CONFIG_MM_UBSAN_ALL),y)

View file

@ -76,7 +76,7 @@ if(${CONFIG_STACK_USAGE_WARNING})
endif()
if(CONFIG_COVERAGE_ALL)
add_compile_options(-fprofile-generate -ftest-coverage)
add_compile_options(-fprofile-arcs -ftest-coverage -fno-inline)
endif()
if(CONFIG_DEBUG_SYMBOLS)

View file

@ -76,7 +76,7 @@ endif
ifeq ($(CONFIG_COVERAGE_ALL),y)
ifeq ($(CONFIG_ARCH_TOOLCHAIN_GCC),y)
ARCHOPTIMIZATION += -fprofile-generate -ftest-coverage
ARCHOPTIMIZATION += -fprofile-arcs -ftest-coverage -fno-inline
else ifeq ($(CONFIG_ARCH_TOOLCHAIN_CLANG),y)
ARCHOPTIMIZATION += -fprofile-instr-generate -fcoverage-mapping
endif