This PR follows up on #30811, which inadvertently broke coverage builds:
- For GCC. See #31337 (comment).
- For Clang’s source-based code coverage in the OSS-Fuzz environment due to its use of other options and a third party script. See https://issues.oss-fuzz.com/issues/379122777.
The root cause of this regression is that the -ffile-prefix-map
option implicitly applies:
-fprofile-prefix-map
when using GCC.-fcoverage-prefix-map
when using Clang.This behaviour is not explicitly documentedSee https://github.com/llvm/llvm-project/commit/994c544c18c86cbdb6536aae5d27ef7e2f592486.
With this PR, only the -fdebug-prefix-map
and -fmacro-prefix-map
options are applied.
Note for reviewers: Please ensure that #30799 is not reintroduced.