From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 08EC3388E83E; Tue, 5 Jan 2021 14:24:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08EC3388E83E From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a Date: Tue, 05 Jan 2021 14:24:49 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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, 05 Jan 2021 14:24:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98414 --- Comment #9 from Martin Li=C5=A1ka --- (In reply to Jakub Jelinek from comment #8) > I don't. LIBUBSAN_SPEC comes from gcc.c, while the libstdc++ stuff comes > from cp/g++spec.c and the ordering between the two is hard to achieve, pl= us > it is unclear if we shouldn't for -static-libubsan instead just add anoth= er > -lstdc++ copy (but one honoring -static-libstdc++). Hm, and what about something like that: diff --git a/config/bootstrap-ubsan.mk b/config/bootstrap-ubsan.mk index 1d85fe1c836..b2a474ae158 100644 --- a/config/bootstrap-ubsan.mk +++ b/config/bootstrap-ubsan.mk @@ -2,7 +2,7 @@ STAGE2_CFLAGS +=3D -fsanitize=3Dundefined -DUBSAN_BOOTSTRAP STAGE3_CFLAGS +=3D -fsanitize=3Dundefined -DUBSAN_BOOTSTRAP -POSTSTAGE1_LDFLAGS +=3D -fsanitize=3Dundefined -static-libubsan -DUBSAN_BO= OTSTRAP \ +POSTSTAGE1_LDFLAGS +=3D -fsanitize=3Dundefined -static-libubsan -lstdc++ -DUBSAN_BOOTSTRAP \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/ \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/.libs=