G++ and libsupc++

The libsupc++ for x86_64 has disappeared from Centos-stream 8, Rocky 8, Rocky 9.

It normally lives in

$ find /usr/lib -name libsupc* -print                                                                                    
/usr/lib/gcc/x86_64-redhat-linux/13/libsupc++.a
/usr/lib/gcc/x86_64-redhat-linux/13/32/libsupc++.a
/usr/lib/gcc/i686-redhat-linux/13/libsupc++.a

All Fedoras up through 39 have (gcc 13 is from FC39, above) and the old Centos 8 had it (gcc version 8.3.1-5).

The 32 bit version exists in all repos, but the x86_64 version is gone.

Was it deprecated?

For RL9:
dnf install gcc-toolset-13-gcc-c++

thaks. did that and did this

$ dnf remove gcc-g++ gcc
$ update-alternatives --install /usr/bin/gcc gcc /opt/rh/gcc-toolset-13/root/usr/bin/gcc 60
$ update-alternatives --install /usr/bin/g++ g++ /opt/rh/gcc-toolset-13/root/usr/bin/g++ 60
$ update-alternatives --install /usr/lib/cpp cpp /opt/rh/gcc-toolset-13/root/usr/bin/cpp 60

You can get a list of packages that provide filename with:

dnf provides */libsupc++.a

(dnf naturally seeks only from the enabled repositories.)

AlmaLinux 9 seems to have /usr/lib/gcc/x86_64-redhat-linux/11/32/libsupc++.a
in gcc-c++-11.4.1-3.el9.alma.1.x86_64
and the /usr/lib/gcc/{i686,x86_64}-redhat-linux/11/libsupc++.a
in libstdc++-static-11.4.1-3.el9.alma.1.{i686,x86_64}


The GCC Toolsets continue the Red Hat Software Collections (SCL) setup, where one can:

[jlehtone@al9 ~]$ which gcc
/usr/bin/gcc
[jlehtone@al9 ~]$ scl enable gcc-toolset-13 bash
[jlehtone@al9 ~]$ which gcc
/opt/rh/gcc-toolset-13/root/usr/bin/gcc
[jlehtone@al9 ~]$ exit
exit
[jlehtone@al9 ~]$ which gcc
/usr/bin/gcc

That is, the scl command starts a process (bash in the example above) with environment modified by /opt/rh/${XXX}/enable files (XXX=gcc-toolset-13 in the example). See man scl.
(The scl load calls module from environment-modules.)

Binaries built within environment can be run without the environment. The idea of SCL (introduced for RHEL 7 and 6) was to be able to install more than one version simultaneously (without unique filenames). RHEL 8 introduced application streams that do not allow simultaneous install and use, but the GCC Toolset continues with SCL idiom.

All distros I’ve looked have an i686 version of the library but do not have x86_64 libraries, except for Fedora and old Centos 8, which do have both (and the gcc toolset environments).

I would suspect that this breaks some RPM builds, but I guess this is not the case. The supc++ library is a static version of libstdc++ which does not have the stl containers, only the c++ language (exception) support. It is useful because you do not need libstdc++.so at runtime, only libc.

Yes, I wonder what they’ll think of next in the world of scl, modules, streams, containers, flatpaks and so on…

The Centos 8 and Fedora versions is also in libstdc+±static rpm:

# Centos 8
$ lsb_release -rs                                                                                                        
8.3.2011
$ rpmquery -ql libstdc++-static                                                                                          
/usr/lib/gcc
/usr/lib/gcc/i686-redhat-linux
/usr/lib/gcc/i686-redhat-linux/8
/usr/lib/gcc/i686-redhat-linux/8/libstdc++.a
/usr/lib/gcc/i686-redhat-linux/8/libsupc++.a
/usr/lib/gcc
/usr/lib/gcc/x86_64-redhat-linux
/usr/lib/gcc/x86_64-redhat-linux/8
/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.a
/usr/lib/gcc/x86_64-redhat-linux/8/libsupc++.a

# Fedora 38
$ lsb_release -rs                                                                                                        
38
$ rpmquery -ql libstdc++-static                                                                                          
/usr/lib/gcc
/usr/lib/gcc/i686-redhat-linux
/usr/lib/gcc/i686-redhat-linux/13
/usr/lib/gcc/i686-redhat-linux/13/libstdc++.a
/usr/lib/gcc/i686-redhat-linux/13/libsupc++.a
/usr/lib/gcc
/usr/lib/gcc/x86_64-redhat-linux
/usr/lib/gcc/x86_64-redhat-linux/13
/usr/lib/gcc/x86_64-redhat-linux/13/libstdc++.a
/usr/lib/gcc/x86_64-redhat-linux/13/libsupc++.a

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.