public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] libstdc++/66030 fix codecvt exports for mingw32
@ 2015-06-08 15:31 Jonathan Wakely
  2015-06-08 16:01 ` Martin Sebor
  2015-06-15 12:53 ` Jonathan Wakely
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Wakely @ 2015-06-08 15:31 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

The linker script assumes that std::mbstate_t has the name __mbstate_t
for linkage purposes, but that's not necessarily true. For mingw32
it's just a typedef for int, so the patterns don't match.

This adds a new mingw32-specific pattern for codecvt_byname's
constructors and destructors, and relaxes the patterns for
codecvt<charNN_t, char, mbstate_t> so they match __mbstate_t or int.

Tested x86_64-linux and powerpc64le-linux, committed to trunk.

I plan to commit this to trunk and gcc-5-branch soon.

[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1259 bytes --]

commit dffce5e2b48ff19c4ec4de5d7ca934c15225b940
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Jun 1 17:31:46 2015 +0100

    	PR libstdc++/66030
    	* config/abi/pre/gnu.ver: Export codecvt_byname and codecvt symbols
    	for mingw32.

diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 2da04e4..d42cd37 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -542,6 +542,9 @@ GLIBCXX_3.4 {
     # std::codecvt_byname
     _ZNSt14codecvt_bynameI[cw]c11__mbstate_tEC[12]EPKc[jmy];
     _ZNSt14codecvt_bynameI[cw]c11__mbstate_tED*;
+#if defined (_WIN32) && !defined (__CYGWIN__)
+    _ZNSt14codecvt_bynameI[cw]ciE[CD]*;
+#endif
 
     # std::collate
     _ZNSt7collateI[cw]*;
@@ -1821,9 +1824,9 @@ GLIBCXX_3.4.21 {
     _ZNKSt8time_getI[cw]St19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateP2tmcc;
 
     # codecvt<char16_t, char, mbstate_t>, codecvt<char32_t, char, mbstate_t>
-    _ZNKSt7codecvtID[is]c11__mbstate_t*;
-    _ZNSt7codecvtID[is]c11__mbstate_t*;
-    _ZT[ISV]St7codecvtID[is]c11__mbstate_tE;
+    _ZNKSt7codecvtID[is]c*;
+    _ZNSt7codecvtID[is]c*;
+    _ZT[ISV]St7codecvtID[is]c*E;
 
     extern "C++"
     {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] libstdc++/66030 fix codecvt exports for mingw32
  2015-06-08 15:31 [patch] libstdc++/66030 fix codecvt exports for mingw32 Jonathan Wakely
@ 2015-06-08 16:01 ` Martin Sebor
  2015-06-09  9:42   ` Jonathan Wakely
  2015-06-15 12:53 ` Jonathan Wakely
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Sebor @ 2015-06-08 16:01 UTC (permalink / raw)
  To: Jonathan Wakely, libstdc++, gcc-patches

On 06/08/2015 09:12 AM, Jonathan Wakely wrote:
> The linker script assumes that std::mbstate_t has the name __mbstate_t
> for linkage purposes, but that's not necessarily true. For mingw32
> it's just a typedef for int, so the patterns don't match.
>
> This adds a new mingw32-specific pattern for codecvt_byname's
> constructors and destructors, and relaxes the patterns for
> codecvt<charNN_t, char, mbstate_t> so they match __mbstate_t or int.

As a data point, in case other targets have a similar issue,
mbstate_t is a typedef for char* on AIX, and (based on my
old notes) typedef struct mbstate_t on HP-UX.

(It is a typedef struct __mbstate_t on Darwin and Solaris.)

Martin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] libstdc++/66030 fix codecvt exports for mingw32
  2015-06-08 16:01 ` Martin Sebor
@ 2015-06-09  9:42   ` Jonathan Wakely
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2015-06-09  9:42 UTC (permalink / raw)
  To: Martin Sebor; +Cc: libstdc++, gcc-patches

On 08/06/15 09:59 -0600, Martin Sebor wrote:
>On 06/08/2015 09:12 AM, Jonathan Wakely wrote:
>>The linker script assumes that std::mbstate_t has the name __mbstate_t
>>for linkage purposes, but that's not necessarily true. For mingw32
>>it's just a typedef for int, so the patterns don't match.
>>
>>This adds a new mingw32-specific pattern for codecvt_byname's
>>constructors and destructors, and relaxes the patterns for
>>codecvt<charNN_t, char, mbstate_t> so they match __mbstate_t or int.
>
>As a data point, in case other targets have a similar issue,
>mbstate_t is a typedef for char* on AIX, and (based on my
>old notes) typedef struct mbstate_t on HP-UX.
>
>(It is a typedef struct __mbstate_t on Darwin and Solaris.)

That is useful, thanks.

AIX and HP-UX don't use that linker script, so it's not a problem (for
now) that it assumes __mbstate_t.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] libstdc++/66030 fix codecvt exports for mingw32
  2015-06-08 15:31 [patch] libstdc++/66030 fix codecvt exports for mingw32 Jonathan Wakely
  2015-06-08 16:01 ` Martin Sebor
@ 2015-06-15 12:53 ` Jonathan Wakely
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2015-06-15 12:53 UTC (permalink / raw)
  To: libstdc++, gcc-patches

On 08/06/15 16:12 +0100, Jonathan Wakely wrote:
>The linker script assumes that std::mbstate_t has the name __mbstate_t
>for linkage purposes, but that's not necessarily true. For mingw32
>it's just a typedef for int, so the patterns don't match.
>
>This adds a new mingw32-specific pattern for codecvt_byname's
>constructors and destructors, and relaxes the patterns for
>codecvt<charNN_t, char, mbstate_t> so they match __mbstate_t or int.
>
>Tested x86_64-linux and powerpc64le-linux, committed to trunk.
>
>I plan to commit this to trunk and gcc-5-branch soon.

I've fully tested this on x86_64-linux and powerpc64le-linux, and also
manually verified there is no changed to the exported symbols on
Fedora 22 for i686, s390, s390x, ppc64, ppc64le, armv7hl and aarch64,
so am committing to the gcc-5-branch (approved by Jakub on IRC).


>commit dffce5e2b48ff19c4ec4de5d7ca934c15225b940
>Author: Jonathan Wakely <jwakely@redhat.com>
>Date:   Mon Jun 1 17:31:46 2015 +0100
>
>    	PR libstdc++/66030
>    	* config/abi/pre/gnu.ver: Export codecvt_byname and codecvt symbols
>    	for mingw32.
>
>diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
>index 2da04e4..d42cd37 100644
>--- a/libstdc++-v3/config/abi/pre/gnu.ver
>+++ b/libstdc++-v3/config/abi/pre/gnu.ver
>@@ -542,6 +542,9 @@ GLIBCXX_3.4 {
>     # std::codecvt_byname
>     _ZNSt14codecvt_bynameI[cw]c11__mbstate_tEC[12]EPKc[jmy];
>     _ZNSt14codecvt_bynameI[cw]c11__mbstate_tED*;
>+#if defined (_WIN32) && !defined (__CYGWIN__)
>+    _ZNSt14codecvt_bynameI[cw]ciE[CD]*;
>+#endif
> 
>     # std::collate
>     _ZNSt7collateI[cw]*;
>@@ -1821,9 +1824,9 @@ GLIBCXX_3.4.21 {
>     _ZNKSt8time_getI[cw]St19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEE6do_getES3_S3_RSt8ios_baseRSt12_Ios_IostateP2tmcc;
> 
>     # codecvt<char16_t, char, mbstate_t>, codecvt<char32_t, char, mbstate_t>
>-    _ZNKSt7codecvtID[is]c11__mbstate_t*;
>-    _ZNSt7codecvtID[is]c11__mbstate_t*;
>-    _ZT[ISV]St7codecvtID[is]c11__mbstate_tE;
>+    _ZNKSt7codecvtID[is]c*;
>+    _ZNSt7codecvtID[is]c*;
>+    _ZT[ISV]St7codecvtID[is]c*E;
> 
>     extern "C++"
>     {

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-15 12:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-08 15:31 [patch] libstdc++/66030 fix codecvt exports for mingw32 Jonathan Wakely
2015-06-08 16:01 ` Martin Sebor
2015-06-09  9:42   ` Jonathan Wakely
2015-06-15 12:53 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).