[cmake] gcc.cmake: Add -fprofile-update=atomic.

This fixes the 'negative' errors from lcov's geninfo.

Before:
  source files: 600
  lines.......: 23.2% (10654 of 45904 lines)
  functions...: 22.8% (848 of 3721 functions)
  branches....: 15.8% (7572 of 47821 branches)

After:
  source files: 600
  lines.......: 23.2% (10654 of 45904 lines)
  functions...: 22.8% (848 of 3721 functions)
  branches....: 15.8% (7572 of 47821 branches)

Effectively no change in coverage, but it's likely more stable.
I'll note that the error was triggering in ASTC decoding, which
uses OpenMP for parallel processing.
This commit is contained in:
David Korth 2025-01-18 12:10:32 -05:00
parent f1607d6b83
commit a5c23c5543
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ IF(ENABLE_COVERAGE)
# Don't bother checking for the coverage options.
# We're assuming they're always supported.
SET(RP_C_FLAGS_COVERAGE "--coverage -fprofile-arcs -ftest-coverage")
SET(RP_C_FLAGS_COVERAGE "--coverage -fprofile-arcs -ftest-coverage -fprofile-update=atomic")
SET(RP_C_FLAGS_COMMON "${RP_C_FLAGS_COMMON} ${RP_C_FLAGS_COVERAGE}")
SET(RP_CXX_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} ${RP_C_FLAGS_COVERAGE}")
SET(RP_EXE_LINKER_FLAGS_COMMON "${RP_CXX_FLAGS_COMMON} ${RP_C_FLAGS_COVERAGE}")

View File

@ -44,7 +44,7 @@ fi
echo "*** A"
# Capture lcov output from the unit tests.
lcov ${LCOV_RC} --ignore-errors inconsistent,mismatch,negative \
lcov ${LCOV_RC} --ignore-errors inconsistent,mismatch \
-c -d . -o "${coverage_test_info}"
echo "*** B"