RE: /lib/libcxxrt.so problem with Node.js

From: Mark Millard <marklmi_at_yahoo.com>
Date: Mon, 16 Sep 2024 14:27:25 UTC
Matthew Phillips <matthew_at_matthewphillips.info> wrote on
Date: Mon, 16 Sep 2024 13:04:51 UTC :

> On 14.1, when installing any of the Node.js packages, node22 for
> example, I get this error message when attempting to run the `node`
> binary:
> 
> ld-elf.so.1: /lib/libcxxrt.so.1: version CXXABI_1.3.11 required by /lib/libc++.so.1 not found
> 
> Checkings strings:
> 
> # strings /lib/libc++.so.1 | grep CXXABI
> CXXABI_1.3
> CXXABI_1.3.11
> 
> That's ok, but
> 
> # strings /lib/libcxxrt.so.1 | grep CXXABI
> CXXABI_1.3
> CXXABI_1.3.1
> CXXABI_1.3.5
> CXXABI_1.3.6
> 
> So indeed there is a problem. This has been previously reported here:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280303 but not
> resolved.
> 
> Any advice? How/can I just reinstall /lib/cxxrt.so.1 and if so, how?

Normal (as seen via stable/14 as I do not have a releng/14.*
around):

# uname -U
1401501

# ls -lodT  /lib/libcxxrt.so.1
-r--r--r--  1 root wheel - 106848 Jul 15 12:33:03 2024 /lib/libcxxrt.so.1

# strings  /lib/libcxxrt.so.1 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.9
CXXABI_1.3.11

So you seem to be missing both CXXABI_1.3.9 and CXXABI_1.3.11 .

How old is your /lib/libcxxrt.so.1 ?

The addition of CXXABI_1.3.9 dates back to 2017 ( as seen in
releng/14.1 --but it is also in releng/14.0 and in
releng/13.0 [2021-Apr-09]):

diff --git a/lib/libcxxrt/Version.map b/lib/libcxxrt/Version.map
index 73ef70748861..5cb186072323 100644
--- a/lib/libcxxrt/Version.map
+++ b/lib/libcxxrt/Version.map
@@ -254,10 +254,27 @@ CXXABI_1.3.1 {
__cxa_get_exception_ptr;
} CXXABI_1.3;
-CXXABI_1.3.6 {
- __cxa_deleted_virtual;
+CXXABI_1.3.5 {
+ "typeinfo for __int128 const*";
+ "typeinfo for __int128";
+ "typeinfo for __int128*";
+ "typeinfo for unsigned __int128 const*";
+ "typeinfo for unsigned __int128";
+ "typeinfo for unsigned __int128*";
} CXXABI_1.3.1;
+CXXABI_1.3.6 {
+ __cxa_deleted_virtual;
+} CXXABI_1.3.5;
+
+CXXABI_1.3.9 {
+ "typeinfo name for __int128 const*";
+ "typeinfo name for __int128";
+ "typeinfo name for __int128*";
+ "typeinfo name for unsigned __int128 const*";
+ "typeinfo name for unsigned __int128";
+ "typeinfo name for unsigned __int128*";
+} CXXABI_1.3.6;
CXXRT_1.0 {


For reference:

author Dimitry Andric <dim@FreeBSD.org> 2017-02-21 21:48:45 +0000
committer Dimitry Andric <dim@FreeBSD.org> 2017-02-21 21:48:45 +0000
commit 6fc1c2befccc42fe69551bd618e1ddd0ca607025 (patch)
tree 494876a6e826258b527de4c3d9da9746aa190fc2 /lib/libcxxrt/Version.map
parent 5c65c9998a0ff2b4ca5d397c641ee5d3eaa1de01 (diff)
download src-6fc1c2befccc42fe69551bd618e1ddd0ca607025.tar.gz
src-6fc1c2befccc42fe69551bd618e1ddd0ca607025.zip

Add __int128-related symbols to libcxxrt's version map. Put these into
the same CXXABI verions as recent libstdc++.

Note that __int128 types are only available on arches where long long is 128 bit wide.

Noticed by: harti MFC after: 2 weeks



There was also:

author Dimitry Andric <dim@FreeBSD.org> 2017-02-22 18:44:57 +0000
committer Dimitry Andric <dim@FreeBSD.org> 2017-02-22 18:44:57 +0000
commit e3c42855205e233688c851a0f4ce8fe9a0442866 (patch)
tree da543f5afd40a205afe2536af344af07de44c3a6 /lib/libcxxrt/Version.map
parent a4806d2a62fb733970b96f438fedb929b564e08c (diff)
download src-e3c42855205e233688c851a0f4ce8fe9a0442866.tar.gz
src-e3c42855205e233688c851a0f4ce8fe9a0442866.zip

Surround any unmangled C++ names in libcxxrt's version map with 'extern
"C++"', otherwise ld refuses to make the symbols global in the final library. This causes the __int128-related symbols to go missing when the library is stripped during installation.

Helpful hints: emaste MFC after: 2 weeks X-MFC-With: r314061


The big questions seem to be:

) How you ended up with /lib/libcxxrt.so.1 being so out of date.

) What else might not be of the proper vintage?

===
Mark Millard
marklmi at yahoo.com