From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 26E913858C53; Thu, 19 Jan 2023 13:43:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26E913858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674135830; bh=j4JF+hg01OqQWpEjCQmjC47bmwrTyzz/MB+F4oit5+8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Cslx9Tj488YWFlv6B+m0JQuX/rx0Xwhs/ccF9IWc+SD1p345AnN3FpS1Fb5utZbX5 AVcGarngKwrC6oDqCqmPDpxjpsjcLEX6Yuost9W0yKPaeQrRPnD3+QX9cq1YTgejnH LhqpqKnSpMChO5AM6f757yeYgn/JzTsZt7Lvh+c4= From: "richard.purdie at linuxfoundation dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: richard.purdie at linuxfoundation dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108464 --- Comment #3 from Richard Purdie --- (In reply to Jakub Jelinek from comment #2) > Dunno about other uses of remap_filename, but for remap_debug_filename wh= at > 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 a= ny other combination some build system might end up generating due to it's sou= rce layout? > Users pass often > pass what they get from pwd to -fdebug-prefix-map=3D, 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=3D options. But ignoring what us= er > 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 someth= ing 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)?=