summaryrefslogtreecommitdiffstats
path: root/gcc47-libstdc.patch
blob: 45ff50e9b204a1e79d9d08bfd70f290cfc6beb4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
--- origsrc/gcc-4.7.2/libstdc++-v3/config/os/mingw32/os_defines.h	2011-12-16 18:43:06.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/config/os/mingw32/os_defines.h	2012-10-31 16:49:35.703125000 +0000
@@ -72,4 +72,10 @@
 #define _GLIBCXX_CDTOR_CALLABI __thiscall
 #endif
 
+#ifdef _DLL
+#define _GLIBCXX_IMPORT __attribute__((dllimport))
+#else
+#define _GLIBCXX_IMPORT
+#endif
+
 #endif
--- origsrc/gcc-4.7.2/libstdc++-v3/config/os/newlib/os_defines.h	2011-01-03 20:52:22.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/config/os/newlib/os_defines.h	2012-10-31 16:49:35.734375000 +0000
@@ -35,6 +35,8 @@
 
 #ifdef __CYGWIN__
 #define _GLIBCXX_GTHREAD_USE_WEAK 0
+#define __GXX_MERGED_TYPEINFO_NAMES 0
+#define __GXX_TYPEINFO_EQUALITY_INLINE 0
 
 #if defined (_GLIBCXX_DLL)
 #define _GLIBCXX_PSEUDO_VISIBILITY_default __attribute__ ((__dllimport__))
@@ -47,6 +49,13 @@
 
 // See libstdc++/20806.
 #define _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM 1
+
+#ifdef _DLL
+#define _GLIBCXX_IMPORT __attribute__((dllimport))
+#else
+#define _GLIBCXX_IMPORT
+#endif
+
 #endif
 
 #endif
--- origsrc/gcc-4.7.2/libstdc++-v3/include/backward/strstream	2011-02-01 01:31:42.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/backward/strstream	2012-10-31 16:49:37.468750000 +0000
@@ -62,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   // Class strstreambuf, a streambuf class that manages an array of char.
   // Note that this class is not a template.
-  class strstreambuf : public basic_streambuf<char, char_traits<char> >
+  class _GLIBCXX_IMPORT strstreambuf : public basic_streambuf<char, char_traits<char> >
   {
   public:
     // Types.
@@ -124,7 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 
   // Class istrstream, an istream that manages a strstreambuf.
-  class istrstream : public basic_istream<char>
+  class _GLIBCXX_IMPORT istrstream : public basic_istream<char>
   {
   public:
     explicit istrstream(char*);
@@ -141,7 +141,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 
   // Class ostrstream
-  class ostrstream : public basic_ostream<char>
+  class _GLIBCXX_IMPORT ostrstream : public basic_ostream<char>
   {
   public:
     ostrstream();
@@ -158,7 +158,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 
   // Class strstream
-  class strstream : public basic_iostream<char>
+  class _GLIBCXX_IMPORT strstream : public basic_iostream<char>
   {
   public:
     typedef char                        char_type;
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/basic_ios.tcc	2011-03-04 21:51:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/basic_ios.tcc	2012-10-31 16:49:37.468750000 +0000
@@ -176,10 +176,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_ios<char>;
+  extern template class _GLIBCXX_IMPORT basic_ios<char>;
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_ios<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ios<wchar_t>;
 #endif
 #endif
 
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/c++config	2011-11-02 04:23:33.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/c++config	2012-10-31 16:54:57.125000000 +0000
@@ -225,6 +225,9 @@ namespace __gnu_cxx
 # define _GLIBCXX_END_NAMESPACE_VERSION
 #endif
 
+#ifndef _GLIBCXX_IMPORT
+#define _GLIBCXX_IMPORT
+#endif
 
 // Inline namespaces for special modes: debug, parallel, profile.
 #if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL) \
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/codecvt.h	2011-10-14 01:12:40.000000000 +0100
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/codecvt.h	2012-10-31 16:49:37.484375000 +0000
@@ -479,7 +479,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class codecvt_byname<char, char, mbstate_t>;
+  extern template class _GLIBCXX_IMPORT codecvt_byname<char, char, mbstate_t>;
 
   extern template
     const codecvt<char, char, mbstate_t>&
@@ -490,7 +490,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     has_facet<codecvt<char, char, mbstate_t> >(const locale&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class codecvt_byname<wchar_t, char, mbstate_t>;
+  extern template class _GLIBCXX_IMPORT codecvt_byname<wchar_t, char, mbstate_t>;
 
   extern template
     const codecvt<wchar_t, char, mbstate_t>&
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/fstream.tcc	2011-03-04 21:51:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/fstream.tcc	2012-10-31 16:49:37.484375000 +0000
@@ -965,16 +965,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_filebuf<char>;
-  extern template class basic_ifstream<char>;
-  extern template class basic_ofstream<char>;
-  extern template class basic_fstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_filebuf<char>;
+  extern template class _GLIBCXX_IMPORT basic_ifstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_ofstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_fstream<char>;
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_filebuf<wchar_t>;
-  extern template class basic_ifstream<wchar_t>;
-  extern template class basic_ofstream<wchar_t>;
-  extern template class basic_fstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_filebuf<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ifstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ofstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_fstream<wchar_t>;
 #endif
 #endif
 
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/ios_base.h	2011-08-07 08:27:06.000000000 +0100
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/ios_base.h	2012-10-31 16:49:37.484375000 +0000
@@ -198,7 +198,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  people will only see @c ios_base when they need to specify the full
    *  name of the various I/O flags (e.g., the openmodes).
   */
-  class ios_base
+  class _GLIBCXX_IMPORT ios_base
   {
   public:
 
@@ -208,7 +208,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
      *
      *  27.4.2.1.1  Class ios_base::failure
      */
-    class failure : public exception
+    class _GLIBCXX_IMPORT failure : public exception
     {
     public:
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -532,7 +532,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     // Used to initialize standard streams. In theory, g++ could use
     // -finit-priority to order this stuff correctly without going
     // through these machinations.
-    class Init
+    class _GLIBCXX_IMPORT Init
     {
       friend class ios_base;
     public:
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/istream.tcc	2011-03-04 21:51:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/istream.tcc	2012-10-31 16:49:37.484375000 +0000
@@ -1039,7 +1039,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_istream<char>;
+  extern template class _GLIBCXX_IMPORT basic_istream<char>;
   extern template istream& ws(istream&);
   extern template istream& operator>>(istream&, char&);
   extern template istream& operator>>(istream&, char*);
@@ -1062,10 +1062,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   extern template istream& istream::_M_extract(long double&);
   extern template istream& istream::_M_extract(void*&);
 
-  extern template class basic_iostream<char>;
+  extern template class _GLIBCXX_IMPORT basic_iostream<char>;
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_istream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_istream<wchar_t>;
   extern template wistream& ws(wistream&);
   extern template wistream& operator>>(wistream&, wchar_t&);
   extern template wistream& operator>>(wistream&, wchar_t*);
@@ -1084,7 +1084,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   extern template wistream& wistream::_M_extract(long double&);
   extern template wistream& wistream::_M_extract(void*&);
 
-  extern template class basic_iostream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_iostream<wchar_t>;
 #endif
 #endif
 
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_classes.h	2011-12-10 15:33:06.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_classes.h	2012-10-31 16:49:37.484375000 +0000
@@ -61,7 +61,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  This library supports efficient construction and copying of locales
    *  through a reference counting implementation of the locale class.
   */
-  class locale
+  class _GLIBCXX_IMPORT locale
   {
   public:
     // Types:
@@ -69,9 +69,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     typedef int	category;
 
     // Forward decls and friends:
-    class facet;
-    class id;
-    class _Impl;
+    class _GLIBCXX_IMPORT facet;
+    class _GLIBCXX_IMPORT id;
+    class _GLIBCXX_IMPORT _Impl;
 
     friend class facet;
     friend class _Impl;
@@ -337,7 +337,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *
    *  Facets may not be copied or assigned.
   */
-  class locale::facet
+  class _GLIBCXX_IMPORT locale::facet
   {
   private:
     friend class locale;
@@ -435,7 +435,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  cannot be used in a locale.  The locale::id ensures that each class
    *  type gets a unique identifier.
   */
-  class locale::id
+  class _GLIBCXX_IMPORT locale::id
   {
   private:
     friend class locale;
@@ -474,7 +474,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 
   // Implementation object for locale.
-  class locale::_Impl
+  class _GLIBCXX_IMPORT locale::_Impl
   {
   public:
     // Friends.
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_classes.tcc	2011-12-10 15:33:06.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_classes.tcc	2012-10-31 16:49:37.500000000 +0000
@@ -265,8 +265,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class collate<char>;
-  extern template class collate_byname<char>;
+  extern template class _GLIBCXX_IMPORT collate<char>;
+  extern template class _GLIBCXX_IMPORT collate_byname<char>;
 
   extern template
     const collate<char>&
@@ -277,8 +277,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     has_facet<collate<char> >(const locale&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class collate<wchar_t>;
-  extern template class collate_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT collate<wchar_t>;
+  extern template class _GLIBCXX_IMPORT collate_byname<wchar_t>;
 
   extern template
     const collate<wchar_t>&
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets.h	2012-02-23 22:14:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets.h	2012-10-31 16:49:37.500000000 +0000
@@ -673,7 +673,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  optimizations as well.
   */
   template<>
-    class ctype<char> : public locale::facet, public ctype_base
+    class _GLIBCXX_IMPORT ctype<char> : public locale::facet, public ctype_base
     {
     public:
       // Types:
@@ -1174,7 +1174,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  __ctype_abstract_base<wchar_t>.
   */
   template<>
-    class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
+    class _GLIBCXX_IMPORT ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
     {
     public:
       // Types:
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets.tcc	2011-03-04 21:51:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets.tcc	2012-10-31 17:00:42.531250000 +0000
@@ -1277,11 +1277,11 @@ _GLIBCXX_END_NAMESPACE_LDBL
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class numpunct<char>;
-  extern template class numpunct_byname<char>;
-  extern template class _GLIBCXX_NAMESPACE_LDBL num_get<char>;
-  extern template class _GLIBCXX_NAMESPACE_LDBL num_put<char>;
-  extern template class ctype_byname<char>;
+  extern template class _GLIBCXX_IMPORT numpunct<char>;
+  extern template class _GLIBCXX_IMPORT numpunct_byname<char>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL num_get<char>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL num_put<char>;
+  extern template class _GLIBCXX_IMPORT ctype_byname<char>;
 
   extern template
     const ctype<char>&
@@ -1316,11 +1316,11 @@ _GLIBCXX_END_NAMESPACE_LDBL
     has_facet<num_get<char> >(const locale&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class numpunct<wchar_t>;
-  extern template class numpunct_byname<wchar_t>;
-  extern template class _GLIBCXX_NAMESPACE_LDBL num_get<wchar_t>;
-  extern template class _GLIBCXX_NAMESPACE_LDBL num_put<wchar_t>;
-  extern template class ctype_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT numpunct<wchar_t>;
+  extern template class _GLIBCXX_IMPORT numpunct_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL num_get<wchar_t>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL num_put<wchar_t>;
+  extern template class _GLIBCXX_IMPORT ctype_byname<wchar_t>;
 
   extern template
     const ctype<wchar_t>&
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets_nonio.tcc	2011-03-04 21:51:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/locale_facets_nonio.tcc	2012-10-31 17:00:42.546875000 +0000
@@ -1216,19 +1216,19 @@ _GLIBCXX_END_NAMESPACE_LDBL
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class moneypunct<char, false>;
-  extern template class moneypunct<char, true>;
-  extern template class moneypunct_byname<char, false>;
-  extern template class moneypunct_byname<char, true>;
-  extern template class _GLIBCXX_NAMESPACE_LDBL money_get<char>;
-  extern template class _GLIBCXX_NAMESPACE_LDBL money_put<char>;
-  extern template class __timepunct<char>;
-  extern template class time_put<char>;
-  extern template class time_put_byname<char>;
-  extern template class time_get<char>;
-  extern template class time_get_byname<char>;
-  extern template class messages<char>;
-  extern template class messages_byname<char>;
+  extern template class _GLIBCXX_IMPORT moneypunct<char, false>;
+  extern template class _GLIBCXX_IMPORT moneypunct<char, true>;
+  extern template class _GLIBCXX_IMPORT moneypunct_byname<char, false>;
+  extern template class _GLIBCXX_IMPORT moneypunct_byname<char, true>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL money_get<char>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL money_put<char>;
+  extern template class _GLIBCXX_IMPORT __timepunct<char>;
+  extern template class _GLIBCXX_IMPORT time_put<char>;
+  extern template class _GLIBCXX_IMPORT time_put_byname<char>;
+  extern template class _GLIBCXX_IMPORT time_get<char>;
+  extern template class _GLIBCXX_IMPORT time_get_byname<char>;
+  extern template class _GLIBCXX_IMPORT messages<char>;
+  extern template class _GLIBCXX_IMPORT messages_byname<char>;
 
   extern template
     const moneypunct<char, true>&
@@ -1291,19 +1291,19 @@ _GLIBCXX_END_NAMESPACE_LDBL
     has_facet<messages<char> >(const locale&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class moneypunct<wchar_t, false>;
-  extern template class moneypunct<wchar_t, true>;
-  extern template class moneypunct_byname<wchar_t, false>;
-  extern template class moneypunct_byname<wchar_t, true>;
-  extern template class _GLIBCXX_NAMESPACE_LDBL money_get<wchar_t>;
-  extern template class _GLIBCXX_NAMESPACE_LDBL money_put<wchar_t>;
-  extern template class __timepunct<wchar_t>;
-  extern template class time_put<wchar_t>;
-  extern template class time_put_byname<wchar_t>;
-  extern template class time_get<wchar_t>;
-  extern template class time_get_byname<wchar_t>;
-  extern template class messages<wchar_t>;
-  extern template class messages_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT moneypunct<wchar_t, false>;
+  extern template class _GLIBCXX_IMPORT moneypunct<wchar_t, true>;
+  extern template class _GLIBCXX_IMPORT moneypunct_byname<wchar_t, false>;
+  extern template class _GLIBCXX_IMPORT moneypunct_byname<wchar_t, true>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL money_get<wchar_t>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_NAMESPACE_LDBL money_put<wchar_t>;
+  extern template class _GLIBCXX_IMPORT __timepunct<wchar_t>;
+  extern template class _GLIBCXX_IMPORT time_put<wchar_t>;
+  extern template class _GLIBCXX_IMPORT time_put_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT time_get<wchar_t>;
+  extern template class _GLIBCXX_IMPORT time_get_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT messages<wchar_t>;
+  extern template class _GLIBCXX_IMPORT messages_byname<wchar_t>;
 
   extern template
     const moneypunct<wchar_t, true>&
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/ostream.tcc	2011-03-04 21:51:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/ostream.tcc	2012-10-31 16:49:37.515625000 +0000
@@ -358,7 +358,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_ostream<char>;
+  extern template class _GLIBCXX_IMPORT basic_ostream<char>;
   extern template ostream& endl(ostream&);
   extern template ostream& ends(ostream&);
   extern template ostream& flush(ostream&);
@@ -381,7 +381,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   extern template ostream& ostream::_M_insert(const void*);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_ostream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ostream<wchar_t>;
   extern template wostream& endl(wostream&);
   extern template wostream& ends(wostream&);
   extern template wostream& flush(wostream&);
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/sstream.tcc	2011-03-04 21:51:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/sstream.tcc	2012-10-31 16:49:37.515625000 +0000
@@ -271,16 +271,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_stringbuf<char>;
-  extern template class basic_istringstream<char>;
-  extern template class basic_ostringstream<char>;
-  extern template class basic_stringstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_stringbuf<char>;
+  extern template class _GLIBCXX_IMPORT basic_istringstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_ostringstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_stringstream<char>;
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_stringbuf<wchar_t>;
-  extern template class basic_istringstream<wchar_t>;
-  extern template class basic_ostringstream<wchar_t>;
-  extern template class basic_stringstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_stringbuf<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_istringstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ostringstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_stringstream<wchar_t>;
 #endif
 #endif
 
--- origsrc/gcc-4.7.2/libstdc++-v3/include/bits/streambuf.tcc	2011-03-04 21:51:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/bits/streambuf.tcc	2012-10-31 16:49:37.515625000 +0000
@@ -147,7 +147,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_streambuf<char>;
+  extern template class _GLIBCXX_IMPORT basic_streambuf<char>;
   extern template
     streamsize
     __copy_streambufs(basic_streambuf<char>*,
@@ -158,7 +158,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 			  basic_streambuf<char>*, bool&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_streambuf<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_streambuf<wchar_t>;
   extern template
     streamsize
     __copy_streambufs(basic_streambuf<wchar_t>*,
--- origsrc/gcc-4.7.2/libstdc++-v3/include/ext/concurrence.h	2012-07-16 23:34:13.000000000 +0100
+++ src/gcc-4.7.2/libstdc++-v3/include/ext/concurrence.h	2012-10-31 16:49:37.515625000 +0000
@@ -65,7 +65,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   // NB: As this is used in libsupc++, need to only depend on
   // exception. No stdexception classes, no use of std::string.
-  class __concurrence_lock_error : public std::exception
+  class _GLIBCXX_IMPORT __concurrence_lock_error : public std::exception
   {
   public:
     virtual char const*
@@ -73,7 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { return "__gnu_cxx::__concurrence_lock_error"; }
   };
 
-  class __concurrence_unlock_error : public std::exception
+  class _GLIBCXX_IMPORT __concurrence_unlock_error : public std::exception
   {
   public:
     virtual char const*
--- origsrc/gcc-4.7.2/libstdc++-v3/include/std/iostream	2011-01-30 22:39:36.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/std/iostream	2012-10-31 16:53:39.078125000 +0000
@@ -58,16 +58,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  linked to above.
   */
   //@{
-  extern istream cin;		/// Linked to standard input
-  extern ostream cout;		/// Linked to standard output
-  extern ostream cerr;		/// Linked to standard error (unbuffered)
-  extern ostream clog;		/// Linked to standard error (buffered)
+  extern _GLIBCXX_IMPORT istream cin;		/// Linked to standard input
+  extern _GLIBCXX_IMPORT ostream cout;		/// Linked to standard output
+  extern _GLIBCXX_IMPORT ostream cerr;		/// Linked to standard error (unbuffered)
+  extern _GLIBCXX_IMPORT ostream clog;		/// Linked to standard error (buffered)
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern wistream wcin;		/// Linked to standard input
-  extern wostream wcout;	/// Linked to standard output
-  extern wostream wcerr;	/// Linked to standard error (unbuffered)
-  extern wostream wclog;	/// Linked to standard error (buffered)
+  extern _GLIBCXX_IMPORT wistream wcin;		/// Linked to standard input
+  extern _GLIBCXX_IMPORT wostream wcout;	/// Linked to standard output
+  extern _GLIBCXX_IMPORT wostream wcerr;	/// Linked to standard error (unbuffered)
+  extern _GLIBCXX_IMPORT wostream wclog;	/// Linked to standard error (buffered)
 #endif
   //@}
 
--- origsrc/gcc-4.7.2/libstdc++-v3/include/std/stdexcept	2011-12-06 20:03:25.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/include/std/stdexcept	2012-10-31 17:02:54.890625000 +0000
@@ -53,7 +53,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  program runs (e.g., violations of class invariants).
    *  @brief One of two subclasses of exception.
    */
-  class logic_error : public exception 
+  class _GLIBCXX_IMPORT logic_error : public exception
   {
     string _M_msg;
 
@@ -72,7 +72,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /** Thrown by the library, or by you, to report domain errors (domain in
    *  the mathematical sense).  */
-  class domain_error : public logic_error 
+  class _GLIBCXX_IMPORT domain_error : public logic_error 
   {
   public:
     explicit domain_error(const string& __arg);
@@ -80,7 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 
   /** Thrown to report invalid arguments to functions.  */
-  class invalid_argument : public logic_error 
+  class _GLIBCXX_IMPORT invalid_argument : public logic_error 
   {
   public:
     explicit invalid_argument(const string& __arg);
@@ -89,7 +89,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /** Thrown when an object is constructed that would exceed its maximum
    *  permitted size (e.g., a basic_string instance).  */
-  class length_error : public logic_error 
+  class _GLIBCXX_IMPORT length_error : public logic_error
   {
   public:
     explicit length_error(const string& __arg);
@@ -98,7 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /** This represents an argument whose value is not within the expected
    *  range (e.g., boundary checks in basic_string).  */
-  class out_of_range : public logic_error 
+  class _GLIBCXX_IMPORT out_of_range : public logic_error
   {
   public:
     explicit out_of_range(const string& __arg);
@@ -110,7 +110,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  the program executes.
    *  @brief One of two subclasses of exception.
    */
-  class runtime_error : public exception 
+  class _GLIBCXX_IMPORT runtime_error : public exception
   {
     string _M_msg;
 
@@ -128,7 +128,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 
   /** Thrown to indicate range errors in internal computations.  */
-  class range_error : public runtime_error 
+  class _GLIBCXX_IMPORT range_error : public runtime_error
   {
   public:
     explicit range_error(const string& __arg);
@@ -144,7 +144,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 
   /** Thrown to indicate arithmetic underflow.  */
-  class underflow_error : public runtime_error 
+  class _GLIBCXX_IMPORT underflow_error : public runtime_error
   {
   public:
     explicit underflow_error(const string& __arg);
--- origsrc/gcc-4.7.2/libstdc++-v3/libsupc++/exception	2011-12-07 04:03:25.000000000 +0800
+++ src/gcc-4.7.2/libstdc++-v3/libsupc++/exception	2013-02-26 19:27:32.575916600 +0800
@@ -59,7 +59,7 @@ namespace std
    *  your own %exception classes, or use a different hierarchy, or to
    *  throw non-class data (e.g., fundamental types).
    */
-  class exception
+  class _GLIBCXX_IMPORT exception
   {
   public:
     exception() _GLIBCXX_USE_NOEXCEPT { }
@@ -72,7 +72,7 @@ namespace std
 
   /** If an %exception is thrown which is not listed in a function's
    *  %exception specification, one of these may be thrown.  */
-  class bad_exception : public exception
+  class _GLIBCXX_IMPORT bad_exception : public exception
   {
   public:
     bad_exception() _GLIBCXX_USE_NOEXCEPT { }
--- origsrc/gcc-4.7.2/libstdc++-v3/libsupc++/new	2011-10-12 19:40:58.000000000 +0100
+++ src/gcc-4.7.2/libstdc++-v3/libsupc++/new	2012-10-31 16:49:37.578125000 +0000
@@ -53,7 +53,7 @@ namespace std
    *
    *  @c bad_alloc (or classes derived from it) is used to report allocation
    *  errors from the throwing forms of @c new.  */
-  class bad_alloc : public exception 
+  class _GLIBCXX_IMPORT bad_alloc : public exception
   {
   public:
     bad_alloc() throw() { }
--- origsrc/gcc-4.7.2/libstdc++-v3/libsupc++/typeinfo	2012-01-27 19:38:56.000000000 +0000
+++ src/gcc-4.7.2/libstdc++-v3/libsupc++/typeinfo	2012-10-31 17:07:07.796875000 +0000
@@ -87,7 +87,7 @@ namespace std
    *  The @c type_info class describes type information generated by
    *  an implementation.
   */
-  class type_info
+  class _GLIBCXX_IMPORT type_info
   {
   public:
     /** Destructor first. Being the first non-inline virtual function, this
@@ -186,7 +186,7 @@ namespace std
    *
    *  If you attempt an invalid @c dynamic_cast expression, an instance of
    *  this class (or something derived from this class) is thrown.  */
-  class bad_cast : public exception
+  class _GLIBCXX_IMPORT bad_cast : public exception
   {
   public:
     bad_cast() _GLIBCXX_USE_NOEXCEPT { }
@@ -203,7 +203,7 @@ namespace std
    *  @brief Thrown when a NULL pointer in a @c typeid expression is used.
    *  @ingroup exceptions
    */
-  class bad_typeid : public exception
+  class _GLIBCXX_IMPORT bad_typeid : public exception
   {
   public:
     bad_typeid () _GLIBCXX_USE_NOEXCEPT { }
--- origsrc/gcc-4.7.2/libstdc++-v3/testsuite/lib/libstdc++.exp	2012-08-06 22:34:27.000000000 +0800
+++ src/gcc-4.7.2/libstdc++-v3/testsuite/lib/libstdc++.exp	2013-02-26 19:31:07.934763700 +0800
@@ -146,6 +146,9 @@ proc libstdc++_init { testfile } {
         set gccdir [file dirname $gccdir]
 	append ld_library_path_tmp ":${gccdir}"
     }
+    if { [string match "*-*-cygwin*" $target_triplet] } {
+	append ld_library_path_tmp ":${blddir}/../libgcc"
+    }
     v3track gccdir 3
 
     # Locate libgomp. This is only required for parallel mode.