HomePhabricator

[gcov] Delete CC1 option -coverage-no-function-names-in-data

Authored by MaskRay on May 10 2020, 10:50 AM.

Description

[gcov] Delete CC1 option -coverage-no-function-names-in-data

rL144865 incorrectly wrote function names for GCOV_TAG_FUNCTION
(this might be part of the reasons the header says
"We emit files in a corrupt version of GCOV's "gcda" file format").

rL176173 and rL177475 realized the problem and introduced -coverage-no-function-names-in-data
to work around the issue. (However, the description is wrong.
libgcov never writes function names, even before GCC 4.2).

In reality, the linker command line has to look like:

clang --coverage -Xclang -coverage-version='407*' -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data

Failing to pass -coverage-no-function-names-in-data can make gcov 4.7~7
either produce wrong results (for one gcov-4.9 program, I see "No executable lines")
or segfault (gcov-7).
(gcov-8 uses an incompatible format.)

This patch deletes -coverage-no-function-names-in-data and the related
function names support from libclang_rt.profile

Details

Committed
MaskRayMay 10 2020, 12:37 PM
Parents
rGe4c454b065be: [X86] Add a few more shuffles to hasUndefRegUpdate.
Branches
Unknown
Tags
Unknown

Event Timeline

sylvestre.ledru added a subscriber: sylvestre.ledru.

@MaskRay Please don't land such patch without review.

This option is (was) used by some projects (ex: Firefox)
and you didn't documented this change in the clang release notes

MaskRay added a comment.EditedMay 13 2020, 9:00 AM

@MaskRay Please don't land such patch without review.

This option is (was) used by some projects (ex: Firefox)
and you didn't documented this change in the clang release notes

Can you point to me how Firefox uses -Xclang -coverage-no-function-names-in-data? Debian code search does not reveal anything.

In general I don't think these obscure CC1 options need to be kept for compatibility.

gcov generation in LLVM was in a very sad situation. One needed -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data -Xclang -coverage-version='407*' to be compatible with gcov 4.7 and another -Xclang -coverage-exit-block-before-body to be compatible with gcov 4.8~7.

Please also note that both authors of rL144865 and rL176173 are no longer active now.

Can you point to me how Firefox uses -Xclang -coverage-no-function-names-in-data? Debian code search does not reveal anything.

https://searchfox.org/mozilla-central/source/build/moz.configure/toolchain.configure#1820

In general I don't think these obscure CC1 options need to be kept for compatibility.

I am not argue on this, just that such non-minor changes should be reviewed and documented.

Please also note that both authors of rL144865 and rL176173 are no longer active now.

Others like @jfb, @calixte, @kawashima-fj or @marco-c have been contributing to this part of the code and reviewing each others.