From nobody Tue Apr 19 21:49:44 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 A2F6411E66E6 for ; Tue, 19 Apr 2022 21:49:49 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 4KjcsS5pHtz3Fyf for ; Tue, 19 Apr 2022 21:49:48 +0000 (UTC) (envelope-from joerg@bec.de) Received: (Authenticated sender: joerg@bec.de) by mail.gandi.net (Postfix) with ESMTPSA id BB74B1BF205 for ; Tue, 19 Apr 2022 21:49:46 +0000 (UTC) Date: Tue, 19 Apr 2022 23:49:44 +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=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4KjcsS5pHtz3Fyf 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 217.70.183.201) smtp.mailfrom=joerg@bec.de X-Spamd-Result: default: False [-1.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[joerg]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[bec.de]; NEURAL_HAM_SHORT(-0.33)[-0.326]; 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:29169, ipnet:217.70.176.0/20, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[217.70.183.201:from] X-ThisMailContainsUnwantedMimeParts: N Am Thu, Apr 14, 2022 at 04:36:24PM +0000 schrieb jbo@insane.engineer: > After some research I seem to understand that the way that RTTI is handled over shared library boundaries is different between GCC and LLVM. I think you are running into the old problem that GCC thinks comparing types by name makes sense where as everyone else compares types by type pointer identity. GCC is glaringly wrong because types with identical names can and often are unrelated. This is especially a problem for plugins. The correct way to deal with it is making sure that every type has a key function of appropiate visibility and making sure that the interface library exports them and every plugin links against it. If you do that, dlopen without RTLD_GLOBAL or linking the main program without -rdynamic works fine. Joerg