From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B3FDF3858C27; Sat, 13 May 2023 19:21:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3FDF3858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684005704; bh=rZt8oKGwQtOLtF3ki1xc3x0BNAW/kNKkbCgeDjfpxn0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rQqeB3Vz4uqqDduZdxtcMhyfXQl89EgR6ziNAKJkcDKuNFnNsFcdRa1veunvDBNFG pieC+s9jZ042D5CSD1cZcmzFVjtm9JNC/j4fxtK4m96Eh0gvWczZhHiy0IRWZdlMLz oQDYIG6xFUwj2uO9/9zzqMqOiHHv2cskiZHO44aA= From: "sergiodj at sergiodj dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/109805] LTO affecting -fdebug-prefix-map Date: Sat, 13 May 2023 19:21:43 +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: 14.0 X-Bugzilla-Keywords: lto X-Bugzilla-Severity: normal X-Bugzilla-Who: sergiodj at sergiodj dot net 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109805 --- Comment #9 from Sergio Durigan Junior --- at(In reply to Richard Biener from comment #8) > This works for me. The consistency check is not fully implemented and > instead > of passing down no -fdebug-prefix-map the patch passes the first but warn= s: > > > ./xgcc -B. t.o t2.o -o t > lto-wrapper: warning: option > -fdebug-prefix-map=3D/home/rguenther/obj-trunk-g/gcc=3D/bbb with different > values, using /home/rguenther/obj-trunk-g/gcc=3D/aaa > > to make consistency checking work we need to record -fcanon-prefix-map > and the full set of -f{file,debug}-prefix-map options in order (I think > file and debug variants can be considered the same) of the first TU and > compare that to each of the following TUs. Thanks a lot for the patch. I tried it locally, and it indeed works for the simple example I posted in the description of this bug. However, for some reason it doesn't seem to make a difference for the vim compilation. I'm s= till seeing a directory table like the following: Directory table: [path(line_strp)] 0 /home/ubuntu/vim/vim-9.0.1378/src/vim-basic (0) 1 /usr/include/x86_64-linux-gnu/bits (57) 2 /usr/include (92) whereas if I pass -fdebug-prefix-map to LDFLAGS, the directory table become= s: Directory table: [path(line_strp)] 0 /usr/src/vim-2:9.0.1378-2ubuntu2~ppa1/src/vim-basic (0) 1 /usr/include/x86_64-linux-gnu/bits (65) 2 /usr/include (100) which is what I expected to see. > Note a link-time specified option will simply ignore all options from the > compile-time (but only for the link-time unit, the compile-time debug info > has already been generated with the originally specified options). FWIW, I think this bug is related to #108534 (and the related discussion at https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606205.html).=