https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108969
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
--- a/libstdc++-v3/src/c++98/globals_io.cc
+++ b/libstdc++-v3/src/c++98/globals_io.cc
@@ -43,6 +43,12 @@
// In macro form:
// _GLIBCXX_ASM_SYMVER(currentname, oldname, GLIBCXX_3.2)
+#if __has_attribute(symver) && !_GLIBCXX_INLINE_VERSION
+# define SYMVER(sym) __attribute__((symver(#sym "@@GLIBCXX_3.4.31")))
+#else
+# define SYMVER(sym)
+#endif
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -53,20 +59,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__attribute__ ((aligned(__alignof__(istream))));
typedef char fake_ostream[sizeof(ostream)]
__attribute__ ((aligned(__alignof__(ostream))));
- fake_istream cin;
- fake_ostream cout;
- fake_ostream cerr;
- fake_ostream clog;
+ SYMVER(_ZSt3cin) fake_istream cin;
+ SYMVER(_ZSt4cout) fake_ostream cout;
+ SYMVER(_ZSt4cerr) fake_ostream cerr;
+ SYMVER(_ZSt4clog) fake_ostream clog;
#ifdef _GLIBCXX_USE_WCHAR_T
typedef char fake_wistream[sizeof(wistream)]
__attribute__ ((aligned(__alignof__(wistream))));
typedef char fake_wostream[sizeof(wostream)]
__attribute__ ((aligned(__alignof__(wostream))));
- fake_wistream wcin;
- fake_wostream wcout;
- fake_wostream wcerr;
- fake_wostream wclog;
+ SYMVER(_ZSt4wcin) fake_wistream wcin;
+ SYMVER(_ZSt5wcout) fake_wostream wcout;
+ SYMVER(_ZSt5wcerr) fake_wostream wcerr;
+ SYMVER(_ZSt5wclog) fake_wostream wclog;
#endif
#include "ios_base_init.h"