From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 06A373858C53; Mon, 4 Apr 2022 07:07:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06A373858C53 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/105133] lto/gold: lto failed to link --start-lib/--end-lib in gold for duplicate libraries Date: Mon, 04 Apr 2022 07:07:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Mon, 04 Apr 2022 07:07:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105133 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ccoutant at gmail dot com, | |iant at google dot com --- Comment #1 from Richard Biener --- (In reply to luoxhu from comment #0) >=20 > cat hellow.res > 3 > hello.o 2 > 192 ccb9165e03755470 PREVAILING_DEF main > 197 ccb9165e03755470 PREVAILING_DEF_IRONLY s > ./B/libhello.c.o 1 > 205 68e0b97e93a52d7a PREEMPTED_REG hello > ./C/libhello.c.o 1 > 205 18fe2d3482bfb511 PREEMPTED_REG hello This looks like a gold bug - we have 'hello' pre-empted twice but no prevai= ling symbol in the IR - are you ending up with fat LTO objects? OTOH PREEMPTED_REG seems then handled wrongly by LTO as well - it should throw away both copies since the linker told us it found a preempting definition in a non-IR object file. So I'd expect a unresolved reference to 'hello' rather than LTO complaining about multiple definitions ... Note gold is really unmaintained, so you should probably avoid using it.=