https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108969
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #8) > Unfortunately we build libstdc++ objects just once because even libstdc++.a > contains -fPIC code. So not sure how to arrange it to be libstdc++.so only. We have a handful of objects which are built without --tag disable-shared in LTCXXCOMPILE, see src/Makefile.am So if we use that approach for globals_io.cc then we can check if _GLIBCXX_SHARED is defined to tell whether we're going into the .so or not.