C++ GLIBCXX_3.4.30 not found

Now problem building TeX(life) on FreeBSD 14.0:

gmake[5]: Entering directory '/usr/opt/TeX/src/BUILD/libs/icu/icu-build/data'
/bin/sh /usr/opt/TeX/src/texlive-20240511-source/libs/icu/icu-src/source/mkinstalldirs ./out/tmp ./out/build/icudt74l
Unpacking /usr/opt/TeX/src/texlive-20240511-source/libs/icu/icu-src/source/data/in/icudt74l.dat and generating out/tmp/icudata.lst (list of data files)
LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH ../bin/icupkg -d ./out/build/icudt74l --list -x \* /usr/opt/TeX/src/texlive-20240511-source/libs/icu/icu-src/source/data/in/icudt74l.dat -o out/tmp/icudata.lst
ld-elf.so.1: /usr/local/lib/gcc11/libstdc++.so.6: version GLIBCXX_3.4.30 required by /usr/opt/TeX/src/BUILD/libs/icu/icu-build/bin/icupkg not found
gmake[5]: *** [Makefile:272: out/tmp/icudata.lst] Error 1

What I did? What I since many years without problems do!

mkdir texlive-YYYYMMDD-source
rsync -a --delete --exclude=.svn --exclude=Work tug.org::tldevsrc/Build/source/ texlive-YYYYMMDD-source/
mkdir BUILD
cd BUILD
../texlive-YYYYMMDD-source/configure \
--prefix=/path-to-somewhere \
--disable-multiplatform \
--disable-debug \
--disable-all-pkgs \
--enable-web2c \
--enable-tex \
--enable-mf \
--enable-mf-nowin \
--with-mf-x-toolkit \
--with-x \
--enable-pdftex \
--enable-dvipsk \
--enable-xdvik \
--enable-ps2eps \
--with-xdvi-x-toolkit=xaw \
--enable-dvi2tty \
--enable-dvidvi \
--enable-dviljk \
MAKE=gmake

And then gmake.

I would prefer to use packages, but tex is spread in many packages, and either I do not get enough
or get a tar-bomb with many gigabytes. The above procedure worked since years.

And yes, also this is too much, for TeX one does not need C++, and the unnecessary C++ makes the problem.

I have gcc and g++ in versions 11, 12 and 13 as package dependencies in the system.
Perhaps comes the problem from there?

TeXlife is an awful bloat bloat.
 
How did you end up with that?

That was in source that compiled and worked in previous versions of FreeBSD:

texlive-20240511-source/libs/icu/icu-src/source/tools/icupkg/icupkg.cpp

# configure --help
...
--with-system-icu use installed ICU headers and libraries (requires
pkg-config or icu-config)
I did not use that flag. But if I use it, I get when running configure:

...
checking for freetype-config... no
checking for pkg-config... (cached) pkg-config
checking for icu-config... icu-config
checking for pkg-config... (cached) pkg-config
checking requested system `icu' library... ok
configure: error: you can not use system libraries for a native TeX Live build
 
I find strange that it writes:

ld-elf.so.1: /usr/local/lib/gcc11/libstdc++.so.6

although I am using gcc13.
 
What does `file icupkg` say?
% file icupkg
icupkg: cannot open `icupkg' (No such file or directory)

% echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin:/root/sbin:/usr/opt/bin

I have just deleted gcc11 and gcc12, no package depends on it and am compiling again (very slow).
If again appears an error with /usr/local/lib/gcc11/, then gcc11 is embedded in the source,
then I would reinstall gcc11 and do

CC=gcc11 CXX=g++11 configure ...

Some versions of configure take these definitions after the command, but in this case it seems to accept them
only as environment variables. Of what it depends?

I never understood this "configure" system, the old way by editing Makefiles was better ...
 
You need ...
No need.

Deleting gcc11 and gcc12 and leaving gcc13 was enough.

Now, the big question:

Why it tried to read libraries from gcc11, although it worked with gcc13 and g++13 (named gcc and g++)?

Is it a problem of TexLive or FreeBSD 14?

Will it happen with other software?
 
Look at your log. This executable is invoked.

../bin/icupkg -d ...

This inside the source being compiled.

If you want to find out you have to reproduce the error and diagnose it.

With gcc11 and gcc13 installed, comes above error, with only gcc13, it builds. That is the reproduction. But why?!

General question: how it is decided, what /usr/local/lib/gccXX/libstdc++.so.6 library to use?
Namely, of what gccXX?

Perhaps the first given by ldconfig -r? Unless explicitly given by configure-system?

There were two libstdc++.so.6, namely
/usr/local/lib/gcc11/libstdc++.so.6
/usr/local/lib/gcc13/libstdc++.so.6
 
On second thought, it looks like /usr/local/lib/gcc11/libstdc++.so.6: is your Linux binary.

You seem to have a Linux install of gcc11.
 
I thought you had gcc11 deinstalled?
That is why a wrote: "There were two libstdc++.so.6, namely ..."

# file /usr/local/lib/gcc11/libstdc++.so.6
/usr/local/lib/gcc11/libstdc++.so.6: cannot open `/usr/local/lib/gcc11/libstdc++.so.6' (No such file or directory)
# file /usr/local/lib/gcc13/libstdc++.so.6
/usr/local/lib/gcc13/libstdc++.so.6: symbolic link to libstdc++.so.6.0.32
# file /usr/local/lib/gcc13/libstdc++.so.6.0.32
/usr/local/lib/gcc13/libstdc++.so.6.0.32: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped

If you google "GLIBCXX_3.4.30", you find that there are more people having this problem.
And it seems that it has to do with this program "icu" that was included in TexLive.

I suspect, it is not completely specified in configure what file to use, and the OS selects one.
 
That needs understanding of GNU autoconf, I am far away of that.

"ld-elf.so.1: /usr/local/lib/gcc11/libstdc++.so.6: version GLIBCXX_3.4.30 required by /usr/opt/TeX/src/BUILD/libs/icu/icu-build/bin/icupkg not found"

That is some Linux binary. Finding it has nothing to do with autoconf.
 
file /usr/opt/TeX/src/BUILD/libs/icu/icu-build/bin/icupkg
/usr/opt/TeX/BUILD/libs/icu/icu-build/bin/icupkg: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 14.0 (1400097), FreeBSD-style, with debug_info, not stripped
 
I could not find texlive-20240511-source (there seem to be only 20240311-source on CTAN), so I did not check myself, but in the source of icu shipped with texlive, there should be a line like:
Code:
                __asm__(".symver memcpy, memcpy@GLIBC_2.2.5");
You should wrap it with
Code:
#ifdef __LINUX__
, so that it will not be effective with FreeBSD.
 
You should wrap it with
Is that inline gnu assembly? Should not gnu under FreeBSD understand it? And no consequences wrapping it?

And what about my "solution" till next building: to delete gcc11 and gcc12? It seems it is working.

Of course, it seems, I do not know the consequences ...
 
Back
Top