diff --git a/Makefile.pre.in b/Makefile.pre.in index 2b34b009fd745a..00289c4ec62239 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -917,7 +917,7 @@ coverage-lcov: @lcov $(COVERAGE_LCOV_OPTIONS) --capture \ --directory $(abs_builddir) \ --base-directory $(realpath $(abs_builddir)) \ - --path $(realpath $(abs_srcdir)) \ + --ignore-errors negative \ --output-file $(COVERAGE_INFO) @ # remove 3rd party modules, system headers and internal files with @ # debug, test or dummy functions. @@ -931,8 +931,13 @@ coverage-lcov: '/usr/include/*' \ '/usr/local/include/*' \ '/usr/lib/gcc/*' \ + --ignore-errors inconsistent \ + --ignore-errors negative \ + --ignore-errors unused \ --output-file $(COVERAGE_INFO) @genhtml $(COVERAGE_INFO) \ + --ignore-errors inconsistent \ + --ignore-errors negative \ --output-directory $(COVERAGE_REPORT) \ $(COVERAGE_REPORT_OPTIONS) @echo diff --git a/Misc/NEWS.d/next/Build/2026-06-07-03-30-47.gh-issue-151001.kUUON0.rst b/Misc/NEWS.d/next/Build/2026-06-07-03-30-47.gh-issue-151001.kUUON0.rst new file mode 100644 index 00000000000000..8c1eceff910ad1 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-06-07-03-30-47.gh-issue-151001.kUUON0.rst @@ -0,0 +1 @@ +Fix ``make coverage-lcov`` to work with lcov v2.x. Remove the ``--path`` option which was repurposed in lcov v2, and add ``--ignore-errors negative,inconsistent,unused`` flags to handle stricter validation introduced in lcov v2.