I now work on C code coverage study and encountered following issue, GCC version 4.4.6:
- Added compiler flag
CFLAGS = --coverage
and linker optionLDFLAGS := --coverage
orLOCAL_LDLIBS := --coverage
and got the error:
undefined reference to '__gcov_init'" and "undefined reference to '__gcov_merge_add'
- Added option
LOCAL_LDFLAGS := --coverage
, and got link error:
libgcov.a(_gcov.o): in function __gcov_set_sampling_rate: undefined reference to '__gcov_sampling_rate'
libgcov.a(_gcov.o): in function gcov_exit: undefined reference to '__gcov_pmu_profile_filename'
libgcov.a(_gcov.o): in function __gcov_init: undefined reference to '__gcov_pmu_profile_options' '__gcov_pmu_top_n_address'
Can anyone help to provide some suggestions on this issue?