From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B96F5386EC42; Tue, 1 Sep 2020 09:29:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B96F5386EC42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1598952548; bh=kR3fOgTQUDZszh+TsppFLWT4N6twkv+pjLbgC8Fr6Ak=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cFeApqW7IJH2Pe946V+ORteLCeP60c1bW3UcT3DV8NvfOo/f22N0OZ9zhSfrM0MdD C3Fr9Yx46acGK2Y32PtcCSuqXYfHDaXncPklid8GdRHHg5LwefuwiJ/jRks6MJJUjJ 5YYHFIwQjAaiP7iQ+4Y+bCVfI8W2ftWu2qpLTKH4= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96880] undefined reference to `__dynamic_cast' when compiling with -fsanitize=vptr and -static Date: Tue, 01 Sep 2020 09:29:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 7.5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: Tue, 01 Sep 2020 09:29:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96880 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- The problem is that lang_specific_driver adds -lstdc++ -lm before the gener= ic code adds -lubsan. If you link normally (dynamically), it will work just fine. Or you can always add -lubsan -lstdc++ Not sure how to fix this properly, the C++ lang_specific_driver doesn't see= the -lubsan option that is only added later on and where exactly in the argumen= ts -lstdc++ ends up is not something gcc.c can predict.=