My understanding is the following:
libstdc++ is mostly backwards compatible, but nowhere near forward
compatible. If we ever use more than one libstdc++, we want to use the
newest for all dependencies.
If it's a leaf C++ package, it's easy - just use the newer GCC to build
it too, and by using g++ it will pull in the newer libstdc++ always.
Most packages that needed it were probably like this. Also, leaf
packages being broken is easy to miss.
If it's a C package, it becomes problematic. using a newer GCC isn't
sufficient to guarantee that a newer libstdc++ will be picked, and it
depends on the link order.
Now we have packages like icu and MesaLib requiring it, which have very
many dependencies, so the chance of encountering the broken scenario is
likely.
NetBSD specifically has an extra complication because it major bumped
libstdc++ in base but pkgsrc GCC still creates the old soname.
I think libstdc++.so.7 and libstdc++.so.6 appear as different libraries?
That should probably be fixed.
I should restore the change to make MesaLib not use the dri option for
older compilers, but luckily it is also controllable by options.