From nobody Wed Apr 27 22:13:37 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 715041992710 for ; Wed, 27 Apr 2022 22:13:49 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KpY1S2ZKfz3vwR for ; Wed, 27 Apr 2022 22:13:48 +0000 (UTC) (envelope-from joerg@bec.de) Received: (Authenticated sender: joerg@bec.de) by mail.gandi.net (Postfix) with ESMTPSA id B3068FF802 for ; Wed, 27 Apr 2022 22:13:39 +0000 (UTC) Date: Thu, 28 Apr 2022 00:13:37 +0200 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Subject: Re: llvm & RTTI over shared libraries Message-ID: Mail-Followup-To: freebsd-hackers@freebsd.org References: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4KpY1S2ZKfz3vwR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of joerg@bec.de has no SPF policy when checking 2001:4b98:dc4:8::229) smtp.mailfrom=joerg@bec.de X-Spamd-Result: default: False [-2.17 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.976]; FREEFALL_USER(0.00)[joerg]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[bec.de]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-hackers]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:203476, ipnet:2001:4b98:dc4::/48, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[2001:4b98:dc4:8::229:from] X-ThisMailContainsUnwantedMimeParts: N Am Tue, Apr 26, 2022 at 05:48:00PM -0700 schrieb Mark Millard: > • Joerg Sonnenberger wrote on > • Date: Tue, 26 Apr 2022 23:47:23 UTC : > > > Am Mon, Apr 25, 2022 at 03:39:48PM -0700 schrieb Mark Millard: > > > Basically I avoid inline definitions of: > > > > > > virtual ~type_base(); > > > virtual ~type_int(); > > > virtual ~type_string(); > > > > You only need to ensure that the class has one non-pure non-inline > > function. > > I'm confused at what you are claiming that I did wrong or > described incorrectly for the example at hand. I'm giving the exact rule to make sure the OP knows what exactly to follow. Otherwise they can test a chance, discover that in their use case an inlined dtor actually works because something else is the key function etc. I don't disagree with your example, I just want to make sure that it is understood what the critical point is. > > If there is no such function, both will be defined as weak > > mergable symbol and that will not result in a unique address when using > > RTLD_LOCAL. > > I was certainly less detailed about how multiple definitions > are handled. Was that your point? I added that note because it also tells you what symptoms to look for to diagnose the issue. E.g. it is normally a bad sign in C++ to see weak vtable and type symbols and something that should be checked. Joerg