[PATCH] D83154: clang: Add -fcoverage-prefix-map

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 21 19:23:41 PDT 2020


phosek added a comment.

In D83154#2286587 <https://reviews.llvm.org/D83154#2286587>, @keith wrote:

> With D87928 <https://reviews.llvm.org/D87928> do you think we would want this flag as well? The only difference I can think of (besides general UX) is if you need to remap paths outside of your source root, I believe having a `*-prefix-map` style flag makes that a bit more clear (or potentially possible at all). Ideally there wouldn't be issues around that but in the past in the Apple toolchain the Xcode path was embedded in debug info (as an example), so to get a reproducible build we had to pass `-fdebug-prefix-map=/path/to/Xcode.app=SOMETHING`. Which `-fdebug-compilation-dir .` couldn't solve. I'm wondering if we should add both flags for this flexibility, or if we should assume this should not happen?

That really depends on the use case. For distributed compilation and caching `*-prefix-map` flags are undesirable because they include absolute path in the compiler invocation, see https://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html for more details. `-fdebug-compilation-dir` and the proposed `-fsource-dir` don't have that issue because they use relative paths. However, there might still be uses for `*-prefix-map` outside of distributed compilation and caching so I'd be fine with including both.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83154/new/

https://reviews.llvm.org/D83154



More information about the cfe-commits mailing list