From nobody Thu Feb 22 18:57:42 2024 X-Original-To: freebsd-current@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 4Tgj7q0jzpz5BBMD for ; Thu, 22 Feb 2024 18:57:43 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tgj7p5fSNz4kmX for ; Thu, 22 Feb 2024 18:57:42 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 3C6783C019A; Thu, 22 Feb 2024 18:57:42 +0000 (UTC) Date: Thu, 22 Feb 2024 18:57:42 +0000 From: Brooks Davis To: Mark Millard Cc: Konstantin Belousov , FreeBSD Current Subject: Re: sanitizers broken (was RE: libc/libsys split coming soon) [errno in libsys: any analogy to __elf_aux_vector ?] Message-ID: References: <2ED630A9-F4A3-44EE-A35C-ED81F2EAF8BC.ref@yahoo.com> <2ED630A9-F4A3-44EE-A35C-ED81F2EAF8BC@yahoo.com> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ED630A9-F4A3-44EE-A35C-ED81F2EAF8BC@yahoo.com> X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4Tgj7p5fSNz4kmX X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] On Thu, Feb 22, 2024 at 10:16:30AM -0800, Mark Millard wrote: > Brooks Davis wrote on > Date: Thu, 22 Feb 2024 02:03:09 UTC : > > > On Thu, Feb 22, 2024 at 02:57:13AM +0200, Konstantin Belousov wrote: > > > On Wed, Feb 21, 2024 at 08:20:25PM +0000, Brooks Davis wrote: > > > > That's probably worth a shot. Static linking will work anyway because > > > > libc.a in effect embeds libsys to retain compatability. > > > Please do not add libsys.so to the ABI. Right now it is an implementation > > > detail of libthr and libc, and it is preferable to not change it, at least > > > not yet, and definitely not to solve some minor internal issues. > > > > Indeed, on further reflection I agree. Another option occured to me > > which I intend to persue tomorrow: explicitly link the sanitizer .so > > files with libsys. At least in the base system that should be straight > > foward. > > Does the errno move to libsys have any problems similar to > the __elf_aux_vector move to libsys --that might also lead > to needing -lsys (for things as the are now)? I don't think so. With errno, there is still a copy in libc, it's just not used because the libsys on takes precidence. With __elf_aux_vector we were working around a different issue where the wrong copy was being updated by rtld which I resolved by moving it entierly. It's worth noting that any software that links with the errno symbol is buggy as errno is defined as a macro that calls a function as permitted by POSIX. I'm not convinced we should be exposing it for linkage at all. -- Brooks