From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 804A1385DC1C; Tue, 20 Jul 2021 17:58:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 804A1385DC1C From: "tonyb at cybernetics dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/101473] debug_line info depends on toolchain path Date: Tue, 20 Jul 2021 17:58:11 +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: tonyb at cybernetics dot com 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: Tue, 20 Jul 2021 17:58:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101473 --- Comment #17 from tonyb at cybernetics dot com --- (In reply to Richard Biener from comment #16) > I'm interested if remaining differences are due to the same underlying is= sue > or not I tested your updated patch with gcc 10.2 (I had to make a small change due= to the definition of struct dwarf_file_data being in dwarf2out.c rather than dwarf2out.h in gcc 10.2). I got the same results as before, with the same = list of files being non-reproducible. I decided to debug the problem with pciut= ils. For pciutils, the problem was caused by the following: Yocto CFLAGS contains -ffile-prefix-map but LDFLAGS doesn't. The pciutils Makefile compiles *.c files to *.o files with CFLAGS and links them with LDFLAGS but not CFLAGS. With LTO disabled, this results in a reproducible binary, but with LTO enab= led, this results in a non-reproducible binary. So I can workaround by adding -ffile-prefix-map to LDFLAGS. So is this considered a bug? If the prefix map translation can be handled completely before generating the *.o file, then it could be fixed in gcc, b= ut I am not sure how it all works. One solution that is apparently off the tabl= e is embedding the prefix map in the *.o file, since that would make the *.o file non-reproducible (see e.g. bug 68848; apparently the prefix map used to be present in the *.o file but was removed in some recent version of gcc). If this issue is not considered a bug, then I will pass on to the Yocto peo= ple that they should use -ffile-prefix-map in LDFLAGS in addition to CFLAGS, and you can close this PR. I haven't looked into the other packages that were not reproducible, but I suspect the same issue. I will attach a test script that shows the issue if you want to debug it further.=