Re: Undefined symbol "setgroups@FBSD_1.8"

From: Mark Millard <marklmi_at_yahoo.com>
Date: Wed, 15 Oct 2025 19:23:02 UTC
On Oct 15, 2025, at 11:30, void <void@f-m.fm> wrote:

> On Wed, Oct 15, 2025 at 08:47:45AM -0700, Mark Millard wrote:
>> 
>> Again:
>> 
>> 13.5 does not have compat support for 15 (or 14 or 16). That
>> is a property of 13.5, not of sccache(-overlay).
>> 
> 
> Yet sccache and sccache-overlay work fine on a stable/14 host with
> a 13.5 builder. This is what threw me.

14 does not have the new setgroups/getgroups change that
creates the incompatibility --and does not have any new
special symbols for them: both 14 and 13.5 are using the
FBSD_1.0 symbols for setgroups/getgroups and have no
FBSD_1.8 symbols at all. Nor a libsys. 15 does have
FBSD_1.8 symbols and a libsys. setgroups/getgroups both
moved into that FBSD_1.8 and to libsys --FBSD_1.8
because 15's code update to setgroups/getgroups is
incompatible. 16+ is like 15 (for now).

Incompatible updates that go in libsys are relatively
rare out of the full set of interfacing symbols that
are around --and, of those that occur, are fairly
commonly for things that few programs have involved.
You happen to be using one that does involve such
incompatibility for setgroups/getgroups for before
15 vs. 15 and later.

> Anyhow, I accept the sccache needs to be -static, and, as Kyle mentioned, the current model isn't really workable (until that happens).
> 
> Interestingly, on 14.3-STABLE #10 stable/14-n272560 (built 1st Oct)
> 
> % grep setgroups `grep -rl FBSD_1.8 /usr/src/`
> /usr/src/lib/libc/sys/Symbol.map: setgroups;
> /usr/src/lib/libc/sys/Symbol.map: _setgroups;
> /usr/src/lib/libc/sys/Symbol.map: __sys_setgroups;

If you look at FBSD_1.8 on releng/13.[45] or
releng/14.[123] you will find that
lib/libc/Versions.def has empty symbol lists
(for every FBSD_1.* listed, not just those shown
below):

. . .
# This version was first added to 13.0-current.
FBSD_1.6 {
} FBSD_1.5;

# This version was first added to 14.0-current.
FBSD_1.7 {
} FBSD_1.6;

# This version was first added to 15.0-current.
FBSD_1.8 {
} FBSD_1.7;

# This version was first added to 16.0-current.
FBSD_1.9 {
} FBSD_1.8;
. . .

But also involved are:

lib/libc/libc.ldscript :

GROUP ( @@SHLIB@@ @@LIBDIR@@/libc_nonshared.a @@LIBDIR@@/libssp_nonshared.a )

and:

lib/libc/libc_nossp.ldscript :

GROUP ( @@SHLIB@@ @@LIBDIR@@/libc_nonshared.a ) 

15 changed some how this worked as well, having added
libsys that 14 and before did not have at all.
setgroups/getgroups are in libsys in 15+ , which
leads to them being listed explicitly in FBSD_1.8 .

> on 15.0-STABLE stable/15-n280668 (built 12th Oct)
> 
> % grep setgroups `grep -rl FBSD_1.8 /usr/src/`
> /usr/src/lib/libsys/Symbol.sys.map:     setgroups;

That is because the incompatible change to setgroups
and getgroups happened in 15-CURRENT and, being
incompatible, was not MFC'd to stable/1[0-4] or any
releng/1[0-4].* . (Such applies to 15's new libsys
content and matching FBSD_1.8 content in general.)
Lack of MFC of new incompatibilities to older
versions is the normal procedure across major
FreeBSD versions as new FreeBSD versions are
developed.

===
Mark Millard
marklmi at yahoo.com