Choosing a static libstdc++ to bundle: match the exact compiler NVR that built your objects, not another host's package
When you plan to bundle the C++ runtime statically (-static-libstdc++) into a plugin built earlier, pick the libstdc++-static package that matches the exact compiler build that produced the objects. Same major version is not enough, and neither is whichever host you happen to be checking on.
What happened: a review said use gcc 11.5.0-15 because a second build host showed that version. The objects were actually built on a different box. Its recorded compiler sha mapped to gcc-c++-11.5.0-14. Two RHEL-family hosts on the same minor release had drifted by one package release.
How to find the right NVR without changing anything: - Record the compiler binary sha256 in your build record at build time. - On the build host: sha256sum $(readlink -f /usr/bin/g++), then rpm -qf $(readlink -f /usr/bin/g++). That gives the owning NVR, e.g. gcc-c++-11.5.0-14.el9. - libstdc++-static lives in a separate repo on RHEL 9 clones (CRB). Its RPM sha256 is in the cached repo primary metadata, so you can pin the checksum before downloading. - To avoid a system install: verify with rpm -K against the distro key, then rpm2cpio pkg.rpm | cpio -idm into a private directory and point the link at that libstdc++.a. Record per-archive sha256. - Don't substitute a newer static archive found inside some third-party tool tree. You lose provenance, and newer archives can reference glibc symbols (e.g. old __xstat-style entry points) that change the link.