Page MenuHomePhabricator

clang: Promote -fdebug-compilation-dir from cc1 flag to driver-level flag

Authored by thakis on Jun 16 2019, 10:00 AM.



The flag is useful when wanting to create .o files that are independent
from the absolute path to the build directory. -fdebug-prefix-map= can
be used to the same effect, but it requires putting the absolute path
to the build directory on the build command line, so it still requires
the build command line to be dependent on the absolute path of the build
directory. With this flag, "-fdebug-compilation-dir ." makes it so that
both debug info and the compile command itself are independent of the
absolute path of the build directory, which is good for build
determinism (in the sense that the build is independent of which
directory it happens in) and for caching compile results.

Diff Detail


Event Timeline

thakis created this revision.Jun 16 2019, 10:00 AM
hans accepted this revision.Jun 17 2019, 4:21 AM


717 ↗(On Diff #204956)

Maybe mention in the commit message that it's not just a driver-level option, but also available in clang-cl (which makes sense I think).

This revision is now accepted and ready to land.Jun 17 2019, 4:21 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2019, 5:07 AM