From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 22ABC396E02B; Wed, 16 Nov 2022 22:09:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22ABC396E02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668636558; bh=zquDaV7ib5J9iThqZDqYP2V5hNyeVJXsQO45dUEtZeI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HnLox7+uaeKBStcJh9FrWVyEuXsOaAs48i3sBf1x8FrrgVTRg4MGC6Rz8DNXoZQYZ xkdgvb4idTzq2qkQlWzjue7mBCQqZxORhi3wZkgLS6JJ0l6kAMO0JR6lcTEzmTRq5j GuXip1fh3XPK/n115aSU6kKCWtgkkQmKhSSp2H+k= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/107728] with -O0, libgcc in the first stage compiler has reference to libc functions Date: Wed, 16 Nov 2022 22:09:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: MOVED 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: 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=3D107728 --- Comment #2 from Andrew Pinski --- Move over, the functions are not optimized out at -O2 but rather they don't= get pulled in glibc building because another function is referenced. Either libgcc should be built with -fdata-sections -ffunction-sections or g= libc builds needs to be fixed such that it does not reference the function in the unwinder at -O0. You need to look at the linker map to figure why the obje= ct file is being pulled into glibc at -O0 and not at -O2. But it is still a bug in glibc's ld.so really.=