Skip to content

Commit 81e233e

Browse files
committed
coverage: atomically update gcov files
problem: we keep getting merge issues with gcov files. It seems the default for updating these is "single" meaning single threaded unless the compilation is done with `-pthread`. I'm guessing we see the errors most on libraries we use in multiple places that are not themselves compiled that way, even though they're eventually linked into binaries that are. If this doesn't cover it, we should also do what's listed in solution: add `-fprofile-update=atomic` to our coverage flags
1 parent d025f24 commit 81e233e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

config/ax_code_coverage.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ 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 -ftest-coverage -fprofile-update=atomic"
129+
CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage -fprofile-update=atomic"
130130
CODE_COVERAGE_LIBS="-lgcov"
131-
CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS"
131+
CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS -fprofile-update=atomic"
132132
133133
AC_SUBST([CODE_COVERAGE_CPPFLAGS])
134134
AC_SUBST([CODE_COVERAGE_CFLAGS])

0 commit comments

Comments
 (0)