[cfe-dev] controlling the value of DW_AT_comp_dir

Chandler Carruth chandlerc at google.com
Thu Oct 20 14:55:47 PDT 2011

On Thu, Oct 20, 2011 at 2:03 PM, Nick Lewycky <nlewycky at google.com> wrote:

> To understand why, you first need to know that we run builds on hermetic
> build machines.

I'm not really sure why our build system is relevant here. This has been a
problem for me many times using very mundane and ordinary build systems. If
I build on machine X and then copy the binary to machine Y, it can't find
the source code if it is stored in a different directory, even if the
directory structure is entirely compatible.

Why can't we follow GCC's lead here, and use PWD (when on a system with such
a concept) as the basis for DW_AT_comp_dir? I think what I'm missing is why
doing that causes problems...

Chris's objections (which seem reasonable) are to *always* using PWD. To be
clear, I'm not suggesting that. I'm suggesting that the Clang driver, which
is already quite aware of the user's shell, can inspect PWD and getcwd and
consult any other oracle needed to determine a valid working directory, and
then pass it via an internal-only flag to the CC1 layer IFF it differs from
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111020/13234b21/attachment.html>

More information about the cfe-dev mailing list