Skip to content

Take the phase of a coverage record's version word from libgcov too - #3713

Merged
tamnd merged 2 commits into
mainfrom
driver/gcov-phase
Oct 17, 2026
Merged

tamnd merged 2 commits into
mainfrom
driver/gcov-phase

Conversation

@tamnd

@tamnd tamnd commented Oct 17, 2026

Copy link
Copy Markdown
Owner

A program built with --coverage on a machine whose newest GCC is Ubuntu's gcc-16 package wrote no .gcda file. libgcov said "Version mismatch - expected 16.0 (experimental) (B60 ) got 16.0 (release) (B60*)" and dropped the counts. cargo xtask ci failed on the Linux box in gcov_reads_the_counts_of_a_covered_program for this reason.

rucc already reads the release from the version word inside the libgcov.a the link takes, but it only accepted a word ending in *. gcc/genversion.cc writes * for a release or a prerelease and the first character of DEV-PHASE for anything else, e on the trunk, and that package is a snapshot that ends the word in a space. The scan now takes *, a space or a lower case letter as the phase, the session keeps it next to the release, and the record's version word ends with it. With nothing found the word still ends in *.

On the Linux box, which has that gcc-16 package, arc_counters passes 5 of 5 and coverage_i686 2 of 2, the gcov and coverage unit tests pass with two new cases, and clippy is clean.

rucc reads the release of the libgcov.a a coverage build links from the version word in the archive, but only took a word that ends in *, the mark of a release. The snapshot of GCC 16 that Ubuntu packages as gcc-16 ends its word in a space, so rucc fell back to B60* and libgcov refused the counts with "Version mismatch - expected 16.0 (experimental) (B60 ) got 16.0 (release) (B60*)". The scan now takes the phase GCC can write there as well, and the record copies it.
@tamnd tamnd added kind/bug Crash, wrong diagnostic, or a valid program rejected area/driver CLI, phase graph, job scheduling, linker invocation area/gnu-compat Attributes, builtins, pragmas, and everything __GNUC__ obliges us to labels Oct 17, 2026
@tamnd
tamnd merged commit af5a0a1 into main Oct 17, 2026
@tamnd
tamnd deleted the driver/gcov-phase branch October 17, 2026 02:25
@tamnd tamnd mentioned this pull request Oct 17, 2026
11 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/driver CLI, phase graph, job scheduling, linker invocation area/gnu-compat Attributes, builtins, pragmas, and everything __GNUC__ obliges us to kind/bug Crash, wrong diagnostic, or a valid program rejected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant