public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "richard.purdie at linuxfoundation dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/108464] [13 Regression] Broken -fdebug-prefix-map since r13-3599
Date: Thu, 19 Jan 2023 13:43:49 +0000	[thread overview]
Message-ID: <bug-108464-4-ibsaHC1n7X@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108464-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108464

--- Comment #3 from Richard Purdie <richard.purdie at linuxfoundation dot org> ---
(In reply to Jakub Jelinek from comment #2)
> Dunno about other uses of remap_filename, but for remap_debug_filename what
> that commit changed doesn't seem to be ever appropriate.

I think it depends on your use case. For example if via debug-prefix-map you
say you want:

/somepath/somesources translated to /somewhere

and then some code references ../somesources and ../../somesources from it's
build tree, would you want the user to have to add mappings for those and any
other combination some build system might end up generating due to it's source
layout?

>  Users pass often
> pass what they get from pwd to -fdebug-prefix-map=, and that is usually not
> the canonicalized path.  And DW_AT_comp_dir was that same path as well and
> IMHO it would be a very bad idea to change that.  Debug info contains
> relative paths in many cases, that also shouldn't be canonicalized, should
> be whatever user used in -I etc. options or #include paths etc.
> If one is mixing absolute paths and some are canonical and others aren't,
> one can use multiple -fdebug-prefix-map= options.  But ignoring what user
> asked for is just wrong.

It can be argued that if you ask for my above example and it doesn't remap the
relative accesses, it is also just wrong.

I can say that with all the cross compiling we do (in Yocto Project), making
this handle the corner cases improved our binary reproducibility quite
significantly. gcc can revert the change but we'd just have to patch something
in to handle this.

Another possible option is to resolve both sides of the equation before
deciding to remap or not (i.e. the directory in debug-prefix-map and the
potential target)?

  parent reply	other threads:[~2023-01-19 13:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 13:00 [Bug other/108464] New: " jakub at gcc dot gnu.org
2023-01-19 13:01 ` [Bug other/108464] " jakub at gcc dot gnu.org
2023-01-19 13:21 ` richard.purdie at linuxfoundation dot org
2023-01-19 13:29 ` jakub at gcc dot gnu.org
2023-01-19 13:43 ` richard.purdie at linuxfoundation dot org [this message]
2023-01-19 13:44 ` jakub at gcc dot gnu.org
2023-01-19 15:08 ` richard.purdie at linuxfoundation dot org
2023-01-31  9:01 ` jakub at gcc dot gnu.org
2023-02-20 15:16 ` orion at cora dot nwra.com
2023-02-20 15:26 ` jakub at gcc dot gnu.org
2023-03-10  9:23 ` cvs-commit at gcc dot gnu.org
2023-03-10  9:24 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108464-4-ibsaHC1n7X@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).