From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id B9B2D3839409 for ; Mon, 6 Sep 2021 15:11:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B9B2D3839409 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-467-FCgcl72_Pe2NFbBLwBUIXg-1; Mon, 06 Sep 2021 11:11:26 -0400 X-MC-Unique: FCgcl72_Pe2NFbBLwBUIXg-1 Received: by mail-qv1-f72.google.com with SMTP id a10-20020ad45c4a000000b0037774ba4e8bso11268134qva.5 for ; Mon, 06 Sep 2021 08:11:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kafwdfHDsUZgnksx3+25PpdFauU7aXqU5OxCVKcOlvg=; b=TYPgFWtBizG2az87zNFXlOyNJb1mTbdxj07I5s4mTAWibyeIkTDZYu3oAd0KojpM23 JUajTitR7+3KlQ25LsLTdFQBU0UvNsB7m5kDwUvYVBapElUTv1tT5DwW828joE27hj+8 NI3UdeoyD/iC+VdkljQu5xds/QoNInKLtkFi0P66Pxyu7gP1nts/eHUZb6j2tJrloj+f wLMZX5lKc5/sPhnrnkUp1QpOlkOfYfFLYvROy6ufTCSQgsVJXDQCNtL+okvPFS7su69z 2j+nlqwZg/eFwvh4Kew1LU3fzIA14vMVND39GmvlycmAwVOi0K1HhmhI003nLvlhvtmI XgBA== X-Gm-Message-State: AOAM530sdZdOiKp7Q2VLdI6770h/YqCmp5QWdnQSJGYJolZImcLIPUJG DD9nDz5/rIIa9bHYVWOGkzNONtDBdmqvjtScOdJ5xwB1TVR8UwPBCmE2eccUc3dPXmoFgM9BkJn h3uRDRohTIRDVgoor0s9F6204OPDPS4Dj8nNIUdQurCM+dmlvMkgSoYnGVWLrDHG3kCoX2g== X-Received: by 2002:ae9:ef01:: with SMTP id d1mr11513078qkg.423.1630941085913; Mon, 06 Sep 2021 08:11:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwYVWJ3PxAINH8fZlORftdJAJff+ThfIAxMetWzPXUhfP/N9N12m3YsqXQTHmRrLGPKFAqIA== X-Received: by 2002:ae9:ef01:: with SMTP id d1mr11513043qkg.423.1630941085576; Mon, 06 Sep 2021 08:11:25 -0700 (PDT) Received: from athas.redhat.com (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id p22sm6532054qkj.16.2021.09.06.08.11.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:11:24 -0700 (PDT) From: Carlos O'Donell To: libc-alpha@sourceware.org, fweimer@redhat.com Subject: [PATCH v11 0/2] C.UTF-8 Date: Mon, 6 Sep 2021 11:11:20 -0400 Message-Id: <20210906151122.481858-1-carlos@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Sep 2021 15:11:30 -0000 The following changes implement a minimally sized C.UTF-8. First we implement the 'codepoint_collation' directive. Then we implement C.UTF-8 with an LC_COLLATE that uses the 'codepoint_collation' directive to support using strcmp or wcscmp 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. v11 fixes a defect in the tst-regex.c test. All modified tests were reviewed for similar defects and none were found. v11 also removes an obsolete Contributed-by line in C-collate-seq.c. v10 fixes a defect in the transbug.c test. v9 is rebased against the changes to remove ISO-8859-1 characters from the bug-regex1.c test (69623c0db0a540f26ee537bae09446d3dcdf1f80). v8 includes a NEWS entry for the updated C.UTF-8. v7 fixed 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. v7 also corrected 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 'codepoint_collation' support for LC_COLLATE. Add generic C.UTF-8 locale (Bug 17318) NEWS | 10 +- iconv/Makefile | 22 +- iconv/tst-iconv9.c | 87 +++++ locale/C-collate-seq.c | 100 ++++++ locale/C-collate.c | 78 +---- locale/programs/ld-collate.c | 36 +- locale/programs/locfile-kw.gperf | 1 + locale/programs/locfile-kw.h | 299 ++++++++--------- 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 | 24 +- posix/tst-fnmatch.input | 549 ++++++++++++++++++++++++++++++- posix/tst-regcomp-truncated.c | 1 + posix/tst-regex.c | 33 +- 22 files changed, 1417 insertions(+), 263 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