Re: [patch][libstdc++] Provide nearly complete locale support for DragonFly

2015-08-27 Thread John Marino
On 8/27/2015 2:26 PM, Jonathan Wakely wrote:
> 
> N.B. please CC the libstdc++ list on all libstdc++ patches.
> The tests on DragonFly look excellent now, nice work.

Okay, noted for the future.

> I think that should probably be defined on FreeBSD too now, so that
> the _GLIBCXX_USE_C99_DYNAMIC checks come into effect.

I actually doubt this is valid for FreeBSD.  That platform is missing
C99 functions in libm.  Once the FreeBSD libm is augmented, then it
should be set.

However, FreeBSD should evaluate switching from generic locale support
to DragonFly locale support.  It may even work out of the box (collating
pending getting collation support from DragonFly which is already in the
works).

> Committed to trunk with only minor changes to remove some trailing
> whitespace in config/os/bsd/dragonfly/ctype_configure_char.cc and to
> capitalize a couple of ChangeLog lines.
> 
> Thanks for the ongoing improvements to DragonFly support.

Great!  I had caught those whitespace changes when imported into
DragonFly base but I must have forgotten to apply those changes to
version 2 of the patch set.  Thanks for review and I'm glad they were
high quality.

Regards,
John




Re: [patch][libstdc++] Provide nearly complete locale support for DragonFly

2015-08-27 Thread Jonathan Wakely

On 13/08/15 15:13 +0200, John Marino wrote:

On 7/31/2015 6:06 PM, John Marino wrote:

So far, DragonFly only handles the C/POSIX locale through the "generic"
locale support files, similar to FreeBSD and Darwin.  The following
patchset enables nearly complete support for named locales.  The except
is for std:messages which requires gettext support in libc which is not
present in any *BSD.  For that category, I have left generic support in
place at Jonathan's recommendation.

The support was made by talking the GNU version and adapting it to work
on DragonFly.

Testing has shown these patches to be working.  A "before" test results:
  https://gcc.gnu.org/ml/gcc-testresults/2015-07/msg01678.html
PASS: 9883
FAIL: 89
XSUCC: 1
XFAIL: 66
UNSUP: 465
The most recent test:
  https://gcc.gnu.org/ml/gcc-testresults/2015-07/msg03024.html
PASS:  10074
FAIL:  32
XFAIL: 68
UNSUP: 401

For full disclosure, a number of improvements were made to the OS in the
area of locales, such as DragonFly being the first BSD to acquire full
collation support.

Most of the remaining failures are due to differences in locale
definitions between linux and DragonFly (DragonFly now uses CLDR POSIX
definitions, v2.0.1 currently)

Attachments:
  1. combined diff
  2. diff between gnu and dragonfly version (FYI)
  3. Suggested Changelog entry

This work should be highly interesting for FreeBSD and perhaps darwin as
well.  FreeBSD may be able to switch to it directly without any required
modifications, but of course that must be tested.

There is no risk to approving this patchset because it affects only
DragonFly.  Please consider approving this for incorporating into trunk
(also recall that my FSF copyright assignment is filed and in order.)



N.B. please CC the libstdc++ list on all libstdc++ patches.

The tests on DragonFly look excellent now, nice work.



I'd like to ping the original post
(https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02678.html )
and also provide a 2-line revision of the patch set.

The first line adds "#include " to bits/c++locale.h which is
needed for the locale_t type definition.

The second change adds "#define _GLIBCXX_USE_C99 1" to dragonfly's
os_defines.h.  We copied FreeBSD's configuration, but FreeBSD doesn't
yet support C99 so it wasn't set there.  It fixes several regressions we
found after using GCC a bit.


I think that should probably be defined on FreeBSD too now, so that
the _GLIBCXX_USE_C99_DYNAMIC checks come into effect.


How does this attached patchset look?
I had to add one line to the suggested Changelog entry for os_defines.h


Committed to trunk with only minor changes to remove some trailing
whitespace in config/os/bsd/dragonfly/ctype_configure_char.cc and to
capitalize a couple of ChangeLog lines.

Thanks for the ongoing improvements to DragonFly support.



Re: [patch][libstdc++] Provide nearly complete locale support for DragonFly

2015-08-13 Thread John Marino
On 7/31/2015 6:06 PM, John Marino wrote:
> So far, DragonFly only handles the C/POSIX locale through the "generic"
> locale support files, similar to FreeBSD and Darwin.  The following
> patchset enables nearly complete support for named locales.  The except
> is for std:messages which requires gettext support in libc which is not
> present in any *BSD.  For that category, I have left generic support in
> place at Jonathan's recommendation.
> 
> The support was made by talking the GNU version and adapting it to work
> on DragonFly.
> 
> Testing has shown these patches to be working.  A "before" test results:
>   https://gcc.gnu.org/ml/gcc-testresults/2015-07/msg01678.html
> PASS: 9883
> FAIL: 89
> XSUCC: 1
> XFAIL: 66
> UNSUP: 465
> The most recent test:
>   https://gcc.gnu.org/ml/gcc-testresults/2015-07/msg03024.html
> PASS:  10074
> FAIL:  32
> XFAIL: 68
> UNSUP: 401
> 
> For full disclosure, a number of improvements were made to the OS in the
> area of locales, such as DragonFly being the first BSD to acquire full
> collation support.
> 
> Most of the remaining failures are due to differences in locale
> definitions between linux and DragonFly (DragonFly now uses CLDR POSIX
> definitions, v2.0.1 currently)
> 
> Attachments:
>   1. combined diff
>   2. diff between gnu and dragonfly version (FYI)
>   3. Suggested Changelog entry
> 
> This work should be highly interesting for FreeBSD and perhaps darwin as
> well.  FreeBSD may be able to switch to it directly without any required
> modifications, but of course that must be tested.
> 
> There is no risk to approving this patchset because it affects only
> DragonFly.  Please consider approving this for incorporating into trunk
> (also recall that my FSF copyright assignment is filed and in order.)
> 

I'd like to ping the original post
(https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02678.html )
and also provide a 2-line revision of the patch set.

The first line adds "#include " to bits/c++locale.h which is
needed for the locale_t type definition.

The second change adds "#define _GLIBCXX_USE_C99 1" to dragonfly's
os_defines.h.  We copied FreeBSD's configuration, but FreeBSD doesn't
yet support C99 so it wasn't set there.  It fixes several regressions we
found after using GCC a bit.

How does this attached patchset look?
I had to add one line to the suggested Changelog entry for os_defines.h

Regards,
John

Index: libstdc++-v3/acinclude.m4
===
--- libstdc++-v3/acinclude.m4   (revision 226444)
+++ libstdc++-v3/acinclude.m4   (working copy)
@@ -2087,17 +2087,17 @@
 dragonfly)
   AC_MSG_RESULT(dragonfly)
 
-  CLOCALE_H=config/locale/generic/c_locale.h
+  CLOCALE_H=config/locale/dragonfly/c_locale.h
   CLOCALE_CC=config/locale/dragonfly/c_locale.cc
-  CCODECVT_CC=config/locale/generic/codecvt_members.cc
-  CCOLLATE_CC=config/locale/generic/collate_members.cc
+  CCODECVT_CC=config/locale/dragonfly/codecvt_members.cc
+  CCOLLATE_CC=config/locale/dragonfly/collate_members.cc
   CCTYPE_CC=config/locale/dragonfly/ctype_members.cc
   CMESSAGES_H=config/locale/generic/messages_members.h
   CMESSAGES_CC=config/locale/generic/messages_members.cc
-  CMONEY_CC=config/locale/generic/monetary_members.cc
-  CNUMERIC_CC=config/locale/generic/numeric_members.cc
-  CTIME_H=config/locale/generic/time_members.h
-  CTIME_CC=config/locale/generic/time_members.cc
+  CMONEY_CC=config/locale/dragonfly/monetary_members.cc
+  CNUMERIC_CC=config/locale/dragonfly/numeric_members.cc
+  CTIME_H=config/locale/dragonfly/time_members.h
+  CTIME_CC=config/locale/dragonfly/time_members.cc
   CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
   ;;
 
Index: libstdc++-v3/config/locale/dragonfly/c_locale.cc
===
--- libstdc++-v3/config/locale/dragonfly/c_locale.cc(revision 226444)
+++ libstdc++-v3/config/locale/dragonfly/c_locale.cc(working copy)
@@ -1,4 +1,4 @@
-// Wrapper for underlying C-language localization -*- C++ -*-
+// localization implementation details, DragonFly version -*- C++ -*-
 
 // Copyright (C) 2014-2015 Free Software Foundation, Inc.
 //
@@ -27,19 +27,15 @@
 //
 
 // Written by Benjamin Kosnik 
+// Modified for DragonFly by John Marino 
 
-#include   // For errno
-#include   // For isinf, finite, finitef, fabs
-#include   // For strof, strtold
-#include 
-#include 
+#include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
-#ifdef _GLIBCXX_HAVE_IEEEFP_H
-#include 
-#endif
-
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -47,41 +43,11 @@
   template<>
 void
 __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
-  const __c_locale&) throw()
+  const __c_locale& __cloc) throw()
 {
-  // Assumes __s formatted