Re: Upgrading -RELEASE to -CURRENT

From: Josef 'Jeff' Sipek <jeffpc_at_josefsipek.net>
Date: Tue, 23 Apr 2024 00:22:28 UTC
On Mon, Apr 22, 2024 at 15:28:42 -0400, Josef 'Jeff' Sipek wrote:
> On Mon, Apr 22, 2024 at 20:58:34 +0200, Dimitry Andric wrote:
> > To properly finish up this thread, Jeff was right, and
> > https://cgit.freebsd.org/src/commit/?id=da77a1b4f0dff was the cause.
> > That commit added a .include <bsd.own.mk> at the top of libcxxrt's
> > Makefile, which is normally fine, but not if you use SHLIBDIR?=/lib.
> > That sort of assignment should always be done before including any of
> > the bsd.*.mk files.
> > 
> > I have committed https://cgit.freebsd.org/src/commit/?id=911a6479e18bc
> > for now, which should fix the problem. It also adds an ObsoleteFiles.inc
> > entry for /usr/lib/libcxxrt.so.1, so the file should be removed when you
> > run "make delete-old-libs".
> 
> FWIW, with this change, I just did a successful upgrade of a 14.0-RELEASE
> directly to -CURRENT.

I think a little bit more is needed to completely fix the issue.  It looks
like delete-old-libs gets rid of /usr/lib32/libcxxrt.so.1:

root@odin# make delete-old-libs
...
remove /usr/lib/debug/usr/lib/libcxxrt.so.1.debug? y
remove /usr/lib32/libcxxrt.so.1? y
remove /usr/lib/debug/usr/lib32/libcxxrt.so.1.debug? y
...
>>> Old libraries removed

before installworld:

root@odin# find / -name 'libcxxrt.*' -xdev -ls
 35733      113 -r--r--r--    1 root                             wheel                              106712 Apr 18 20:31 /usr/lib/libcxxrt.so.1
 35633      377 -r--r--r--    1 root                             wheel                              358086 Apr 18 20:31 /usr/lib/libcxxrt.a
103067      225 -r--r--r--    1 root                             wheel                              205880 Mar 23 08:48 /usr/lib/debug/lib/libcxxrt.so.1.debug
 50292      217 -r--r--r--    1 root                             wheel                              157116 Apr 18 20:37 /usr/lib/debug/usr/lib32/libcxxrt.so.1.debug
 35002      241 -r--r--r--    1 root                             wheel                              208792 Apr 18 20:31 /usr/lib/debug/usr/lib/libcxxrt.so.1.debug
 35735        1 lrwxr-xr-x    1 root                             wheel                                  13 Apr 18 20:31 /usr/lib/libcxxrt.so -> libcxxrt.so.1
 50386      105 -r--r--r--    1 root                             wheel                               88116 Apr 18 20:37 /usr/lib32/libcxxrt.so.1
 50291      321 -r--r--r--    1 root                             wheel                              220338 Apr 18 20:37 /usr/lib32/libcxxrt.a
 50951        1 lrwxr-xr-x    1 root                             wheel                                  13 Apr 18 20:37 /usr/lib32/libcxxrt.so -> libcxxrt.so.1
102692      113 -r--r--r--    1 root                             wheel                              107512 Mar 23 08:48 /lib/libcxxrt.so.1

after installworld:
root@odin# find / -name 'libcxxrt.*' -xdev -ls
 35633      377 -r--r--r--    1 root                             wheel                              358086 Apr 18 20:31 /usr/lib/libcxxrt.a
101307      241 -r--r--r--    1 root                             wheel                              208792 Apr 22 19:59 /usr/lib/debug/lib/libcxxrt.so.1.debug
 50292      217 -r--r--r--    1 root                             wheel                              157116 Apr 18 20:37 /usr/lib/debug/usr/lib32/libcxxrt.so.1.debug
 35002      241 -r--r--r--    1 root                             wheel                              208792 Apr 18 20:31 /usr/lib/debug/usr/lib/libcxxrt.so.1.debug
101309        1 lrwxr-xr-x    1 root                             wheel                                  23 Apr 22 19:59 /usr/lib/libcxxrt.so -> ../../lib/libcxxrt.so.1
 50386      105 -r--r--r--    1 root                             wheel                               88116 Apr 18 20:37 /usr/lib32/libcxxrt.so.1
 50291      321 -r--r--r--    1 root                             wheel                              220338 Apr 18 20:37 /usr/lib32/libcxxrt.a
117893        1 lrwxr-xr-x    1 root                             wheel                                  13 Apr 22 20:00 /usr/lib32/libcxxrt.so -> libcxxrt.so.1
101970      113 -r--r--r--    1 root                             wheel                              106712 Apr 22 19:59 /lib/libcxxrt.so.1

after delete-old-libs:
root@odin# find / -name 'libcxxrt.*' -xdev -ls
 35633      377 -r--r--r--    1 root                             wheel                              358086 Apr 18 20:31 /usr/lib/libcxxrt.a
101307      241 -r--r--r--    1 root                             wheel                              208792 Apr 22 19:59 /usr/lib/debug/lib/libcxxrt.so.1.debug
101309        1 lrwxr-xr-x    1 root                             wheel                                  23 Apr 22 19:59 /usr/lib/libcxxrt.so -> ../../lib/libcxxrt.so.1
 50291      321 -r--r--r--    1 root                             wheel                              220338 Apr 18 20:37 /usr/lib32/libcxxrt.a
117893        1 lrwxr-xr-x    1 root                             wheel                                  13 Apr 22 20:00 /usr/lib32/libcxxrt.so -> libcxxrt.so.1
101970      113 -r--r--r--    1 root                             wheel                              106712 Apr 22 19:59 /lib/libcxxrt.so.1

Compared to what I see on 14.0-RELEASE, note that:

1. /usr/lib/debug/usr/lib32/libcxxrt.so.1.debug is missing
2. /usr/lib32/libcxxrt.so.1 is missing
3. /usr/lib32/libcxxrt.so is a broken symlink (because of #2)

At least I'm assuming that lib32 is still supposed to exist.  (A repeated
'make installworld' recreates the missing files.)

Jeff.