Re: git: 1235d276b78a - main - lib{c,sys}: stop exposing errno symbol

From: Brooks Davis <brooks_at_freebsd.org>
Date: Mon, 30 Sep 2024 23:37:23 UTC
On Mon, Sep 30, 2024 at 03:53:01PM +0000, Brooks Davis wrote:
> On Mon, Sep 30, 2024 at 08:33:18AM +0200, Antoine Brodin wrote:
> > On Fri, Sep 27, 2024 at 9:33???PM Brooks Davis <brooks@freebsd.org> wrote:
> > >
> > > The branch main has been updated by brooks:
> > >
> > > URL: https://cgit.FreeBSD.org/src/commit/?id=1235d276b78a769bded01d51c9bf3cdc480db9fb
> > >
> > > commit 1235d276b78a769bded01d51c9bf3cdc480db9fb
> > > Author:     Brooks Davis <brooks@FreeBSD.org>
> > > AuthorDate: 2024-09-27 19:27:46 +0000
> > > Commit:     Brooks Davis <brooks@FreeBSD.org>
> > > CommitDate: 2024-09-27 19:27:46 +0000
> > >
> > >     lib{c,sys}: stop exposing errno symbol
> > >
> > >     Officially since C11 (and in reality FreeBSD since 3.0 with commit
> > >     1b46cb523df3) errno has been defined to be a macro.  Rename the symbol
> > >     to __libsys_errno and move it to FBSDprivate_1.0 and confine it entierly
> > >     to libsys for use by libthr.  Add a FBSD_1.0 compat symbol for existing
> > >     binaries that were incorrectly linked to the errno symbol during
> > >     libc.so.7's lifetime.
> > >
> > >     This deliberately breaks linking software that directly links to errno.
> > >     Such software is broken and will fail in surprising ways if it becomes
> > >     threaded (e.g., if it triggers loading of a pam or nss module that
> > >     uses threads.)
> > >
> > >     Reviewed by:    kib
> > >     Differential Revision:  https://reviews.freebsd.org/D46780
> > > ---
> > >  lib/libsys/Makefile          |  2 ++
> > >  lib/libsys/Symbol.map        |  1 +
> > >  lib/libsys/Symbol.sys.map    |  1 -
> > >  lib/libsys/__error.c         | 10 +++++-----
> > >  lib/libthr/sys/thr_error.c   |  5 ++---
> > >  lib/libthr/thread/thr_rtld.c |  7 +++----
> > >  6 files changed, 13 insertions(+), 13 deletions(-)
> > 
> > Hello,
> > 
> > This breaks some ports:
> 
> Thank you for the list (that's more than I expected).  I'll work on
> updates.  The fix is to replace

I've updated all the maintainer-less ports.  The majority were djbware.
I was quite tempted to set deprecation notices as most produce many
warnings with a modern compiler.  These warning are easy to fix, but it's
clear no one cares.

For ports with maintainers I've filed bugs with fixes and pushed them all
to https://github.com/brooksdavis/freebsd-ports/tree/errno-fixes

-- Brooks