Skip to content

Commit dd7369b

Browse files
committed
Problem: code coverage build fails
Solution: add -fprofile-update=atomic and --ignore-errors unused as indicated by log message geninfo: ERROR: Unexpected negative count '-1' for /usr/include/c++/13/bits/stl_tree.h:2466. Perhaps you need to compile with '-fprofile-update=atomic LCOV --remove /tmp/* lcov: ERROR: 'exclude' pattern '/tmp/*' is unused. (use "lcov --ignore-errors unused ..." to bypass this error)
1 parent f4329c5 commit dd7369b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

m4/ax_code_coverage.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ AC_DEFUN([AX_CODE_COVERAGE],[
125125
dnl Build the code coverage flags
126126
dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility
127127
CODE_COVERAGE_CPPFLAGS="-DNDEBUG"
128-
CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
129-
CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
128+
CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -fprofile-update=atomic -ftest-coverage"
129+
CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -fprofile-update=atomic -ftest-coverage"
130130
CODE_COVERAGE_LIBS="-lgcov"
131131
CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
132132
@@ -142,7 +142,7 @@ AC_DEFUN([AX_CODE_COVERAGE],[
142142
']
143143
[CODE_COVERAGE_RULES_CAPTURE='
144144
$(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS)
145-
$(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
145+
$(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --ignore-errors unused --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS)
146146
-@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
147147
$(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
148148
@echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"

0 commit comments

Comments
 (0)