Add an ifdef _GLIBCXX_COMPAT_ that removes the versioned symbol nodes from libstdc++ and enable it for now only for the random archives but not for the shared object (although it does not break anything that I've tested to enable it for the shared object too). Fixes static linking, which does not handle multiple versioned symbols properly.diff -r1.1.1.4 -r1.2 src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
(christos)
--- src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc 2019/01/19 10:14:04 1.1.1.4
+++ src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc 2019/04/23 20:55:53 1.2
@@ -140,21 +140,25 @@ _GLIBCXX_END_NAMESPACE_VERSION | @@ -140,21 +140,25 @@ _GLIBCXX_END_NAMESPACE_VERSION | |||
140 | // gcc-4.5.0 | 140 | // gcc-4.5.0 | |
141 | // <atomic> signature changes | 141 | // <atomic> signature changes | |
142 | 142 | |||
143 | // The rename syntax for default exported names is | 143 | // The rename syntax for default exported names is | |
144 | // asm (".symver name1,exportedname@GLIBCXX_3.4") | 144 | // asm (".symver name1,exportedname@GLIBCXX_3.4") | |
145 | // asm (".symver name2,exportedname@@GLIBCXX_3.4.5") | 145 | // asm (".symver name2,exportedname@@GLIBCXX_3.4.5") | |
146 | // In the future, GLIBCXX_ABI > 6 should remove all uses of | 146 | // In the future, GLIBCXX_ABI > 6 should remove all uses of | |
147 | // _GLIBCXX_*_SYMVER macros in this file. | 147 | // _GLIBCXX_*_SYMVER macros in this file. | |
148 | 148 | |||
149 | #if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \ | 149 | #if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \ | |
150 | && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ | 150 | && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ | |
151 | && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) | 151 | && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) | |
152 | 152 | |||
153 | #ifdef _GLIBCXX_COMPAT_ | |||
153 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) \ | 154 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) \ | |
154 | asm (".symver " #cur "," #old "@@" #version); | 155 | asm (".symver " #cur "," #old "@@" #version); | |
156 | #else | |||
157 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) | |||
158 | #endif | |||
155 | 159 | |||
156 | _GLIBCXX_ASM_SYMVER(_ZNSt9__atomic011atomic_flag5clearESt12memory_order, _ZNVSt9__atomic011atomic_flag5clearESt12memory_order, GLIBCXX_3.4.11) | 160 | _GLIBCXX_ASM_SYMVER(_ZNSt9__atomic011atomic_flag5clearESt12memory_order, _ZNVSt9__atomic011atomic_flag5clearESt12memory_order, GLIBCXX_3.4.11) | |
157 | 161 | |||
158 | _GLIBCXX_ASM_SYMVER(_ZNSt9__atomic011atomic_flag12test_and_setESt12memory_order, _ZNVSt9__atomic011atomic_flag12test_and_setESt12memory_order, GLIBCXX_3.4.11) | 162 | _GLIBCXX_ASM_SYMVER(_ZNSt9__atomic011atomic_flag12test_and_setESt12memory_order, _ZNVSt9__atomic011atomic_flag12test_and_setESt12memory_order, GLIBCXX_3.4.11) | |
159 | 163 | |||
160 | #endif | 164 | #endif |
--- src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc 2019/01/19 10:14:05 1.1.1.4
+++ src/external/gpl3/gcc/dist/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc 2019/04/23 20:55:53 1.2
@@ -25,28 +25,32 @@ | @@ -25,28 +25,32 @@ | |||
25 | #include <bits/c++config.h> | 25 | #include <bits/c++config.h> | |
26 | #if defined(_GLIBCXX_SHARED) | 26 | #if defined(_GLIBCXX_SHARED) | |
27 | #define _GLIBCXX_ASYNC_ABI_COMPAT | 27 | #define _GLIBCXX_ASYNC_ABI_COMPAT | |
28 | #endif | 28 | #endif | |
29 | 29 | |||
30 | #include <future> | 30 | #include <future> | |
31 | #include <mutex> | 31 | #include <mutex> | |
32 | #include <functional> | 32 | #include <functional> | |
33 | 33 | |||
34 | #if __cplusplus < 201103L | 34 | #if __cplusplus < 201103L | |
35 | # error "compatibility-thread-c++0x.cc must be compiled with -std=gnu++0x" | 35 | # error "compatibility-thread-c++0x.cc must be compiled with -std=gnu++0x" | |
36 | #endif | 36 | #endif | |
37 | 37 | |||
38 | #ifdef _GLIBCXX_COMPAT_ | |||
38 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) \ | 39 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) \ | |
39 | asm (".symver " #cur "," #old "@@@" #version); | 40 | asm (".symver " #cur "," #old "@@@" #version); | |
41 | #else | |||
42 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) | |||
43 | #endif | |||
40 | 44 | |||
41 | // XXX GLIBCXX_ABI Deprecated | 45 | // XXX GLIBCXX_ABI Deprecated | |
42 | // gcc-4.6.0 | 46 | // gcc-4.6.0 | |
43 | // <future> export changes | 47 | // <future> export changes | |
44 | #if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \ | 48 | #if defined(_GLIBCXX_SYMVER_GNU) && defined(_GLIBCXX_SHARED) \ | |
45 | && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ | 49 | && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ | |
46 | && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) | 50 | && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) | |
47 | 51 | |||
48 | namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) | 52 | namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) | |
49 | { | 53 | { | |
50 | const std::error_category* future_category = &std::future_category(); | 54 | const std::error_category* future_category = &std::future_category(); | |
51 | } | 55 | } | |
52 | 56 |
--- src/external/gpl3/gcc/dist/libstdc++-v3/src/c++98/compatibility.cc 2019/01/19 12:10:14 1.3
+++ src/external/gpl3/gcc/dist/libstdc++-v3/src/c++98/compatibility.cc 2019/04/23 20:55:53 1.4
@@ -355,40 +355,46 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | @@ -355,40 +355,46 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | |||
355 | bool | 355 | bool | |
356 | basic_ofstream<wchar_t>::is_open() const; | 356 | basic_ofstream<wchar_t>::is_open() const; | |
357 | #endif | 357 | #endif | |
358 | 358 | |||
359 | _GLIBCXX_END_NAMESPACE_VERSION | 359 | _GLIBCXX_END_NAMESPACE_VERSION | |
360 | } // namespace std | 360 | } // namespace std | |
361 | 361 | |||
362 | // The rename syntax for default exported names is | 362 | // The rename syntax for default exported names is | |
363 | // asm (".symver name1,exportedname@GLIBCXX_3.4") | 363 | // asm (".symver name1,exportedname@GLIBCXX_3.4") | |
364 | // asm (".symver name2,exportedname@@GLIBCXX_3.4.5") | 364 | // asm (".symver name2,exportedname@@GLIBCXX_3.4.5") | |
365 | // In the future, GLIBCXX_ABI > 6 should remove all uses of | 365 | // In the future, GLIBCXX_ABI > 6 should remove all uses of | |
366 | // _GLIBCXX_*_SYMVER macros in this file. | 366 | // _GLIBCXX_*_SYMVER macros in this file. | |
367 | 367 | |||
368 | #ifdef _GLIBCXX_COMPAT_ | |||
368 | #define _GLIBCXX_3_4_SYMVER(XXname, name) \ | 369 | #define _GLIBCXX_3_4_SYMVER(XXname, name) \ | |
369 | extern "C" void \ | 370 | extern "C" void \ | |
370 | _X##name() \ | 371 | _X##name() \ | |
371 | __attribute__ ((alias(#XXname))); \ | 372 | __attribute__ ((alias(#XXname))); \ | |
372 | asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4"); | 373 | asm (".symver " "_X" #name "," #name "@GLIBCXX_3.4"); | |
373 | 374 | |||
374 | #define _GLIBCXX_3_4_5_SYMVER(XXname, name) \ | 375 | #define _GLIBCXX_3_4_5_SYMVER(XXname, name) \ | |
375 | extern "C" void \ | 376 | extern "C" void \ | |
376 | _Y##name() \ | 377 | _Y##name() \ | |
377 | __attribute__ ((alias(#XXname))); \ | 378 | __attribute__ ((alias(#XXname))); \ | |
378 | asm (".symver " "_Y" #name "," #name "@@GLIBCXX_3.4.5"); | 379 | asm (".symver " "_Y" #name "," #name "@@GLIBCXX_3.4.5"); | |
379 | 380 | |||
380 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) \ | 381 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) \ | |
381 | asm (".symver " #cur "," #old "@@" #version); | 382 | asm (".symver " #cur "," #old "@@" #version); | |
383 | #else | |||
384 | #define _GLIBCXX_3_4_SYMVER(XXname, name) | |||
385 | #define _GLIBCXX_3_4_5_SYMVER(XXname, name) | |||
386 | #define _GLIBCXX_ASM_SYMVER(cur, old, version) | |||
387 | #endif | |||
382 | 388 | |||
383 | #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_SYMVER | 389 | #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_SYMVER | |
384 | #include <abi/compatibility.h> | 390 | #include <abi/compatibility.h> | |
385 | #undef _GLIBCXX_APPLY_SYMVER | 391 | #undef _GLIBCXX_APPLY_SYMVER | |
386 | 392 | |||
387 | #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_5_SYMVER | 393 | #define _GLIBCXX_APPLY_SYMVER _GLIBCXX_3_4_5_SYMVER | |
388 | #include <abi/compatibility.h> | 394 | #include <abi/compatibility.h> | |
389 | #undef _GLIBCXX_APPLY_SYMVER | 395 | #undef _GLIBCXX_APPLY_SYMVER | |
390 | 396 | |||
391 | 397 | |||
392 | /* gcc-3.4.0 | 398 | /* gcc-3.4.0 | |
393 | _ZN10__gnu_norm15_List_node_base4hookEPS0_; | 399 | _ZN10__gnu_norm15_List_node_base4hookEPS0_; | |
394 | _ZN10__gnu_norm15_List_node_base4swapERS0_S1_; | 400 | _ZN10__gnu_norm15_List_node_base4swapERS0_S1_; |
--- src/external/gpl3/gcc/dist/libstdc++-v3/src/c++98/istream.cc 2019/01/19 10:14:04 1.1.1.4
+++ src/external/gpl3/gcc/dist/libstdc++-v3/src/c++98/istream.cc 2019/04/23 20:55:53 1.2
@@ -102,28 +102,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | @@ -102,28 +102,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | |||
102 | *__s = char_type(); | 102 | *__s = char_type(); | |
103 | if (!_M_gcount) | 103 | if (!_M_gcount) | |
104 | __err |= ios_base::failbit; | 104 | __err |= ios_base::failbit; | |
105 | if (__err) | 105 | if (__err) | |
106 | this->setstate(__err); | 106 | this->setstate(__err); | |
107 | return *this; | 107 | return *this; | |
108 | } | 108 | } | |
109 | 109 | |||
110 | template<> | 110 | template<> | |
111 | basic_istream<char>& | 111 | basic_istream<char>& | |
112 | basic_istream<char>:: | 112 | basic_istream<char>:: | |
113 | ignore(streamsize __n, int_type __delim) | 113 | ignore(streamsize __n, int_type __delim) | |
114 | { | 114 | { | |
115 | #ifdef _GLIBCXX_COMPAT_ | |||
115 | if (traits_type::eq_int_type(__delim, traits_type::eof())) | 116 | if (traits_type::eq_int_type(__delim, traits_type::eof())) | |
116 | return ignore(__n); | 117 | return ignore(__n); | |
118 | #endif | |||
117 | 119 | |||
118 | _M_gcount = 0; | 120 | _M_gcount = 0; | |
119 | sentry __cerb(*this, true); | 121 | sentry __cerb(*this, true); | |
120 | if (__n > 0 && __cerb) | 122 | if (__n > 0 && __cerb) | |
121 | { | 123 | { | |
122 | ios_base::iostate __err = ios_base::goodbit; | 124 | ios_base::iostate __err = ios_base::goodbit; | |
123 | __try | 125 | __try | |
124 | { | 126 | { | |
125 | const char_type __cdelim = traits_type::to_char_type(__delim); | 127 | const char_type __cdelim = traits_type::to_char_type(__delim); | |
126 | const int_type __eof = traits_type::eof(); | 128 | const int_type __eof = traits_type::eof(); | |
127 | __streambuf_type* __sb = this->rdbuf(); | 129 | __streambuf_type* __sb = this->rdbuf(); | |
128 | int_type __c = __sb->sgetc(); | 130 | int_type __c = __sb->sgetc(); | |
129 | 131 | |||
@@ -344,28 +346,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | @@ -344,28 +346,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION | |||
344 | *__s = char_type(); | 346 | *__s = char_type(); | |
345 | if (!_M_gcount) | 347 | if (!_M_gcount) | |
346 | __err |= ios_base::failbit; | 348 | __err |= ios_base::failbit; | |
347 | if (__err) | 349 | if (__err) | |
348 | this->setstate(__err); | 350 | this->setstate(__err); | |
349 | return *this; | 351 | return *this; | |
350 | } | 352 | } | |
351 | 353 | |||
352 | template<> | 354 | template<> | |
353 | basic_istream<wchar_t>& | 355 | basic_istream<wchar_t>& | |
354 | basic_istream<wchar_t>:: | 356 | basic_istream<wchar_t>:: | |
355 | ignore(streamsize __n, int_type __delim) | 357 | ignore(streamsize __n, int_type __delim) | |
356 | { | 358 | { | |
359 | #ifdef _GLIBCXX_COMPAT_ | |||
357 | if (traits_type::eq_int_type(__delim, traits_type::eof())) | 360 | if (traits_type::eq_int_type(__delim, traits_type::eof())) | |
358 | return ignore(__n); | 361 | return ignore(__n); | |
362 | #endif | |||
359 | 363 | |||
360 | _M_gcount = 0; | 364 | _M_gcount = 0; | |
361 | sentry __cerb(*this, true); | 365 | sentry __cerb(*this, true); | |
362 | if (__n > 0 && __cerb) | 366 | if (__n > 0 && __cerb) | |
363 | { | 367 | { | |
364 | ios_base::iostate __err = ios_base::goodbit; | 368 | ios_base::iostate __err = ios_base::goodbit; | |
365 | __try | 369 | __try | |
366 | { | 370 | { | |
367 | const char_type __cdelim = traits_type::to_char_type(__delim); | 371 | const char_type __cdelim = traits_type::to_char_type(__delim); | |
368 | const int_type __eof = traits_type::eof(); | 372 | const int_type __eof = traits_type::eof(); | |
369 | __streambuf_type* __sb = this->rdbuf(); | 373 | __streambuf_type* __sb = this->rdbuf(); | |
370 | int_type __c = __sb->sgetc(); | 374 | int_type __c = __sb->sgetc(); | |
371 | 375 |
--- src/external/gpl3/gcc/lib/libstdc++-v3/Makefile 2019/03/20 05:09:27 1.46
+++ src/external/gpl3/gcc/lib/libstdc++-v3/Makefile 2019/04/23 20:55:53 1.47
@@ -1,33 +1,35 @@ | @@ -1,33 +1,35 @@ | |||
1 | # $NetBSD: Makefile,v 1.46 2019/03/20 05:09:27 mrg Exp $ | 1 | # $NetBSD: Makefile,v 1.47 2019/04/23 20:55:53 christos Exp $ | |
2 | 2 | |||
3 | REQUIRETOOLS= yes | 3 | REQUIRETOOLS= yes | |
4 | NOLINT= # defined | 4 | NOLINT= # defined | |
5 | UNSUPPORTED_COMPILER.clang= # defined | 5 | UNSUPPORTED_COMPILER.clang= # defined | |
6 | 6 | |||
7 | .include <bsd.init.mk> | 7 | .include <bsd.init.mk> | |
8 | 8 | |||
9 | .include "Makefile.inc" | 9 | .include "Makefile.inc" | |
10 | 10 | |||
11 | LIB= stdc++ | 11 | LIB= stdc++ | |
12 | 12 | |||
13 | LIBDPLIBS+= m ${.CURDIR}/../../../../../lib/libm | 13 | LIBDPLIBS+= m ${.CURDIR}/../../../../../lib/libm | |
14 | 14 | |||
15 | #COPTS+= -pthread | 15 | #COPTS+= -pthread | |
16 | #LDFLAGS+= -pthread | 16 | #LDFLAGS+= -pthread | |
17 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" | 17 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" | |
18 | COPTS.random.cc+= ${${ACTIVE_CC} == "clang":? -mrdrnd :} | 18 | COPTS.random.cc+= ${${ACTIVE_CC} == "clang":? -mrdrnd :} | |
19 | .endif | 19 | .endif | |
20 | 20 | |||
21 | CSHLIBFLAGS+= -D_GLIBCXX_COMPAT_ | |||
22 | ||||
21 | DIST= ${GCCDIST} | 23 | DIST= ${GCCDIST} | |
22 | GNUVER= ${DIST}/libstdc++-v3/config/abi/pre/gnu.ver | 24 | GNUVER= ${DIST}/libstdc++-v3/config/abi/pre/gnu.ver | |
23 | SYMBOLS= libstdc++-symbols.ver | 25 | SYMBOLS= libstdc++-symbols.ver | |
24 | .if ${MKPIC} != "no" | 26 | .if ${MKPIC} != "no" | |
25 | ${SYMBOLS}: Makefile ${GNUVER} | 27 | ${SYMBOLS}: Makefile ${GNUVER} | |
26 | cat ${GNUVER} ${G_port_specific_symbol_files} | \ | 28 | cat ${GNUVER} ${G_port_specific_symbol_files} | \ | |
27 | ${TOOL_GREP} -E -v '^[ ]*#(#| |$$)' | \ | 29 | ${TOOL_GREP} -E -v '^[ ]*#(#| |$$)' | \ | |
28 | ${CXX} -I${DESTDIR}/usr/include/g++ -E -P -include ${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH}/symver-config.h - > \ | 30 | ${CXX} -I${DESTDIR}/usr/include/g++ -E -P -include ${.CURDIR}/arch/${LIBSTDCXX_MACHINE_ARCH}/symver-config.h - > \ | |
29 | ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET} && rm -f ${.TARGET}.tmp | 31 | ${.TARGET}.tmp && mv ${.TARGET}.tmp ${.TARGET} && rm -f ${.TARGET}.tmp | |
30 | 32 | |||
31 | CLEANFILES+= ${SYMBOLS} ${SYMBOLS}.tmp | 33 | CLEANFILES+= ${SYMBOLS} ${SYMBOLS}.tmp | |
32 | 34 | |||
33 | DPADD+= ${SYMBOLS} | 35 | DPADD+= ${SYMBOLS} |