From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 83ECF3894421; Wed, 21 Jul 2021 10:34:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83ECF3894421 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/101473] debug_line info depends on toolchain path Date: Wed, 21 Jul 2021 10:34:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 10:34:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101473 --- Comment #19 from Richard Biener --- I think it is a bug - -fdebug-prefix-map should be fully reflected in the L= TO IL and thus we should not end up creating un-remapped references to files (= we should not create many references to files late anyway). In particular we're remapping all files when streaming locations to LTO. B= ut yes, we're explicitely _not_ streaming the -f*-prefix-map arguments since we'd have a hard time using them when they do not agree between TUs. Your lto-test shows the difference is in the LTRANS DWARF CU header: @@ -215,7 +215,7 @@ <9b> DW_AT_producer : (indirect string, offset: 0x1c7): GNU GIMPLE 10.3.0 -mtune=3Dgeneric -march=3Dx86-64 -g -O2 -fno-openmp -fno-openacc -fn= o-pie -fcf-protection=3Dnone -ffat-lto-objects -fuse-linker-plugin -fltrans <9f> DW_AT_language : 12 (ANSI C99) DW_AT_name : (indirect string, offset: 0x1b2): - DW_AT_comp_dir : (indirect string, offset: 0x263): /tmp/lto-test/src0 + DW_AT_comp_dir : (indirect string, offset: 0x263): /tmp/lto-test/src1 DW_AT_ranges : 0x40 DW_AT_low_pc : 0x0 DW_AT_stmt_list : 0xe8 and with DWARF5 in addition in the directory table: The Directory Table (offset 0x10a, lines 1, columns 1): Entry Name - 0 (indirect line string, offset: 0xd): /tmp/lto-test/src0 + 0 (indirect line string, offset: 0xd): /tmp/lto-test/src1 so indeed the prefix remapping is needed at link-time - the link time CWD aka DW_AT_comp_dir might also not agree with the CWD at compile time. Thus my suggestion would be to indeed add -f*-prefix-map to LDFLAGS, at least I can't think of a good solution to the above issue. Eventually picking a random TU and copying the CWD from its compile-time to the link-time CUs would work. Or somehow not specifying a compilation-dir at all for those CUs?=