Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2024 18:57:42 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: sanitizers broken (was RE: libc/libsys split coming soon) [errno in libsys: any analogy to __elf_aux_vector ?]
Message-ID:  <ZdeZJrculHNdfo0j@spindle.one-eyed-alien.net>
In-Reply-To: <2ED630A9-F4A3-44EE-A35C-ED81F2EAF8BC@yahoo.com>
References:  <2ED630A9-F4A3-44EE-A35C-ED81F2EAF8BC.ref@yahoo.com> <2ED630A9-F4A3-44EE-A35C-ED81F2EAF8BC@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 22, 2024 at 10:16:30AM -0800, Mark Millard wrote:
> Brooks Davis <brooks_at_freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZdeZJrculHNdfo0j>