bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/28266] CWD present in object file even after use of -fdebug-pre


From: nickc at redhat dot com
Subject: [Bug gas/28266] CWD present in object file even after use of -fdebug-prefix-map=$PWD=foo
Date: Wed, 01 Sep 2021 15:56:55 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=28266

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nickc at redhat dot com

--- Comment #2 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Joel Rosdahl from comment #0)
Hi Joel,

> I'm the maintainer of ccache, 

An excellent tool - I use it a lot myself.

> My best guess is that this is due to
> binutils commit 3417bfca676ff0b440f070a09837813e99b2c731 which seems to
> unconditionally add CWD to the object file, hence filing this on the GAS
> component. 

This makes sense.

> Is it expected that the 0'th entry in the directory table is not rewritten
> with -fdebug-prefix-map? 

I feel so.  The -fdebug-prefix-map option predates DWARF-5 by quite a lot,
so the interactions are not defined.  But I think that the intention matches
your expectations:

> If not, I guess it breaks the intention of
> -fdebug-prefix-map which is "This can give more reproducible builds, which
> are location independent"?

Right.  So I would favour the interpretation that -fdebug-prefix-map is 
expected to override strict conformance to the DWARF standard because
of the desire/need for reproducible builds.


> I also noticed that 3417bfca676ff0b440f070a09837813e99b2c731 adds this
> comment:
> 
>     /* In DWARF-5 the 0 entry in the directory table is expected to be
>        the same as the DW_AT_comp_dir (which is set to the current build
>        directory).  Since we are about to create a directory entry that
>        is not the same, allocate the current directory first.
>        FIXME: Alternatively we could generate an error message here.  */
> 
> However, the 0'th entry in the directory table won't always be the same as
> DW_AT_comp_dir since the latter value is rewritten by -fdebug-prefix-map.

True.  Possibly it can be argued that in the presence of the -fdebug-
prefix-map option the DW_AT_comp_dir entry ought to be changed as well.
(Which would match the intention of creating reproducible builds).

The problem with this idea is that it is GCC not GAS that generates
the DW_AT_comp_dir entry, and detecting it reliably in the assembler
would quite hard.  But maybe GCC can be persuaded to do this instead ?


> Another data point is that Clang in Fedora 34 sets the 0'th directory 
> entry with -fdebug-prefix-map applied.

So gas and Clang are in sync on this ?  Good.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]