unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell via Libc-alpha <libc-alpha@sourceware.org>
To: libc-alpha@sourceware.org
Subject: [PATCH v6 0/2] C.UTF-8
Date: Fri, 30 Jul 2021 15:48:43 -0400	[thread overview]
Message-ID: <20210730194845.2165087-1-carlos@redhat.com> (raw)

The following changes implement a minimally sized C.UTF-8.
First we implement the 'strcmp_collation' directive.
Then we implement C.UTF-8 with an LC_COLLATE that uses the
'strcmp_collation' directive to support using strcmp for
collation i.e. code point sorting. The final C.UTF-8 is
only ~396KiB with the largest ~346KiB in LC_CTYPE for all
of Unicode.

v6 fixes the regressions detected in Fedora Rawhide
here: https://bugzilla.redhat.com/show_bug.cgi?id=1986421,
but does so by generating identity tables for 
_NL_COLLATE_COLLSEQMB, and _NL_COLLATE_COLLSEQWC to provide
mappings for ASCII characters. This ensures that static
applications using the new C.UTF-8 have a functioning
fnmatch, regcomp, and regexec for ASCII ranges. This raises
the size of LC_COLLATE from 92 to 1406 bytes. Valgrind
reports no errors using the tables with C.UTF-8 under
tst-fnmatch. v6 also corrects collation sequence byte
ordering on BE targets, and I verified this by building
crossed locales with localedef --big-endian and confirming
that s390x built native C.UTF-8 is the same as an x86_64
C.UTF-8 built wtih --big-endian.

The fixes that were in v4 for nrules == 0 will be included
in the next release of glibc, and when those are proven
correct they can be backported to provide dyanmic
or newly compiled static applications with the ability
to use all code points in ranges.

Carlos O'Donell (2):
  Add 'strcmp_collation' support for LC_COLLATE.
  Add generic C.UTF-8 locale (Bug 17318)

 iconv/Makefile                   |  22 +-
 iconv/tst-iconv9.c               |  87 +++++
 locale/C-collate-seq.c           |  97 ++++++
 locale/C-collate.c               |  78 +----
 locale/programs/ld-collate.c     |  36 +-
 locale/programs/locfile-kw.gperf |   1 +
 locale/programs/locfile-kw.h     | 306 ++++++++---------
 locale/programs/locfile-token.h  |   1 +
 localedata/C.UTF-8.in            | 157 +++++++++
 localedata/Makefile              |   2 +
 localedata/SUPPORTED             |   1 +
 localedata/locales/C             | 194 +++++++++++
 posix/Makefile                   |  16 +-
 posix/bug-regex1.c               |  20 ++
 posix/bug-regex19.c              |  22 +-
 posix/bug-regex4.c               |  25 ++
 posix/bug-regex6.c               |   2 +-
 posix/transbug.c                 |  22 +-
 posix/tst-fnmatch.input          | 549 ++++++++++++++++++++++++++++++-
 posix/tst-regcomp-truncated.c    |   1 +
 posix/tst-regex.c                |  25 +-
 21 files changed, 1404 insertions(+), 260 deletions(-)
 create mode 100644 iconv/tst-iconv9.c
 create mode 100644 locale/C-collate-seq.c
 create mode 100644 localedata/C.UTF-8.in
 create mode 100644 localedata/locales/C

-- 
2.31.1


             reply	other threads:[~2021-07-30 20:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 19:48 Carlos O'Donell via Libc-alpha [this message]
2021-07-30 19:48 ` [PATCH v6 1/2] Add 'strcmp_collation' support for LC_COLLATE Carlos O'Donell via Libc-alpha
2021-07-30 20:19   ` Andreas Schwab
2021-07-30 20:25     ` Florian Weimer via Libc-alpha
2021-07-31 18:41       ` Carlos O'Donell via Libc-alpha
2021-07-30 19:48 ` [PATCH v6 2/2] Add generic C.UTF-8 locale (Bug 17318) Carlos O'Donell via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210730194845.2165087-1-carlos@redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=carlos@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).