-Forward port eglibc options groups support
+From 2a5d7bcf0ff791c95ee1388772408a1bf4454694 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:33:49 +0000
+Subject: [PATCH 24/27] eglibc: Forward port eglibc options groups support
Upstream-Status: Pending
-Index: git/argp/argp-fmtstream.c
-===================================================================
---- git.orig/argp/argp-fmtstream.c
-+++ git/argp/argp-fmtstream.c
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makeconfig | 20 +-
+ Makerules | 19 +
+ argp/Makefile | 2 +
+ argp/argp-fmtstream.c | 25 +-
+ argp/argp-help.c | 13 +-
+ argp/argp-namefrob.h | 2 +
+ catgets/Makefile | 17 +-
+ crypt/Makefile | 20 +-
+ crypt/crypt-entry.c | 13 +
+ crypt/crypt_common.c | 42 +
+ crypt/crypt_util.c | 18 -
+ csu/Makefile | 2 +
+ debug/Makefile | 41 +-
+ debug/segfault.c | 11 +-
+ debug/tst-chk1.c | 7 +
+ dlfcn/Makefile | 7 +-
+ elf/dl-support.c | 3 +
+ elf/rtld.c | 17 +-
+ extra-lib.mk | 6 +-
+ grp/Makefile | 5 +
+ hesiod/Makefile | 6 +-
+ iconv/Makefile | 7 +
+ iconv/gconv_db.c | 3 +
+ iconv/gconv_trans.c | 7 +
+ iconv/iconv_prog.c | 8 +
+ iconvdata/Makefile | 27 +-
+ include/netdb.h | 4 +
+ inet/Makefile | 22 +-
+ intl/Makefile | 3 +-
+ intl/dcigettext.c | 39 +-
+ io/Makefile | 18 +-
+ libidn/Makefile | 5 +-
+ libidn/toutf8.c | 11 +-
+ libio/Makefile | 66 +-
+ libio/__fpurge.c | 2 +-
+ libio/fileops.c | 10 +-
+ libio/iofwide.c | 26 +
+ libio/ioseekoff.c | 2 +-
+ libio/ioseekpos.c | 2 +-
+ libio/iosetbuffer.c | 4 +
+ libio/libioP.h | 18 +-
+ libio/wdummyfileops.c | 161 +
+ locale/C-ctype.c | 20 +
+ locale/Makefile | 41 +-
+ locale/catnames.c | 48 +
+ locale/dummy-setlocale.c | 33 +
+ locale/localeinfo.h | 2 +-
+ locale/programs/charmap-dir.c | 6 +
+ locale/programs/ld-collate.c | 17 +-
+ locale/programs/ld-ctype.c | 27 +-
+ locale/programs/ld-messages.c | 5 +
+ locale/programs/ld-time.c | 31 +-
+ locale/programs/linereader.c | 2 +-
+ locale/programs/localedef.c | 8 +
+ locale/programs/locfile.c | 5 +-
+ locale/programs/locfile.h | 59 +-
+ locale/setlocale.c | 30 -
+ locale/xlocale.c | 37 +
+ localedata/Makefile | 35 +-
+ login/Makefile | 17 +-
+ malloc/Makefile | 10 +-
+ malloc/memusage.c | 7 +-
+ malloc/memusage.sh | 2 +-
+ math/Makefile | 6 +-
+ misc/Makefile | 25 +-
+ misc/err.c | 11 +
+ misc/error.c | 5 +
+ misc/tst-efgcvt.c | 2 +-
+ nis/Makefile | 31 +-
+ nptl/Makefile | 28 +-
+ nptl/pthread_create.c | 5 +
+ nscd/Makefile | 33 +-
+ nscd/nis_hash.c | 3 +
+ nss/Makefile | 67 +-
+ nss/fixed-nsswitch.conf | 22 +
+ nss/fixed-nsswitch.functions | 121 +
+ nss/gen-fixed-nsswitch.c | 803 +++
+ nss/getent.c | 46 +-
+ nss/getnssent_r.c | 9 +-
+ nss/nsswitch.c | 109 +-
+ nss/nsswitch.h | 18 +-
+ posix/Makefile | 94 +-
+ posix/bug-regex1.c | 3 +
+ posix/bug-regex6.c | 8 +-
+ posix/fnmatch.c | 6 +-
+ posix/fnmatch_loop.c | 23 +-
+ posix/glob.c | 15 +-
+ posix/regcomp.c | 98 +-
+ posix/regex.h | 11 +
+ posix/regex_internal.c | 45 +-
+ posix/regex_internal.h | 23 +-
+ posix/regexec-compat.c | 39 +
+ posix/regexec.c | 71 +-
+ posix/xregex.c | 8215 +++++++++++++++++++++++++++++++
+ pwd/Makefile | 2 +
+ resolv/Makefile | 21 +-
+ stdio-common/Makefile | 35 +-
+ stdio-common/_i18n_number.h | 13 +
+ stdio-common/fxprintf.c | 5 +
+ stdio-common/printf_fp.c | 22 +
+ stdio-common/printf_fphex.c | 13 +
+ stdio-common/printf_size.c | 8 +
+ stdio-common/scanf14.c | 3 +
+ stdio-common/tst-popen.c | 3 +
+ stdio-common/tst-sprintf.c | 4 +-
+ stdio-common/tstdiomisc.c | 5 +
+ stdio-common/vfprintf.c | 31 +-
+ stdio-common/vfscanf.c | 53 +-
+ stdlib/Makefile | 34 +-
+ stdlib/strtod_l.c | 13 +
+ stdlib/tst-strtod.c | 5 +
+ streams/Makefile | 5 +-
+ string/Makefile | 14 +-
+ string/strcoll_l.c | 5 +
+ string/strerror_l.c | 5 +
+ string/strxfrm_l.c | 5 +
+ string/test-strcmp.c | 28 -
+ string/tst-strxfrm.c | 3 +
+ string/tst-strxfrm2.c | 3 +
+ sunrpc/Makefile | 44 +-
+ sysdeps/arm/Makefile | 5 +-
+ sysdeps/generic/ldsodefs.h | 8 +
+ sysdeps/gnu/Makefile | 3 +-
+ sysdeps/ieee754/ldbl-opt/Makefile | 27 +-
+ sysdeps/ieee754/ldbl-opt/nldbl-compat.c | 40 +-
+ sysdeps/ieee754/ldbl-opt/nldbl-compat.h | 24 +-
+ sysdeps/nptl/Makefile | 3 +
+ sysdeps/nptl/bits/libc-lock.h | 45 +
+ sysdeps/nptl/bits/libc-lockP.h | 50 +-
+ sysdeps/nptl/small-macros-fns.c | 72 +
+ sysdeps/unix/sysv/linux/gethostid.c | 6 +
+ sysdeps/unix/sysv/linux/libc_fatal.c | 3 +
+ time/Makefile | 18 +-
+ time/strftime_l.c | 12 +-
+ time/strptime_l.c | 14 +-
+ timezone/Makefile | 2 +-
+ wcsmbs/Makefile | 27 +-
+ wcsmbs/wcsmbsload.c | 13 +
+ wctype/Makefile | 14 +-
+ 139 files changed, 11363 insertions(+), 583 deletions(-)
+ create mode 100644 crypt/crypt_common.c
+ create mode 100644 libio/wdummyfileops.c
+ create mode 100644 locale/catnames.c
+ create mode 100644 locale/dummy-setlocale.c
+ create mode 100644 nscd/nis_hash.c
+ create mode 100644 nss/fixed-nsswitch.conf
+ create mode 100644 nss/fixed-nsswitch.functions
+ create mode 100644 nss/gen-fixed-nsswitch.c
+ create mode 100644 posix/regexec-compat.c
+ create mode 100644 posix/xregex.c
+ create mode 100644 sysdeps/nptl/small-macros-fns.c
+
+diff --git a/Makeconfig b/Makeconfig
+index f136b88..52dae8f 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -609,7 +609,7 @@ elf-objpfx = $(common-objpfx)elf/
+ # and run on the build system, causes that program with those
+ # arguments to be run on the host for which the library is built.
+ ifndef test-wrapper
+-test-wrapper =
++test-wrapper = $(cross-test-wrapper)
+ endif
+ # Likewise, but the name of the program is preceded by
+ # <variable>=<value> assignments for environment variables.
+@@ -1089,6 +1089,24 @@ libm = $(common-objpfx)math/libm.a
+ libmvec = $(common-objpfx)mathvec/libmvec.a
+ endif
+
++# Generate a header file that #defines preprocessor symbols indicating
++# which option groups are enabled. Note that the option-groups.config file
++# may not exist at all.
++before-compile += $(common-objpfx)gnu/option-groups.h
++common-generated += gnu/option-groups.h gnu/option-groups.stmp
++headers += gnu/option-groups.h
++$(common-objpfx)gnu/option-groups.h: $(common-objpfx)gnu/option-groups.stmp; @:
++$(common-objpfx)gnu/option-groups.stmp: \
++ $(..)scripts/option-groups.awk \
++ $(..)option-groups.defaults \
++ $(wildcard $(common-objpfx)option-groups.config)
++ $(make-target-directory)
++ @rm -f ${@:stmp=T} $@
++ LC_ALL=C $(AWK) -f $^ > ${@:stmp=T}
++ $(move-if-change) ${@:stmp=T} ${@:stmp=h}
++ touch $@
++
++
+ # These are the subdirectories containing the library source. The order
+ # is more or less arbitrary. The sorting step will take care of the
+ # dependencies.
+diff --git a/Makerules b/Makerules
+index f9ca3f5..1dd41aa 100644
+--- a/Makerules
++++ b/Makerules
+@@ -456,6 +456,25 @@ define sed-remove-objpfx
+ endef
+ endif
+ \f
++# Include targets in the selected option groups.
++aux += $(aux-y)
++extra-libs += $(extra-libs-y)
++extra-libs-others += $(extra-libs-others-y)
++extra-objs += $(extra-objs-y)
++install-bin += $(install-bin-y)
++install-others += $(install-others-y)
++install-sbin += $(install-sbin-y)
++modules += $(modules-y)
++others += $(others-y)
++others-pie += $(others-pie-y)
++routines += $(routines-y)
++static-only-routines += $(static-only-routines-y)
++sysdep_routines += $(sysdep_routines-y)
++test-srcs += $(test-srcs-y)
++tests += $(tests-y)
++xtests += $(xtests-y)
++
++\f
+ # Modify the list of routines we build for different targets
+
+ ifeq (yes,$(build-shared))
+diff --git a/argp/Makefile b/argp/Makefile
+index 1a87629..f7c1e40 100644
+--- a/argp/Makefile
++++ b/argp/Makefile
+@@ -18,6 +18,8 @@
+ #
+ # Makefile for argp.
+ #
++include ../option-groups.mak
++
+ subdir := argp
+
+ include ../Makeconfig
+diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c
+index 2b845e0..c344e7b 100644
+--- a/argp/argp-fmtstream.c
++++ b/argp/argp-fmtstream.c
@@ -42,6 +42,7 @@
#ifdef _LIBC
# include <wchar.h>
# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
#endif
-@@ -100,7 +101,11 @@ __argp_fmtstream_free (argp_fmtstream_t
+@@ -100,7 +101,11 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
__argp_fmtstream_update (fs);
if (fs->p > fs->buf)
{
}
free (fs->buf);
free (fs);
-@@ -145,9 +150,17 @@ __argp_fmtstream_update (argp_fmtstream_
+@@ -145,9 +150,17 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
size_t i;
for (i = 0; i < pad; i++)
{
putc_unlocked (' ', fs->stream);
}
}
-@@ -308,9 +321,17 @@ __argp_fmtstream_update (argp_fmtstream_
+@@ -308,9 +321,17 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
*nl++ = ' ';
else
for (i = 0; i < fs->wmargin; ++i)
putc_unlocked (' ', fs->stream);
/* Copy the tail of the original buffer into the current buffer
-Index: git/argp/argp-help.c
-===================================================================
---- git.orig/argp/argp-help.c
-+++ git/argp/argp-help.c
+diff --git a/argp/argp-help.c b/argp/argp-help.c
+index b055e45..6b3c4c1 100644
+--- a/argp/argp-help.c
++++ b/argp/argp-help.c
@@ -51,6 +51,7 @@ char *alloca ();
#ifdef _LIBC
# include <../libio/libioP.h>
{
# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
return program_invocation_short_name;
-@@ -1873,9 +1874,17 @@ __argp_failure (const struct argp_state
+@@ -1873,9 +1874,17 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
#endif
}
putc_unlocked ('\n', stream);
#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
-Index: git/argp/argp-namefrob.h
-===================================================================
---- git.orig/argp/argp-namefrob.h
-+++ git/argp/argp-namefrob.h
+diff --git a/argp/argp-namefrob.h b/argp/argp-namefrob.h
+index f67c58f..e2002dc 100644
+--- a/argp/argp-namefrob.h
++++ b/argp/argp-namefrob.h
@@ -76,10 +76,12 @@
#undef __argp_fmtstream_wmargin
#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
/* normal libc functions we call */
#undef __flockfile
-Index: git/argp/Makefile
-===================================================================
---- git.orig/argp/Makefile
-+++ git/argp/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for argp.
- #
-+include ../option-groups.mak
-+
- subdir := argp
-
- include ../Makeconfig
-Index: git/catgets/Makefile
-===================================================================
---- git.orig/catgets/Makefile
-+++ git/catgets/Makefile
+diff --git a/catgets/Makefile b/catgets/Makefile
+index 4624a88..05714fd 100644
+--- a/catgets/Makefile
++++ b/catgets/Makefile
@@ -22,20 +22,23 @@ subdir := catgets
include ../Makeconfig
gencat-modules = xmalloc
# To find xmalloc.c
-Index: git/crypt/crypt-entry.c
-===================================================================
---- git.orig/crypt/crypt-entry.c
-+++ git/crypt/crypt-entry.c
+diff --git a/crypt/Makefile b/crypt/Makefile
+index 34c4dd7..7c18c88 100644
+--- a/crypt/Makefile
++++ b/crypt/Makefile
+@@ -18,21 +18,25 @@
+ #
+ # Sub-makefile for crypt() portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir := crypt
+
+ include ../Makeconfig
+
+ headers := crypt.h
+
+-extra-libs := libcrypt
+-extra-libs-others := $(extra-libs)
++extra-libs-$(OPTION_EGLIBC_CRYPT) := libcrypt
++extra-libs-others-y := $(extra-libs-y)
+
+-libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \
+- crypt_util
++libcrypt-routines :=crypt-entry md5-crypt sha256-crypt sha512-crypt crypt_common
++libcrypt-routines-$(OPTION_EGLIBC_CRYPT_UFC) := crypt crypt_util
++libcrypt-routines += $(libcrypt-routines-y)
+
+-tests := cert md5c-test sha256c-test sha512c-test badsalttest
++tests-$(OPTION_EGLIBC_CRYPT) := md5c-test sha256c-test sha512c-test badsalttest
++tests-$(OPTION_EGLIBC_CRYPT_UFC) += cert
+
+-ifeq ($(crypt-in-libc),yes)
++ifeq ($(crypt-in-libc)$(OPTION_EGLIBC_CRYPT),yesy)
+ routines += $(libcrypt-routines)
+ endif
+
+@@ -44,7 +48,7 @@ LDLIBS-crypt.so = -lfreebl3
+ else
+ libcrypt-routines += md5 sha256 sha512
+
+-tests += md5test sha256test sha512test
++tests-$(OPTION_EGLIBC_CRYPT) += md5test sha256test sha512test
+
+ # The test md5test-giant uses up to 400 MB of RSS and runs on a fast
+ # machine over a minute.
+@@ -64,8 +68,10 @@ $(objpfx)sha256test: $(patsubst %, $(objpfx)%.o,$(sha256-routines))
+ $(objpfx)sha512test: $(patsubst %, $(objpfx)%.o,$(sha512-routines))
+ endif
+
++ifeq ($(OPTION_EGLIBC_CRYPT),y)
+ ifeq (yes,$(build-shared))
+ $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so
+ else
+ $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.a
+ endif
++endif # eglibc: OPTION_EGLIBC_CRYPT
+diff --git a/crypt/crypt-entry.c b/crypt/crypt-entry.c
+index 7e655ba..6ae5c2b 100644
+--- a/crypt/crypt-entry.c
++++ b/crypt/crypt-entry.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#endif
}
-Index: git/crypt/Makefile
-===================================================================
---- git.orig/crypt/Makefile
-+++ git/crypt/Makefile
-@@ -18,21 +18,25 @@
- #
- # Sub-makefile for crypt() portion of the library.
- #
-+include ../option-groups.mak
+diff --git a/crypt/crypt_common.c b/crypt/crypt_common.c
+new file mode 100644
+index 0000000..cce6a31
+--- /dev/null
++++ b/crypt/crypt_common.c
+@@ -0,0 +1,42 @@
++/*
++ * crypt: crypt(3) implementation
++ *
++ * Copyright (C) 1991-2014 Free Software Foundation, Inc.
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; see the file COPYING.LIB. If not,
++ * see <http://www.gnu.org/licenses/>.
++ *
++ * General Support routines
++ *
++ */
+
- subdir := crypt
-
- include ../Makeconfig
-
- headers := crypt.h
-
--extra-libs := libcrypt
--extra-libs-others := $(extra-libs)
-+extra-libs-$(OPTION_EGLIBC_CRYPT) := libcrypt
-+extra-libs-others-y := $(extra-libs-y)
-
--libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \
-- crypt_util
-+libcrypt-routines :=crypt-entry md5-crypt sha256-crypt sha512-crypt crypt_common
-+libcrypt-routines-$(OPTION_EGLIBC_CRYPT_UFC) := crypt crypt_util
-+libcrypt-routines += $(libcrypt-routines-y)
-
--tests := cert md5c-test sha256c-test sha512c-test badsalttest
-+tests-$(OPTION_EGLIBC_CRYPT) := md5c-test sha256c-test sha512c-test badsalttest
-+tests-$(OPTION_EGLIBC_CRYPT_UFC) += cert
-
--ifeq ($(crypt-in-libc),yes)
-+ifeq ($(crypt-in-libc)$(OPTION_EGLIBC_CRYPT),yesy)
- routines += $(libcrypt-routines)
- endif
-
-@@ -44,7 +48,7 @@ LDLIBS-crypt.so = -lfreebl3
- else
- libcrypt-routines += md5 sha256 sha512
-
--tests += md5test sha256test sha512test
-+tests-$(OPTION_EGLIBC_CRYPT) += md5test sha256test sha512test
-
- # The test md5test-giant uses up to 400 MB of RSS and runs on a fast
- # machine over a minute.
-@@ -64,8 +68,10 @@ $(objpfx)sha256test: $(patsubst %, $(obj
- $(objpfx)sha512test: $(patsubst %, $(objpfx)%.o,$(sha512-routines))
- endif
++#include "crypt-private.h"
++
++/* Table with characters for base64 transformation. */
++static const char b64t[64] =
++"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
++
++void
++__b64_from_24bit (char **cp, int *buflen,
++ unsigned int b2, unsigned int b1, unsigned int b0,
++ int n)
++{
++ unsigned int w = (b2 << 16) | (b1 << 8) | b0;
++ while (n-- > 0 && (*buflen) > 0)
++ {
++ *(*cp)++ = b64t[w & 0x3f];
++ --(*buflen);
++ w >>= 6;
++ }
++}
+diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c
+index 1597885..9297974 100644
+--- a/crypt/crypt_util.c
++++ b/crypt/crypt_util.c
+@@ -242,10 +242,6 @@ static ufc_long eperm32tab[4][256][2];
+ */
+ static ufc_long efp[16][64][2];
-+ifeq ($(OPTION_EGLIBC_CRYPT),y)
- ifeq (yes,$(build-shared))
- $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so
- else
- $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.a
- endif
-+endif # eglibc: OPTION_EGLIBC_CRYPT
-Index: git/csu/Makefile
-===================================================================
---- git.orig/csu/Makefile
-+++ git/csu/Makefile
+-/* Table with characters for base64 transformation. */
+-static const char b64t[64] =
+-"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+-
+ /*
+ * For use by the old, non-reentrant routines
+ * (crypt/encrypt/setkey)
+@@ -949,17 +945,3 @@ setkey(__key)
+ {
+ __setkey_r(__key, &_ufc_foobar);
+ }
+-
+-void
+-__b64_from_24bit (char **cp, int *buflen,
+- unsigned int b2, unsigned int b1, unsigned int b0,
+- int n)
+-{
+- unsigned int w = (b2 << 16) | (b1 << 8) | b0;
+- while (n-- > 0 && (*buflen) > 0)
+- {
+- *(*cp)++ = b64t[w & 0x3f];
+- --(*buflen);
+- w >>= 6;
+- }
+-}
+diff --git a/csu/Makefile b/csu/Makefile
+index 9f0855a..b1c3363 100644
+--- a/csu/Makefile
++++ b/csu/Makefile
@@ -22,6 +22,8 @@
# crtn.o, special "initializer" and "finalizer" files used in the link
# to make the .init and .fini sections work right.
subdir := csu
include ../Makeconfig
-Index: git/debug/Makefile
-===================================================================
---- git.orig/debug/Makefile
-+++ git/debug/Makefile
+diff --git a/debug/Makefile b/debug/Makefile
+index 9ff357b..d23d97d 100644
+--- a/debug/Makefile
++++ b/debug/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for debug portion of the library.
memcpy_chk memmove_chk mempcpy_chk memset_chk stpcpy_chk \
strcat_chk strcpy_chk strncat_chk strncpy_chk stpncpy_chk \
sprintf_chk vsprintf_chk snprintf_chk vsnprintf_chk \
-@@ -36,20 +38,27 @@ routines = backtrace backtracesyms back
+@@ -36,20 +38,27 @@ routines = backtrace backtracesyms backtracesymsfd noophooks \
read_chk pread_chk pread64_chk recv_chk recvfrom_chk \
readlink_chk readlinkat_chk getwd_chk getcwd_chk \
realpath_chk fread_chk fread_u_chk \
+tests += tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6
+endif
- extra-libs = libSegFault libpcprofile
- extra-libs-others = $(extra-libs)
-Index: git/debug/segfault.c
-===================================================================
---- git.orig/debug/segfault.c
-+++ git/debug/segfault.c
+ ifeq (,$(CXX))
+ tests-unsupported = tst-chk4 tst-chk5 tst-chk6 \
+diff --git a/debug/segfault.c b/debug/segfault.c
+index 3459a2a..ee9a146 100644
+--- a/debug/segfault.c
++++ b/debug/segfault.c
@@ -30,6 +30,7 @@
#include <unistd.h>
#include <_itoa.h>
/* This is the name of the file we are writing to. If none is given
or we cannot write to this file write to stderr. */
fd = 2;
-@@ -91,6 +94,7 @@ catch_segfault (int signal, SIGCONTEXT c
+@@ -91,6 +94,7 @@ catch_segfault (int signal, SIGCONTEXT ctx)
REGISTER_DUMP;
#endif
WRITE_STRING ("\nBacktrace:\n");
/* Get the backtrace. */
-@@ -113,6 +117,7 @@ catch_segfault (int signal, SIGCONTEXT c
+@@ -113,6 +117,7 @@ catch_segfault (int signal, SIGCONTEXT ctx)
/* Now generate nicely formatted output. */
__backtrace_symbols_fd (arr + i, cnt - i, fd);
#ifdef HAVE_PROC_SELF
/* Now the link map. */
-Index: git/debug/tst-chk1.c
-===================================================================
---- git.orig/debug/tst-chk1.c
-+++ git/debug/tst-chk1.c
+diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c
+index 53559e6..362d92a 100644
+--- a/debug/tst-chk1.c
++++ b/debug/tst-chk1.c
@@ -31,6 +31,7 @@
#include <sys/select.h>
#include <sys/socket.h>
int fd = posix_openpt (O_RDWR);
if (fd != -1)
-Index: git/dlfcn/Makefile
-===================================================================
---- git.orig/dlfcn/Makefile
-+++ git/dlfcn/Makefile
+diff --git a/dlfcn/Makefile b/dlfcn/Makefile
+index 759780d..3827607 100644
+--- a/dlfcn/Makefile
++++ b/dlfcn/Makefile
@@ -15,6 +15,8 @@
# License along with the GNU C Library; if not, see
# <http://www.gnu.org/licenses/>.
subdir := dlfcn
include ../Makeconfig
-@@ -36,14 +38,18 @@ endif
+@@ -36,8 +38,11 @@ endif
ifeq (yes,$(build-shared))
tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
- bug-atexit3 tstatexit bug-dl-leaf tst-rec-dlopen
+ tstatexit bug-dl-leaf tst-rec-dlopen
-+tests-$(OPTION_EGLIBC_CXX_TESTS) += bug-atexit3
endif
++
++tests-$(OPTION_EGLIBC_CXX_TESTS) += bug-atexit3
++
modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \
defaultmod2 errmsg1mod modatexit modcxaatexit \
bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \
-- bug-atexit2-lib bug-atexit3-lib bug-dl-leaf-lib \
-+ bug-atexit2-lib bug-dl-leaf-lib \
- bug-dl-leaf-lib-cb moddummy1 moddummy2
-
-+ifeq (y,$(OPTION_EGLIBC_CXX_TESTS))
-+modules-names += bug-atexit3-lib
-+endif
- failtestmod.so-no-z-defs = yes
- glreflib2.so-no-z-defs = yes
- errmsg1mod.so-no-z-defs = yes
-Index: git/elf/Makefile
-===================================================================
---- git.orig/elf/Makefile
-+++ git/elf/Makefile
-@@ -17,6 +17,8 @@
-
- # Makefile for elf subdirectory of GNU C Library.
-
-+include ../option-groups.mak
-+
- subdir := elf
-
- include ../Makeconfig
-@@ -144,10 +146,11 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
- unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
- tst-audit1 tst-audit2 tst-audit8 tst-audit9 \
- tst-stackguard1 tst-addr1 tst-thrlock \
-- tst-unique1 tst-unique2 tst-unique3 tst-unique4 \
-+ tst-unique1 tst-unique2 \
- tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
- tst-ptrguard1
- # reldep9
-+tests-$(OPTION_EGLIBC_CXX_TESTS) += tst-unique3 tst-unique4
- ifeq ($(build-hardcoded-path-in-tests),yes)
- tests += tst-dlopen-aout
- endif
-@@ -205,8 +208,6 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
- tst-unique1mod1 tst-unique1mod2 \
- tst-unique2mod1 tst-unique2mod2 \
- tst-auditmod9a tst-auditmod9b \
-- tst-unique3lib tst-unique3lib2 \
-- tst-unique4lib \
- tst-initordera1 tst-initorderb1 \
- tst-initordera2 tst-initorderb2 \
- tst-initordera3 tst-initordera4 \
-@@ -214,6 +215,9 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
- tst-initorder2d \
- tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
- tst-array5dep tst-null-argv-lib
-+ifeq (y,$(OPTION_EGLIBC_CXX_TESTS))
-+modules-names += tst-unique3lib tst-unique3lib2 tst-unique4lib
-+endif
- ifeq (yesyes,$(have-fpie)$(build-shared))
- modules-names += tst-piemod1
- tests += tst-pie1 tst-pie2
-Index: git/elf/dl-support.c
-===================================================================
---- git.orig/elf/dl-support.c
-+++ git/elf/dl-support.c
-@@ -19,6 +19,7 @@
- /* This file defines some things that for the dynamic linker are defined in
- rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking. */
+diff --git a/elf/dl-support.c b/elf/dl-support.c
+index 4d036f1..c15f405 100644
+--- a/elf/dl-support.c
++++ b/elf/dl-support.c
+@@ -19,6 +19,7 @@
+ /* This file defines some things that for the dynamic linker are defined in
+ rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking. */
+#include <gnu/option-groups.h>
#include <errno.h>
#include <libintl.h>
#include <stdlib.h>
-@@ -42,7 +43,9 @@ char **_dl_argv = &__progname; /* This i
+@@ -42,7 +43,9 @@ char **_dl_argv = &__progname; /* This is checked for some error messages. */
const char *_dl_platform;
size_t _dl_platformlen;
int _dl_lazy;
ElfW(Addr) _dl_use_load_bias = -2;
int _dl_dynamic_weak;
-Index: git/elf/rtld.c
-===================================================================
---- git.orig/elf/rtld.c
-+++ git/elf/rtld.c
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 6d3add7..fc3a2db 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
@@ -16,6 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <dlfcn.h>
#include <fcntl.h>
-@@ -2200,6 +2201,7 @@ print_missing_version (int errcode __att
+@@ -2201,6 +2202,7 @@ print_missing_version (int errcode __attribute__ ((unused)),
objname, errstring);
}
\f
/* Nonzero if any of the debugging options is enabled. */
static int any_debug attribute_relro;
-@@ -2309,6 +2311,7 @@ a filename can be specified using the LD
+@@ -2310,6 +2312,7 @@ a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\n");
_exit (0);
}
}
\f
static void
process_dl_audit (char *str)
-@@ -2348,8 +2351,9 @@ process_envvars (enum mode *modep)
+@@ -2349,8 +2352,9 @@ process_envvars (enum mode *modep)
char **runp = _environ;
char *envline;
enum mode mode = normal;
/* This is the default place for profiling data file. */
GLRO(dl_profile_output)
= &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0];
-@@ -2376,12 +2380,14 @@ process_envvars (enum mode *modep)
+@@ -2377,12 +2381,14 @@ process_envvars (enum mode *modep)
break;
case 5:
if (memcmp (envline, "AUDIT", 5) == 0)
process_dl_audit (&envline[6]);
break;
-@@ -2447,13 +2453,14 @@ process_envvars (enum mode *modep)
+@@ -2448,13 +2454,14 @@ process_envvars (enum mode *modep)
break;
}
if (!__libc_enable_secure
&& memcmp (envline, "DYNAMIC_WEAK", 12) == 0)
GLRO(dl_dynamic_weak) = 1;
-@@ -2490,7 +2497,9 @@ process_envvars (enum mode *modep)
+@@ -2491,7 +2498,9 @@ process_envvars (enum mode *modep)
{
mode = trace;
GLRO(dl_verbose) = 1;
+#if __OPTION_EGLIBC_RTLD_DEBUG
- GLRO_dl_debug_mask |= DL_DEBUG_PRELINK;
+ GLRO(dl_debug_mask) |= DL_DEBUG_PRELINK;
+#endif
GLRO(dl_trace_prelink) = &envline[17];
}
break;
-@@ -2537,12 +2546,15 @@ process_envvars (enum mode *modep)
+@@ -2538,12 +2547,15 @@ process_envvars (enum mode *modep)
if (__access ("/etc/suid-debug", F_OK) != 0)
{
unsetenv ("MALLOC_CHECK_");
+#if __OPTION_EGLIBC_RTLD_DEBUG
- GLRO_dl_debug_mask = 0;
+ GLRO(dl_debug_mask) = 0;
+#endif
}
/* If we have to run the dynamic linker in debugging mode and the
LD_DEBUG_OUTPUT environment variable is given, we write the debug
messages to this file. */
-@@ -2567,6 +2579,7 @@ process_envvars (enum mode *modep)
+@@ -2568,6 +2580,7 @@ process_envvars (enum mode *modep)
/* We use standard output if opening the file failed. */
GLRO(dl_debug_fd) = STDOUT_FILENO;
}
}
-Index: git/extra-lib.mk
-===================================================================
---- git.orig/extra-lib.mk
-+++ git/extra-lib.mk
+diff --git a/extra-lib.mk b/extra-lib.mk
+index b10748d..d71a06f 100644
+--- a/extra-lib.mk
++++ b/extra-lib.mk
@@ -25,7 +25,9 @@ install-lib := $(install-lib)
extra-objs := $(extra-objs)
ifneq (,$(cpp-srcs-left))
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
endif
-Index: git/grp/Makefile
-===================================================================
---- git.orig/grp/Makefile
-+++ git/grp/Makefile
+diff --git a/grp/Makefile b/grp/Makefile
+index c63b552..7486f32 100644
+--- a/grp/Makefile
++++ b/grp/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for grp portion of the library.
subdir := grp
include ../Makeconfig
-@@ -29,6 +31,9 @@ routines := fgetgrent initgroups setgrou
+@@ -29,6 +31,9 @@ routines := fgetgrent initgroups setgroups \
getgrent_r getgrgid_r getgrnam_r fgetgrent_r
tests := testgrp
ifeq (yes,$(build-shared))
test-srcs := tst_fgetgrent
-Index: git/hesiod/Makefile
-===================================================================
---- git.orig/hesiod/Makefile
-+++ git/hesiod/Makefile
+diff --git a/hesiod/Makefile b/hesiod/Makefile
+index ac0bc01..38263b4 100644
+--- a/hesiod/Makefile
++++ b/hesiod/Makefile
@@ -18,12 +18,14 @@
#
# Sub-makefile for hesiod portion of the library.
subdir-dirs = nss_hesiod
vpath %.c nss_hesiod
-Index: git/iconv/gconv_db.c
-===================================================================
---- git.orig/iconv/gconv_db.c
-+++ git/iconv/gconv_db.c
+diff --git a/iconv/Makefile b/iconv/Makefile
+index 0d55eda..a1847c6 100644
+--- a/iconv/Makefile
++++ b/iconv/Makefile
+@@ -18,6 +18,8 @@
+ #
+ # Makefile for iconv.
+ #
++include ../option-groups.mak
++
+ subdir := iconv
+
+ include ../Makeconfig
+@@ -39,6 +41,11 @@ CFLAGS-iconv_charmap.c = -I../locale/programs
+ CFLAGS-dummy-repertoire.c = -I../locale/programs
+ CFLAGS-charmap.c = -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
+ -DDEFAULT_CHARMAP=null_pointer -DNEED_NULL_POINTER
++
++ifneq (y,$(OPTION_EGLIBC_SPAWN))
++CFLAGS-charmap-dir.c += -DNO_UNCOMPRESS
++endif
++
+ CFLAGS-linereader.c = -DNO_TRANSLITERATION
+ CFLAGS-simple-hash.c = -I../locale
+
+diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c
+index ce46216..ea18964 100644
+--- a/iconv/gconv_db.c
++++ b/iconv/gconv_db.c
@@ -25,6 +25,7 @@
#include <sys/param.h>
#include <bits/libc-lock.h>
#include <dlfcn.h>
#include <gconv_int.h>
-@@ -828,9 +829,11 @@ free_modules_db (struct gconv_module *no
+@@ -828,9 +829,11 @@ free_modules_db (struct gconv_module *node)
/* Free all resources if necessary. */
libc_freeres_fn (free_mem)
{
/* finddomain.c has similar problem. */
extern void _nl_finddomain_subfreeres (void) attribute_hidden;
-Index: git/iconv/gconv_trans.c
-===================================================================
---- git.orig/iconv/gconv_trans.c
-+++ git/iconv/gconv_trans.c
+diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c
+index 5d5d4d7..a7d3072 100644
+--- a/iconv/gconv_trans.c
++++ b/iconv/gconv_trans.c
@@ -23,6 +23,7 @@
#include <stdint.h>
#include <string.h>
#include <bits/libc-lock.h>
#include "gconv_int.h"
-@@ -38,15 +39,19 @@ __gconv_transliterate (struct __gconv_st
+@@ -38,15 +39,19 @@ __gconv_transliterate (struct __gconv_step *step,
unsigned char **outbufstart, size_t *irreversible)
{
/* Find out about the locale's transliteration. */
/* The input buffer. There are actually 4-byte values. */
winbuf = (const uint32_t *) *inbufp;
-@@ -58,6 +63,7 @@ __gconv_transliterate (struct __gconv_st
+@@ -58,6 +63,7 @@ __gconv_transliterate (struct __gconv_step *step,
PTR_DEMANGLE (fct);
#endif
/* If there is no transliteration information in the locale don't do
anything and return the error. */
size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_TAB_SIZE);
-@@ -193,6 +199,7 @@ __gconv_transliterate (struct __gconv_st
+@@ -193,6 +199,7 @@ __gconv_transliterate (struct __gconv_step *step,
sorted. */
break;
}
/* One last chance: use the default replacement. */
if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN) != 0)
-Index: git/iconv/iconv_prog.c
-===================================================================
---- git.orig/iconv/iconv_prog.c
-+++ git/iconv/iconv_prog.c
+diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
+index e249bce..403ece5 100644
+--- a/iconv/iconv_prog.c
++++ b/iconv/iconv_prog.c
@@ -35,6 +35,7 @@
#ifdef _POSIX_MAPPED_FILES
# include <sys/mman.h>
if (from_wrong)
{
-Index: git/iconv/Makefile
-===================================================================
---- git.orig/iconv/Makefile
-+++ git/iconv/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for iconv.
- #
-+include ../option-groups.mak
-+
- subdir := iconv
-
- include ../Makeconfig
-@@ -39,6 +41,11 @@ CFLAGS-iconv_charmap.c = -I../locale/pro
- CFLAGS-dummy-repertoire.c = -I../locale/programs
- CFLAGS-charmap.c = -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
- -DDEFAULT_CHARMAP=null_pointer -DNEED_NULL_POINTER
-+
-+ifneq (y,$(OPTION_EGLIBC_SPAWN))
-+CFLAGS-charmap-dir.c += -DNO_UNCOMPRESS
-+endif
-+
- CFLAGS-linereader.c = -DNO_TRANSLITERATION
- CFLAGS-simple-hash.c = -I../locale
-
-Index: git/iconvdata/Makefile
-===================================================================
---- git.orig/iconvdata/Makefile
-+++ git/iconvdata/Makefile
+diff --git a/iconvdata/Makefile b/iconvdata/Makefile
+index a3d1d09..0832708 100644
+--- a/iconvdata/Makefile
++++ b/iconvdata/Makefile
@@ -18,12 +18,15 @@
#
# Makefile for iconv data and code.
ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-10 \
ISO8859-11 ISO8859-13 ISO8859-14 ISO8859-15 ISO8859-16 \
T.61 ISO_6937 SJIS KOI-8 HP-ROMAN8 HP-ROMAN9 EBCDIC-AT-DE \
-@@ -63,11 +66,13 @@ modules := ISO8859-1 ISO8859-2 ISO8859-3
+@@ -63,11 +66,13 @@ modules := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 \
MAC-CENTRALEUROPE KOI8-RU ISO8859-9E \
CP770 CP771 CP772 CP773 CP774
# We can build the conversion tables for numerous charsets automatically.
-@@ -201,7 +206,7 @@ before-compile += $(addprefix $(objpfx),
+@@ -201,7 +206,7 @@ before-compile += $(addprefix $(objpfx),$(generated-modules:=.h))
ifndef avoid-generated
$(objpfx)iconv-rules: Makefile
$(make-target-directory)
echo 8bit $(gen-8bit-modules); \
echo 8bit-gap $(gen-8bit-gap-modules); } | \
LC_ALL=C \
-@@ -245,7 +250,7 @@ $(addprefix $(inst_gconvdir)/, $(modules
+@@ -245,7 +250,7 @@ $(addprefix $(inst_gconvdir)/, $(modules.so)): \
$(do-install-program)
$(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
$(do-install)
endif # build-shared = yes
-Index: git/include/netdb.h
-===================================================================
---- git.orig/include/netdb.h
-+++ git/include/netdb.h
-@@ -232,6 +232,10 @@ extern enum nss_status _nss_ ## service
+diff --git a/include/netdb.h b/include/netdb.h
+index e1f051d..f6d15aa 100644
+--- a/include/netdb.h
++++ b/include/netdb.h
+@@ -232,6 +232,10 @@ extern enum nss_status _nss_ ## service ## _gethostbyname2_r \
(const char *name, int af, struct hostent *host, \
char *buffer, size_t buflen, int *errnop, \
int *h_errnop); \
extern enum nss_status _nss_ ## service ## _gethostbyname_r \
(const char *name, struct hostent *host, char *buffer, \
size_t buflen, int *errnop, int *h_errnop); \
-Index: git/inet/Makefile
-===================================================================
---- git.orig/inet/Makefile
-+++ git/inet/Makefile
+diff --git a/inet/Makefile b/inet/Makefile
+index f1d871f..7cb1709 100644
+--- a/inet/Makefile
++++ b/inet/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for inet portion of the library.
subdir := inet
include ../Makeconfig
-@@ -27,7 +29,8 @@ headers := netinet/ether.h netinet/in.h
+@@ -27,7 +29,8 @@ headers := netinet/ether.h netinet/in.h netinet/in_systm.h \
netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \
aliases.h ifaddrs.h netinet/ip6.h netinet/icmp6.h bits/in.h
inet_lnaof inet_mkadr \
inet_netof inet_ntoa inet_net herrno herrno-loc \
gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \
-@@ -41,18 +44,23 @@ routines := htonl htons \
- getrpcent_r getrpcbyname_r getrpcbynumber_r \
+@@ -39,18 +42,23 @@ routines := htonl htons \
+ getservent_r \
ether_aton ether_aton_r ether_hton ether_line \
ether_ntoa ether_ntoa_r ether_ntoh \
- rcmd rexec ruserpass \
include ../Rules
-Index: git/intl/dcigettext.c
-===================================================================
---- git.orig/intl/dcigettext.c
-+++ git/intl/dcigettext.c
+diff --git a/intl/Makefile b/intl/Makefile
+index 9ecf8fe..587bc0d 100644
+--- a/intl/Makefile
++++ b/intl/Makefile
+@@ -16,6 +16,7 @@
+ # <http://www.gnu.org/licenses/>.
+
+ # Makefile for intl subdirectory: message handling code from GNU gettext.
++include ../option-groups.mak
+
+ subdir = intl
+
+@@ -48,7 +49,7 @@ endif
+ $(objpfx)plural.o: plural.c
+
+ ifeq ($(run-built-tests),yes)
+-ifeq (yes,$(build-shared))
++ifeq (yyyes,$(OPTION_EGLIBC_LOCALES)$(OPTION_EGLIBC_LOCALE_CODE)$(build-shared))
+ ifneq ($(strip $(MSGFMT)),:)
+ tests-special += $(objpfx)tst-translit.out $(objpfx)tst-gettext.out \
+ $(objpfx)tst-gettext2.out $(objpfx)tst-codeset.out \
+diff --git a/intl/dcigettext.c b/intl/dcigettext.c
+index 8a3f091..e271648 100644
+--- a/intl/dcigettext.c
++++ b/intl/dcigettext.c
@@ -100,11 +100,15 @@ extern int errno;
# include "libgnuintl.h"
#endif
# define gl_rwlock_rdlock __libc_rwlock_rdlock
# define gl_rwlock_wrlock __libc_rwlock_wrlock
# define gl_rwlock_unlock __libc_rwlock_unlock
-@@ -523,8 +527,10 @@ DCIGETTEXT (const char *domainname, cons
+@@ -523,8 +527,10 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
saved_errno = errno;
#ifdef _LIBC
#endif
gl_rwlock_rdlock (_nl_state_lock);
-@@ -550,7 +556,11 @@ DCIGETTEXT (const char *domainname, cons
+@@ -550,7 +556,11 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
#ifdef HAVE_PER_THREAD_LOCALE
# ifndef IN_LIBGLOCALE
# ifdef _LIBC
# else
categoryname = category_to_name (category);
# define CATEGORYNAME_INITIALIZED
-@@ -581,10 +591,12 @@ DCIGETTEXT (const char *domainname, cons
+@@ -581,10 +591,12 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
else
retval = (char *) (*foundp)->translation;
__set_errno (saved_errno);
return retval;
}
-@@ -838,10 +850,13 @@ DCIGETTEXT (const char *domainname, cons
+@@ -838,10 +850,13 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
if (plural)
retval = plural_lookup (domain, n, retval, retlen);
return retval;
}
}
-@@ -850,10 +865,12 @@ DCIGETTEXT (const char *domainname, cons
+@@ -850,10 +865,12 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
return_untranslated:
/* Return the untranslated MSGID. */
FREE_BLOCKS (block_list);
#ifndef _LIBC
if (!ENABLE_SECURE)
{
-@@ -1550,7 +1567,11 @@ guess_category_value (int category, cons
+@@ -1550,7 +1567,11 @@ guess_category_value (int category, const char *categoryname)
`LC_xxx', and `LANG'. On some systems this can be done by the
`setlocale' function itself. */
# ifdef _LIBC
# else
locale_defaulted = 0;
# if HAVE_USELOCALE
-Index: git/intl/Makefile
-===================================================================
---- git.orig/intl/Makefile
-+++ git/intl/Makefile
-@@ -16,6 +16,7 @@
- # <http://www.gnu.org/licenses/>.
-
- # Makefile for intl subdirectory: message handling code from GNU gettext.
-+include ../option-groups.mak
-
- subdir = intl
-
-@@ -48,7 +49,7 @@ endif
- $(objpfx)plural.o: plural.c
-
- ifeq ($(run-built-tests),yes)
--ifeq (yes,$(build-shared))
-+ifeq (yyyes,$(OPTION_EGLIBC_LOCALES)$(OPTION_EGLIBC_LOCALE_CODE)$(build-shared))
- ifneq ($(strip $(MSGFMT)),:)
- tests-special += $(objpfx)tst-translit.out $(objpfx)tst-gettext.out \
- $(objpfx)tst-gettext2.out $(objpfx)tst-codeset.out \
-Index: git/io/Makefile
-===================================================================
---- git.orig/io/Makefile
-+++ git/io/Makefile
+diff --git a/io/Makefile b/io/Makefile
+index 613dce0..697439e 100644
+--- a/io/Makefile
++++ b/io/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for I/O portion of the library.
aux := have_o_cloexec
-@@ -64,18 +68,22 @@ static-only-routines = stat fstat lstat
+@@ -64,18 +68,22 @@ static-only-routines = stat fstat lstat stat64 fstat64 lstat64 \
fstatat fstatat64 mknod mknodat
others := pwd
include ../Rules
-Index: git/libidn/Makefile
-===================================================================
---- git.orig/libidn/Makefile
-+++ git/libidn/Makefile
+diff --git a/libidn/Makefile b/libidn/Makefile
+index 940fa52..43aad0c 100644
+--- a/libidn/Makefile
++++ b/libidn/Makefile
@@ -16,6 +16,7 @@
# <http://www.gnu.org/licenses/>.
libcidn-routines := punycode toutf8 nfkc stringprep rfc3454 profiles idna \
iconvme
-Index: git/libidn/toutf8.c
-===================================================================
---- git.orig/libidn/toutf8.c
-+++ git/libidn/toutf8.c
+diff --git a/libidn/toutf8.c b/libidn/toutf8.c
+index c7e67ca..62df478 100644
+--- a/libidn/toutf8.c
++++ b/libidn/toutf8.c
@@ -33,6 +33,11 @@
/* Get strlen. */
#include <string.h>
#else
/**
* stringprep_locale_charset - return charset used in current locale
-Index: git/libio/fileops.c
-===================================================================
---- git.orig/libio/fileops.c
-+++ git/libio/fileops.c
-@@ -38,6 +38,7 @@
+diff --git a/libio/Makefile b/libio/Makefile
+index 7b3bcf9..27c9186 100644
+--- a/libio/Makefile
++++ b/libio/Makefile
+@@ -18,6 +18,8 @@
+ #
+ # Specific makefile for libio.
+ #
++include ../option-groups.mak
++
+ subdir := libio
+
+ include ../Makeconfig
+@@ -27,16 +29,13 @@ headers := stdio.h libio.h _G_config.h bits/stdio.h bits/stdio-lock.h \
+
+ routines := \
+ filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \
+- iofopncook iofputs iofread iofsetpos ioftell wfiledoalloc \
++ iofopncook iofputs iofread iofsetpos ioftell \
+ iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs \
+ ioseekoff ioseekpos iosetbuffer iosetvbuf ioungetc \
+ iovsprintf iovsscanf \
+ iofgetpos64 iofopen64 iofsetpos64 \
+- fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \
+- iofputws iofputws_u iogetwline iowpadn ioungetwc putwc putwc_u \
+- putwchar putwchar_u putchar putchar_u fwprintf swprintf vwprintf \
+- wprintf wscanf fwscanf vwscanf vswprintf iovswscanf swscanf wgenops \
+- wstrops wfileops iofwide fwide wmemstream \
++ putchar putchar_u \
++ iofwide \
+ \
+ clearerr feof ferror fileno fputc freopen fseek getc getchar \
+ memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \
+@@ -48,24 +47,49 @@ routines := \
+ \
+ libc_fatal fmemopen oldfmemopen
+
+-tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \
+- tst_wprintf2 tst-widetext test-fmemopen tst-ext tst-ext2 \
+- tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf tst-sscanf \
+- tst-mmap-setvbuf bug-ungetwc1 bug-ungetwc2 tst-atime tst-eof \
+- tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) += \
++ wfiledoalloc \
++ iowpadn \
++ swprintf \
++ vswprintf iovswscanf swscanf wgenops \
++ wstrops wfileops wmemstream
++routines-$(call option-disabled, OPTION_POSIX_C_LANG_WIDE_CHAR) += \
++ wdummyfileops
++routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += \
++ fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \
++ iofputws iofputws_u iogetwline ioungetwc putwc putwc_u \
++ putwchar putwchar_u fwprintf vwprintf \
++ wprintf wscanf fwscanf vwscanf \
++ fwide
++
++tests = test-fmemopen tst-ext tst-ext2 \
++ tst-mmap-setvbuf tst-atime tst-eof \
++ tst-freopen bug-ungetc bug-fseek \
+ tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \
+- tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \
+- bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
++ tst-mmap2-eofsync tst-mmap-offend bug-fopena+ \
++ bug-ungetc2 bug-ungetc3 bug-ungetc4 \
+ tst-memstream1 tst-memstream2 \
+- tst-wmemstream1 tst-wmemstream2 \
+- bug-memstream1 bug-wmemstream1 \
+- tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
+- tst-fwrite-error tst-ftell-partial-wide tst-ftell-active-handler \
+- tst-ftell-append tst-fputws
++ bug-memstream1 tst-popen1 tst-fwrite-error \
++ tst-ftell-active-handler tst-ftell-append
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++ += tst-swscanf tst-fgetws tst-setvbuf1 \
++ tst-ungetwc1 tst-ungetwc2 bug-ftell bug-ungetwc2 \
++ tst-widetext tst-fputws
++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
++ += bug-rewind bug-rewind2 bug-ungetwc1 \
++ bug-wfflush bug-wmemstream1 tst-fopenloc2 \
++ tst_getwc \
++ tst_putwc tst_wprintf tst_wprintf2 tst_wscanf \
++ tst-fgetwc bug-wsetpos tst-fseek tst-ftell-partial-wide
++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++ += tst_swprintf tst_swscanf \
++ tst-sscanf \
++ tst-wmemstream1 tst-wmemstream2
++
+ ifeq (yes,$(build-shared))
+ # Add test-fopenloc only if shared library is enabled since it depends on
+ # shared localedata objects.
+-tests += tst-fopenloc
++tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-fopenloc
+ endif
+ test-srcs = test-freopen
+
+@@ -164,13 +188,17 @@ shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \
+ oldiofsetpos64
+
+ ifeq ($(run-built-tests),yes)
++ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO))
+ tests-special += $(objpfx)test-freopen.out
++endif
++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
+ ifeq (yes,$(build-shared))
+ # Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared
+ # library is enabled since they depend on tst-fopenloc.out.
+ tests-special += $(objpfx)tst-fopenloc-cmp.out $(objpfx)tst-fopenloc-mem.out
+ endif
+ endif
++endif
+
+ include ../Rules
+
+diff --git a/libio/__fpurge.c b/libio/__fpurge.c
+index 065cf61..e32a3e9 100644
+--- a/libio/__fpurge.c
++++ b/libio/__fpurge.c
+@@ -21,7 +21,7 @@
+ void
+ __fpurge (FILE *fp)
+ {
+- if (fp->_mode > 0)
++ if (_IO_is_wide (fp))
+ {
+ /* Wide-char stream. */
+ if (_IO_in_backup (fp))
+diff --git a/libio/fileops.c b/libio/fileops.c
+index cbcd6f5..19e43c2 100644
+--- a/libio/fileops.c
++++ b/libio/fileops.c
+@@ -39,6 +39,7 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#if _LIBC
# include "../wcsmbs/wcsmbsload.h"
-@@ -172,7 +173,7 @@ _IO_new_file_close_it (_IO_FILE *fp)
+@@ -173,7 +174,7 @@ _IO_new_file_close_it (_IO_FILE *fp)
/* Free buffer. */
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
{
if (_IO_have_wbackup (fp))
_IO_free_wbackup_area (fp);
-@@ -347,6 +348,7 @@ _IO_new_file_fopen (_IO_FILE *fp, const
+@@ -348,6 +349,7 @@ _IO_new_file_fopen (_IO_FILE *fp, const char *filename, const char *mode,
cs = strstr (last_recognized + 1, ",ccs=");
if (cs != NULL)
{
/* Yep. Load the appropriate conversions and set the orientation
to wide. */
struct gconv_fcts fcts;
-@@ -406,6 +408,12 @@ _IO_new_file_fopen (_IO_FILE *fp, const
+@@ -418,6 +420,12 @@ _IO_new_file_fopen (_IO_FILE *fp, const char *filename, const char *mode,
/* Set the mode now. */
result->_mode = 1;
}
}
-Index: git/libio/__fpurge.c
-===================================================================
---- git.orig/libio/__fpurge.c
-+++ git/libio/__fpurge.c
-@@ -21,7 +21,7 @@
- void
- __fpurge (FILE *fp)
- {
-- if (fp->_mode > 0)
-+ if (_IO_is_wide (fp))
- {
- /* Wide-char stream. */
- if (_IO_in_backup (fp))
-Index: git/libio/iofwide.c
-===================================================================
---- git.orig/libio/iofwide.c
-+++ git/libio/iofwide.c
+diff --git a/libio/iofwide.c b/libio/iofwide.c
+index 0c175d1..3e9f52b 100644
+--- a/libio/iofwide.c
++++ b/libio/iofwide.c
@@ -26,6 +26,7 @@
#include <libioP.h>
/* Prototypes of libio's codecvt functions. */
static enum __codecvt_result do_out (struct _IO_codecvt *codecvt,
__mbstate_t *statep,
-@@ -499,3 +502,26 @@ do_max_length (struct _IO_codecvt *codec
+@@ -499,3 +502,26 @@ do_max_length (struct _IO_codecvt *codecvt)
return MB_CUR_MAX;
#endif
}
+}
+
+#endif
-Index: git/libio/ioseekoff.c
-===================================================================
---- git.orig/libio/ioseekoff.c
-+++ git/libio/ioseekoff.c
-@@ -60,7 +60,7 @@ _IO_seekoff_unlocked (fp, offset, dir, m
+diff --git a/libio/ioseekoff.c b/libio/ioseekoff.c
+index 11765cf..15d6230 100644
+--- a/libio/ioseekoff.c
++++ b/libio/ioseekoff.c
+@@ -60,7 +60,7 @@ _IO_seekoff_unlocked (fp, offset, dir, mode)
else
abort ();
}
_IO_free_backup_area (fp);
else
_IO_free_wbackup_area (fp);
-Index: git/libio/ioseekpos.c
-===================================================================
---- git.orig/libio/ioseekpos.c
-+++ git/libio/ioseekpos.c
+diff --git a/libio/ioseekpos.c b/libio/ioseekpos.c
+index a7652a1..6938b68 100644
+--- a/libio/ioseekpos.c
++++ b/libio/ioseekpos.c
@@ -35,7 +35,7 @@ _IO_seekpos_unlocked (fp, pos, mode)
/* If we have a backup buffer, get rid of it, since the __seekoff
callback may not know to do the right thing about it.
{
if (_IO_have_backup (fp))
_IO_free_backup_area (fp);
-Index: git/libio/iosetbuffer.c
-===================================================================
---- git.orig/libio/iosetbuffer.c
-+++ git/libio/iosetbuffer.c
+diff --git a/libio/iosetbuffer.c b/libio/iosetbuffer.c
+index 0a41c10..3d99fa0 100644
+--- a/libio/iosetbuffer.c
++++ b/libio/iosetbuffer.c
@@ -24,6 +24,8 @@
This exception applies to code released by its copyright holders
in files containing the exception. */
_IO_release_lock (fp);
}
libc_hidden_def (_IO_setbuffer)
-Index: git/libio/libioP.h
-===================================================================
---- git.orig/libio/libioP.h
-+++ git/libio/libioP.h
-@@ -42,6 +42,10 @@
+diff --git a/libio/libioP.h b/libio/libioP.h
+index 0f16e2d..d2626d6 100644
+--- a/libio/libioP.h
++++ b/libio/libioP.h
+@@ -44,6 +44,10 @@
/*# include <comthread.h>*/
#endif
#include <math_ldbl_opt.h>
#include "iolibio.h"
-@@ -508,8 +512,20 @@ extern void _IO_old_init (_IO_FILE *fp,
+@@ -523,8 +527,20 @@ extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
? _IO_do_write(_f, (_f)->_IO_write_base, \
(_f)->_IO_write_ptr-(_f)->_IO_write_base) \
: _IO_wdo_write(_f, (_f)->_wide_data->_IO_write_base, \
-Index: git/libio/Makefile
-===================================================================
---- git.orig/libio/Makefile
-+++ git/libio/Makefile
-@@ -18,6 +18,8 @@
- #
- # Specific makefile for libio.
- #
-+include ../option-groups.mak
-+
- subdir := libio
-
- include ../Makeconfig
-@@ -27,16 +29,13 @@ headers := stdio.h libio.h _G_config.h b
-
- routines := \
- filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \
-- iofopncook iofputs iofread iofsetpos ioftell wfiledoalloc \
-+ iofopncook iofputs iofread iofsetpos ioftell \
- iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs \
- ioseekoff ioseekpos iosetbuffer iosetvbuf ioungetc \
- iovsprintf iovsscanf \
- iofgetpos64 iofopen64 iofsetpos64 \
-- fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \
-- iofputws iofputws_u iogetwline iowpadn ioungetwc putwc putwc_u \
-- putwchar putwchar_u putchar putchar_u fwprintf swprintf vwprintf \
-- wprintf wscanf fwscanf vwscanf vswprintf iovswscanf swscanf wgenops \
-- wstrops wfileops iofwide fwide wmemstream \
-+ putchar putchar_u \
-+ iofwide \
- \
- clearerr feof ferror fileno fputc freopen fseek getc getchar \
- memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \
-@@ -48,24 +47,49 @@ routines := \
- \
- libc_fatal fmemopen
-
--tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \
-- tst_wprintf2 tst-widetext test-fmemopen tst-ext tst-ext2 \
-- tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf tst-sscanf \
-- tst-mmap-setvbuf bug-ungetwc1 bug-ungetwc2 tst-atime tst-eof \
-- tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \
-+routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) += \
-+ wfiledoalloc \
-+ iowpadn \
-+ swprintf \
-+ vswprintf iovswscanf swscanf wgenops \
-+ wstrops wfileops wmemstream
-+routines-$(call option-disabled, OPTION_POSIX_C_LANG_WIDE_CHAR) += \
-+ wdummyfileops
-+routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += \
-+ fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \
-+ iofputws iofputws_u iogetwline ioungetwc putwc putwc_u \
-+ putwchar putwchar_u fwprintf vwprintf \
-+ wprintf wscanf fwscanf vwscanf \
-+ fwide
-+
-+tests = test-fmemopen tst-ext tst-ext2 \
-+ tst-mmap-setvbuf tst-atime tst-eof \
-+ tst-freopen bug-ungetc bug-fseek \
- tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \
-- tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \
-- bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
-+ tst-mmap2-eofsync tst-mmap-offend bug-fopena+ \
-+ bug-ungetc2 bug-ungetc3 bug-ungetc4 \
- tst-memstream1 tst-memstream2 \
-- tst-wmemstream1 tst-wmemstream2 \
-- bug-memstream1 bug-wmemstream1 \
-- tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
-- tst-fwrite-error tst-ftell-partial-wide tst-ftell-active-handler \
-- tst-ftell-append tst-fputws
-+ bug-memstream1 tst-popen1 tst-fwrite-error \
-+ tst-ftell-active-handler tst-ftell-append
-+tests-$(OPTION_EGLIBC_LOCALE_CODE) \
-+ += tst-swscanf tst-fgetws tst-setvbuf1 \
-+ tst-ungetwc1 tst-ungetwc2 bug-ftell bug-ungetwc2 \
-+ tst-widetext tst-fputws
-+tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
-+ += bug-rewind bug-rewind2 bug-ungetwc1 \
-+ bug-wfflush bug-wmemstream1 tst-fopenloc2 \
-+ tst_getwc \
-+ tst_putwc tst_wprintf tst_wprintf2 tst_wscanf \
-+ tst-fgetwc bug-wsetpos tst-fseek tst-ftell-partial-wide
-+tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
-+ += tst_swprintf tst_swscanf \
-+ tst-sscanf \
-+ tst-wmemstream1 tst-wmemstream2
-+
- ifeq (yes,$(build-shared))
- # Add test-fopenloc only if shared library is enabled since it depends on
- # shared localedata objects.
--tests += tst-fopenloc
-+tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-fopenloc
- endif
- test-srcs = test-freopen
-
-@@ -164,13 +188,17 @@ shared-only-routines = oldiofopen oldiof
- oldiofsetpos64
-
- ifeq ($(run-built-tests),yes)
-+ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO))
- tests-special += $(objpfx)test-freopen.out
-+endif
-+ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
- ifeq (yes,$(build-shared))
- # Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared
- # library is enabled since they depend on tst-fopenloc.out.
- tests-special += $(objpfx)tst-fopenloc-cmp.out $(objpfx)tst-fopenloc-mem.out
- endif
- endif
-+endif
-
- include ../Rules
-
-Index: git/libio/wdummyfileops.c
-===================================================================
---- /dev/null
-+++ git/libio/wdummyfileops.c
-@@ -0,0 +1,161 @@
-+/* Copyright (C) 2007 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
+diff --git a/libio/wdummyfileops.c b/libio/wdummyfileops.c
+new file mode 100644
+index 0000000..c0150b8
+--- /dev/null
++++ b/libio/wdummyfileops.c
+@@ -0,0 +1,161 @@
++/* Copyright (C) 2007 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+libc_hidden_data_def (_IO_wfile_jumps)
+strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps_mmap)
+strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps_maybe_mmap)
-Index: git/locale/catnames.c
-===================================================================
---- /dev/null
-+++ git/locale/catnames.c
-@@ -0,0 +1,48 @@
-+/* Copyright (C) 2006 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include "localeinfo.h"
-+
-+/* Define an array of category names (also the environment variable names). */
-+const union catnamestr_t _nl_category_names attribute_hidden =
-+ {
-+ {
-+#define DEFINE_CATEGORY(category, category_name, items, a) \
-+ category_name,
-+#include "categories.def"
-+#undef DEFINE_CATEGORY
-+ }
-+ };
-+
-+const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden =
-+ {
-+#define DEFINE_CATEGORY(category, category_name, items, a) \
-+ [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)),
-+#include "categories.def"
-+#undef DEFINE_CATEGORY
-+ };
-+
-+/* An array of their lengths, for convenience. */
-+const uint8_t _nl_category_name_sizes[] attribute_hidden =
-+ {
-+#define DEFINE_CATEGORY(category, category_name, items, a) \
-+ [category] = sizeof (category_name) - 1,
-+#include "categories.def"
-+#undef DEFINE_CATEGORY
-+ [LC_ALL] = sizeof ("LC_ALL") - 1
-+ };
-Index: git/locale/C-ctype.c
-===================================================================
---- git.orig/locale/C-ctype.c
-+++ git/locale/C-ctype.c
+diff --git a/locale/C-ctype.c b/locale/C-ctype.c
+index aa5f19f..06be081 100644
+--- a/locale/C-ctype.c
++++ b/locale/C-ctype.c
@@ -19,8 +19,11 @@
#include "localeinfo.h"
#include <endian.h>
/* This table's entries are taken from POSIX.2 Table 2-6
``LC_CTYPE Category Definition in the POSIX Locale''.
-@@ -647,6 +650,7 @@ const struct __locale_data _nl_C_LC_CTYP
+@@ -634,6 +637,7 @@ const struct __locale_data _nl_C_LC_CTYPE attribute_hidden =
{ .word = L'7' },
{ .word = L'8' },
{ .word = L'9' },
/* _NL_CTYPE_TRANSLIT_TAB_SIZE */
{ .word = NTRANSLIT },
/* _NL_CTYPE_TRANSLIT_FROM_IDX */
-@@ -657,6 +661,22 @@ const struct __locale_data _nl_C_LC_CTYP
+@@ -644,6 +648,22 @@ const struct __locale_data _nl_C_LC_CTYPE attribute_hidden =
{ .wstr = translit_to_idx },
/* _NL_CTYPE_TRANSLIT_TO_TBL */
{ .wstr = (uint32_t *) translit_to_tbl },
/* _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN */
{ .word = 1 },
/* _NL_CTYPE_TRANSLIT_DEFAULT_MISSING */
-Index: git/locale/dummy-setlocale.c
-===================================================================
---- /dev/null
-+++ git/locale/dummy-setlocale.c
-@@ -0,0 +1,33 @@
-+/* Copyright (C) 2006 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <string.h>
-+#include <locale.h>
-+
-+char *
-+setlocale (int category, const char *locale)
-+{
-+ if (! locale
-+ || locale[0] == '\0'
-+ || strcmp (locale, "C") == 0
-+ || strcmp (locale, "POSIX") == 0)
-+ return (char *) "C";
-+ else
-+ return NULL;
-+}
-+libc_hidden_def (setlocale)
-Index: git/locale/localeinfo.h
-===================================================================
---- git.orig/locale/localeinfo.h
-+++ git/locale/localeinfo.h
-@@ -224,7 +224,7 @@ __libc_tsd_define (extern, __locale_t, L
- unused. We can manage this playing some tricks with weak references.
- But with thread-local locale settings, it becomes quite ungainly unless
- we can use __thread variables. So only in that case do we attempt this. */
--#ifndef SHARED
-+#if !defined SHARED && !defined IN_GLIBC_LOCALEDEF
- # include <tls.h>
- # define NL_CURRENT_INDIRECT 1
- #endif
-Index: git/locale/Makefile
-===================================================================
---- git.orig/locale/Makefile
-+++ git/locale/Makefile
+diff --git a/locale/Makefile b/locale/Makefile
+index f1b4343..599a1a9 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
@@ -18,27 +18,43 @@
#
# Makefile for locales.
libBrokenLocale-routines = broken_cur_max
-@@ -93,6 +109,9 @@ CPPFLAGS-locale-programs = -DLOCALE_PATH
+@@ -93,6 +109,9 @@ CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
CFLAGS-charmap-dir.c = -Wno-write-strings
# Set libof-* for each routine.
cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
-Index: git/locale/programs/charmap-dir.c
-===================================================================
---- git.orig/locale/programs/charmap-dir.c
-+++ git/locale/programs/charmap-dir.c
-@@ -19,7 +19,9 @@
- #include <error.h>
- #include <fcntl.h>
- #include <libintl.h>
-+#ifndef NO_UNCOMPRESS
- #include <spawn.h>
-+#endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -156,6 +158,7 @@ charmap_closedir (CHARMAP_DIR *cdir)
- return closedir (dir);
- }
-
-+#ifndef NO_UNCOMPRESS
- /* Creates a subprocess decompressing the given pathname, and returns
- a stream reading its output (the decompressed data). */
- static
-@@ -204,6 +207,7 @@ fopen_uncompressed (const char *pathname
- }
- return NULL;
- }
-+#endif
-
- /* Opens a charmap for reading, given its name (not an alias name). */
- FILE *
-@@ -226,6 +230,7 @@ charmap_open (const char *directory, con
- if (stream != NULL)
- return stream;
-
-+#ifndef NO_UNCOMPRESS
- memcpy (p, ".gz", 4);
- stream = fopen_uncompressed (pathname, "gzip");
- if (stream != NULL)
-@@ -235,6 +240,7 @@ charmap_open (const char *directory, con
- stream = fopen_uncompressed (pathname, "bzip2");
- if (stream != NULL)
- return stream;
-+#endif
-
- return NULL;
- }
-Index: git/locale/programs/ld-collate.c
-===================================================================
---- git.orig/locale/programs/ld-collate.c
-+++ git/locale/programs/ld-collate.c
-@@ -350,7 +350,7 @@ new_element (struct locale_collate_t *co
- }
- if (wcs != NULL)
- {
-- size_t nwcs = wcslen ((wchar_t *) wcs);
-+ size_t nwcs = wcslen_uint32 (wcs);
- uint32_t zero = 0;
- /* Handle <U0000> as a single character. */
- if (nwcs == 0)
-@@ -1776,8 +1776,7 @@ symbol `%s' has the same encoding as"),
-
- if ((*eptr)->nwcs == runp->nwcs)
- {
-- int c = wmemcmp ((wchar_t *) (*eptr)->wcs,
-- (wchar_t *) runp->wcs, runp->nwcs);
-+ int c = wmemcmp_uint32 ((*eptr)->wcs, runp->wcs, runp->nwcs);
-
- if (c == 0)
- {
-@@ -2010,9 +2009,9 @@ add_to_tablewc (uint32_t ch, struct elem
- one consecutive entry. */
- if (runp->wcnext != NULL
- && runp->nwcs == runp->wcnext->nwcs
-- && wmemcmp ((wchar_t *) runp->wcs,
-- (wchar_t *)runp->wcnext->wcs,
-- runp->nwcs - 1) == 0
-+ && wmemcmp_uint32 (runp->wcs,
-+ runp->wcnext->wcs,
-+ runp->nwcs - 1) == 0
- && (runp->wcs[runp->nwcs - 1]
- == runp->wcnext->wcs[runp->nwcs - 1] + 1))
- {
-@@ -2036,9 +2035,9 @@ add_to_tablewc (uint32_t ch, struct elem
- runp = runp->wcnext;
- while (runp->wcnext != NULL
- && runp->nwcs == runp->wcnext->nwcs
-- && wmemcmp ((wchar_t *) runp->wcs,
-- (wchar_t *)runp->wcnext->wcs,
-- runp->nwcs - 1) == 0
-+ && wmemcmp_uint32 (runp->wcs,
-+ runp->wcnext->wcs,
-+ runp->nwcs - 1) == 0
- && (runp->wcs[runp->nwcs - 1]
- == runp->wcnext->wcs[runp->nwcs - 1] + 1));
-
-Index: git/locale/programs/ld-ctype.c
-===================================================================
---- git.orig/locale/programs/ld-ctype.c
-+++ git/locale/programs/ld-ctype.c
-@@ -960,7 +960,7 @@ ctype_output (struct localedef_t *locale
- allocate_arrays (ctype, charmap, ctype->repertoire);
-
- default_missing_len = (ctype->default_missing
-- ? wcslen ((wchar_t *) ctype->default_missing)
-+ ? wcslen_uint32 (ctype->default_missing)
- : 0);
-
- init_locale_data (&file, nelems);
-@@ -1971,7 +1971,7 @@ read_translit_entry (struct linereader *
- ignore = 1;
- else
- /* This value is usable. */
-- obstack_grow (ob, to_wstr, wcslen ((wchar_t *) to_wstr) * 4);
+diff --git a/locale/catnames.c b/locale/catnames.c
+new file mode 100644
+index 0000000..9fad357
+--- /dev/null
++++ b/locale/catnames.c
+@@ -0,0 +1,48 @@
++/* Copyright (C) 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include "localeinfo.h"
++
++/* Define an array of category names (also the environment variable names). */
++const union catnamestr_t _nl_category_names attribute_hidden =
++ {
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ category_name,
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ }
++ };
++
++const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden =
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)),
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ };
++
++/* An array of their lengths, for convenience. */
++const uint8_t _nl_category_name_sizes[] attribute_hidden =
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ [category] = sizeof (category_name) - 1,
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ [LC_ALL] = sizeof ("LC_ALL") - 1
++ };
+diff --git a/locale/dummy-setlocale.c b/locale/dummy-setlocale.c
+new file mode 100644
+index 0000000..219964a
+--- /dev/null
++++ b/locale/dummy-setlocale.c
+@@ -0,0 +1,33 @@
++/* Copyright (C) 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <string.h>
++#include <locale.h>
++
++char *
++setlocale (int category, const char *locale)
++{
++ if (! locale
++ || locale[0] == '\0'
++ || strcmp (locale, "C") == 0
++ || strcmp (locale, "POSIX") == 0)
++ return (char *) "C";
++ else
++ return NULL;
++}
++libc_hidden_def (setlocale)
+diff --git a/locale/localeinfo.h b/locale/localeinfo.h
+index bdab9fe..a7516c0 100644
+--- a/locale/localeinfo.h
++++ b/locale/localeinfo.h
+@@ -232,7 +232,7 @@ __libc_tsd_define (extern, __locale_t, LOCALE)
+ unused. We can manage this playing some tricks with weak references.
+ But with thread-local locale settings, it becomes quite ungainly unless
+ we can use __thread variables. So only in that case do we attempt this. */
+-#ifndef SHARED
++#if !defined SHARED && !defined IN_GLIBC_LOCALEDEF
+ # include <tls.h>
+ # define NL_CURRENT_INDIRECT 1
+ #endif
+diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c
+index cf7adea..ef3b811 100644
+--- a/locale/programs/charmap-dir.c
++++ b/locale/programs/charmap-dir.c
+@@ -19,7 +19,9 @@
+ #include <error.h>
+ #include <fcntl.h>
+ #include <libintl.h>
++#ifndef NO_UNCOMPRESS
+ #include <spawn.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -156,6 +158,7 @@ charmap_closedir (CHARMAP_DIR *cdir)
+ return closedir (dir);
+ }
+
++#ifndef NO_UNCOMPRESS
+ /* Creates a subprocess decompressing the given pathname, and returns
+ a stream reading its output (the decompressed data). */
+ static
+@@ -204,6 +207,7 @@ fopen_uncompressed (const char *pathname, const char *compressor)
+ }
+ return NULL;
+ }
++#endif
+
+ /* Opens a charmap for reading, given its name (not an alias name). */
+ FILE *
+@@ -226,6 +230,7 @@ charmap_open (const char *directory, const char *name)
+ if (stream != NULL)
+ return stream;
+
++#ifndef NO_UNCOMPRESS
+ memcpy (p, ".gz", 4);
+ stream = fopen_uncompressed (pathname, "gzip");
+ if (stream != NULL)
+@@ -235,6 +240,7 @@ charmap_open (const char *directory, const char *name)
+ stream = fopen_uncompressed (pathname, "bzip2");
+ if (stream != NULL)
+ return stream;
++#endif
+
+ return NULL;
+ }
+diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
+index a39a94f..16e9039 100644
+--- a/locale/programs/ld-collate.c
++++ b/locale/programs/ld-collate.c
+@@ -351,7 +351,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen,
+ }
+ if (wcs != NULL)
+ {
+- size_t nwcs = wcslen ((wchar_t *) wcs);
++ size_t nwcs = wcslen_uint32 (wcs);
+ uint32_t zero = 0;
+ /* Handle <U0000> as a single character. */
+ if (nwcs == 0)
+@@ -1777,8 +1777,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name);
+
+ if ((*eptr)->nwcs == runp->nwcs)
+ {
+- int c = wmemcmp ((wchar_t *) (*eptr)->wcs,
+- (wchar_t *) runp->wcs, runp->nwcs);
++ int c = wmemcmp_uint32 ((*eptr)->wcs, runp->wcs, runp->nwcs);
+
+ if (c == 0)
+ {
+@@ -2011,9 +2010,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
+ one consecutive entry. */
+ if (runp->wcnext != NULL
+ && runp->nwcs == runp->wcnext->nwcs
+- && wmemcmp ((wchar_t *) runp->wcs,
+- (wchar_t *)runp->wcnext->wcs,
+- runp->nwcs - 1) == 0
++ && wmemcmp_uint32 (runp->wcs,
++ runp->wcnext->wcs,
++ runp->nwcs - 1) == 0
+ && (runp->wcs[runp->nwcs - 1]
+ == runp->wcnext->wcs[runp->nwcs - 1] + 1))
+ {
+@@ -2037,9 +2036,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
+ runp = runp->wcnext;
+ while (runp->wcnext != NULL
+ && runp->nwcs == runp->wcnext->nwcs
+- && wmemcmp ((wchar_t *) runp->wcs,
+- (wchar_t *)runp->wcnext->wcs,
+- runp->nwcs - 1) == 0
++ && wmemcmp_uint32 (runp->wcs,
++ runp->wcnext->wcs,
++ runp->nwcs - 1) == 0
+ && (runp->wcs[runp->nwcs - 1]
+ == runp->wcnext->wcs[runp->nwcs - 1] + 1));
+
+diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
+index 3f464ef..b7b6b51 100644
+--- a/locale/programs/ld-ctype.c
++++ b/locale/programs/ld-ctype.c
+@@ -926,7 +926,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap,
+ allocate_arrays (ctype, charmap, ctype->repertoire);
+
+ default_missing_len = (ctype->default_missing
+- ? wcslen ((wchar_t *) ctype->default_missing)
++ ? wcslen_uint32 (ctype->default_missing)
+ : 0);
+
+ init_locale_data (&file, nelems);
+@@ -1937,7 +1937,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype,
+ ignore = 1;
+ else
+ /* This value is usable. */
+- obstack_grow (ob, to_wstr, wcslen ((wchar_t *) to_wstr) * 4);
+ obstack_grow (ob, to_wstr, wcslen_uint32 (to_wstr) * 4);
first = 0;
}
-@@ -2519,8 +2519,8 @@ with character code range values one mus
+@@ -2471,8 +2471,8 @@ with character code range values one must use the absolute ellipsis `...'"));
}
handle_tok_digit:
handle_digits = 1;
goto read_charclass;
-@@ -4002,8 +4002,7 @@ allocate_arrays (struct locale_ctype_t *
+@@ -3929,8 +3929,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
while (idx < number)
{
if (res == 0)
{
replace = 1;
-@@ -4040,11 +4039,11 @@ allocate_arrays (struct locale_ctype_t *
+@@ -3967,11 +3966,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
for (size_t cnt = 0; cnt < number; ++cnt)
{
struct translit_to_t *srunp;
srunp = srunp->next;
}
/* Plus one for the extra NUL character marking the end of
-@@ -4068,18 +4067,18 @@ allocate_arrays (struct locale_ctype_t *
+@@ -3995,18 +3994,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
ctype->translit_from_idx[cnt] = from_len;
ctype->translit_to_idx[cnt] = to_len;
to_len += len;
srunp = srunp->next;
}
-Index: git/locale/programs/ld-messages.c
-===================================================================
---- git.orig/locale/programs/ld-messages.c
-+++ git/locale/programs/ld-messages.c
+diff --git a/locale/programs/ld-messages.c b/locale/programs/ld-messages.c
+index ec1a80b..736eed8 100644
+--- a/locale/programs/ld-messages.c
++++ b/locale/programs/ld-messages.c
@@ -25,6 +25,7 @@
#include <string.h>
#include <stdint.h>
#include <assert.h>
-@@ -124,6 +125,7 @@ No definition for %s category found"), "
+@@ -124,6 +125,7 @@ No definition for %s category found"), "LC_MESSAGES"));
}
else
{
int result;
regex_t re;
-@@ -140,6 +142,7 @@ No definition for %s category found"), "
+@@ -140,6 +142,7 @@ No definition for %s category found"), "LC_MESSAGES"));
}
else if (result != 0)
regfree (&re);
}
if (messages->noexpr == NULL)
-@@ -158,6 +161,7 @@ No definition for %s category found"), "
+@@ -158,6 +161,7 @@ No definition for %s category found"), "LC_MESSAGES"));
}
else
{
int result;
regex_t re;
-@@ -174,6 +178,7 @@ No definition for %s category found"), "
+@@ -174,6 +178,7 @@ No definition for %s category found"), "LC_MESSAGES"));
}
else if (result != 0)
regfree (&re);
}
}
-Index: git/locale/programs/ld-time.c
-===================================================================
---- git.orig/locale/programs/ld-time.c
-+++ git/locale/programs/ld-time.c
-@@ -215,8 +215,10 @@ No definition for %s category found"), "
+diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
+index db490c6..75dc505 100644
+--- a/locale/programs/ld-time.c
++++ b/locale/programs/ld-time.c
+@@ -215,8 +215,10 @@ No definition for %s category found"), "LC_TIME"));
}
else
{
}
}
-@@ -226,7 +228,7 @@ No definition for %s category found"), "
+@@ -226,7 +228,7 @@ No definition for %s category found"), "LC_TIME"));
const int days_per_month[12] = { 31, 29, 31, 30, 31, 30,
31, 31, 30, 31 ,30, 31 };
size_t idx;
time->era_entries =
(struct era_data *) xmalloc (time->num_era
-@@ -464,18 +466,18 @@ No definition for %s category found"), "
+@@ -464,18 +466,18 @@ No definition for %s category found"), "LC_TIME"));
}
/* Now generate the wide character name and format. */
}
else
time->era_entries[idx].wname =
-@@ -530,7 +532,16 @@ No definition for %s category found"), "
+@@ -530,7 +532,16 @@ No definition for %s category found"), "LC_TIME"));
if (time->date_fmt == NULL)
time->date_fmt = "%a %b %e %H:%M:%S %Z %Y";
if (time->wdate_fmt == NULL)
}
-Index: git/locale/programs/linereader.c
-===================================================================
---- git.orig/locale/programs/linereader.c
-+++ git/locale/programs/linereader.c
-@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const
+diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
+index 2e05130..653b68c 100644
+--- a/locale/programs/linereader.c
++++ b/locale/programs/linereader.c
+@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
{
int return_widestr = lr->return_widestr;
char *buf;
size_t bufact;
size_t bufmax = 56;
-Index: git/locale/programs/localedef.c
-===================================================================
---- git.orig/locale/programs/localedef.c
-+++ git/locale/programs/localedef.c
-@@ -114,6 +114,7 @@ void (*argp_program_version_hook) (FILE
+diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
+index 2a0f2aa..583d233 100644
+--- a/locale/programs/localedef.c
++++ b/locale/programs/localedef.c
+@@ -114,6 +114,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
#define OPT_LIST_ARCHIVE 309
#define OPT_LITTLE_ENDIAN 400
#define OPT_BIG_ENDIAN 401
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
-@@ -150,6 +151,8 @@ static const struct argp_option options[
+@@ -150,6 +151,8 @@ static const struct argp_option options[] =
N_("Generate little-endian output") },
{ "big-endian", OPT_BIG_ENDIAN, NULL, 0,
N_("Generate big-endian output") },
/* Process charmap file. */
charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1);
-@@ -338,6 +343,9 @@ parse_opt (int key, char *arg, struct ar
+@@ -338,6 +343,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
case OPT_BIG_ENDIAN:
set_big_endian (true);
break;
case 'c':
force_output = 1;
break;
-Index: git/locale/programs/locfile.c
-===================================================================
---- git.orig/locale/programs/locfile.c
-+++ git/locale/programs/locfile.c
-@@ -544,6 +544,9 @@ compare_files (const char *filename1, co
+diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
+index 33da52e..f790c4c 100644
+--- a/locale/programs/locfile.c
++++ b/locale/programs/locfile.c
+@@ -544,6 +544,9 @@ compare_files (const char *filename1, const char *filename2, size_t size,
machine running localedef. */
bool swap_endianness_p;
/* When called outside a start_locale_structure/end_locale_structure
or start_locale_prelude/end_locale_prelude block, record that the
next byte in FILE's obstack will be the first byte of a new element.
-@@ -621,7 +624,7 @@ add_locale_string (struct locale_file *f
+@@ -621,7 +624,7 @@ add_locale_string (struct locale_file *file, const char *string)
void
add_locale_wstring (struct locale_file *file, const uint32_t *string)
{
}
/* Record that FILE's next element is the 32-bit integer VALUE. */
-Index: git/locale/programs/locfile.h
-===================================================================
---- git.orig/locale/programs/locfile.h
-+++ git/locale/programs/locfile.h
-@@ -71,6 +71,8 @@ extern void write_all_categories (struct
+diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
+index 6fc441b..118b171 100644
+--- a/locale/programs/locfile.h
++++ b/locale/programs/locfile.h
+@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions,
extern bool swap_endianness_p;
maybe_swap_uint32_array (uint32_t *array, size_t n)
{
if (swap_endianness_p)
-@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array
+@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n)
/* Like maybe_swap_uint32_array, but the array of N elements is at
the end of OBSTACK's current object. */
maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
{
maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
-@@ -276,4 +280,55 @@ extern void identification_output (struc
+@@ -276,4 +280,55 @@ extern void identification_output (struct localedef_t *locale,
const struct charmap_t *charmap,
const char *output_path);
+}
+
#endif /* locfile.h */
-Index: git/locale/setlocale.c
-===================================================================
---- git.orig/locale/setlocale.c
-+++ git/locale/setlocale.c
+diff --git a/locale/setlocale.c b/locale/setlocale.c
+index fa9cb3a..8eee284 100644
+--- a/locale/setlocale.c
++++ b/locale/setlocale.c
@@ -64,36 +64,6 @@ static char *const _nl_current_used[] =
#endif
#ifdef NL_CURRENT_INDIRECT
# define WEAK_POSTLOAD(postload) weak_extern (postload)
#else
-Index: git/locale/xlocale.c
-===================================================================
---- git.orig/locale/xlocale.c
-+++ git/locale/xlocale.c
+diff --git a/locale/xlocale.c b/locale/xlocale.c
+index fec4564..f00269c 100644
+--- a/locale/xlocale.c
++++ b/locale/xlocale.c
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include "localeinfo.h"
#define DEFINE_CATEGORY(category, category_name, items, a) \
-@@ -25,6 +26,19 @@ extern struct __locale_data _nl_C_##cate
+@@ -25,6 +26,19 @@ extern struct __locale_data _nl_C_##category;
#include "categories.def"
#undef DEFINE_CATEGORY
/* Defined in locale/C-ctype.c. */
extern const char _nl_C_LC_CTYPE_class[] attribute_hidden;
extern const char _nl_C_LC_CTYPE_toupper[] attribute_hidden;
-@@ -52,3 +66,26 @@ const struct __locale_struct _nl_C_locob
+@@ -52,3 +66,26 @@ const struct __locale_struct _nl_C_locobj attribute_hidden =
.__ctype_tolower = (const int *) _nl_C_LC_CTYPE_tolower + 128,
.__ctype_toupper = (const int *) _nl_C_LC_CTYPE_toupper + 128
};
+#undef DEFINE_CATEGORY
+#endif
+#endif /* __OPTION_EGLIBC_LOCALE_CODE */
-Index: git/localedata/Makefile
-===================================================================
---- git.orig/localedata/Makefile
-+++ git/localedata/Makefile
+diff --git a/localedata/Makefile b/localedata/Makefile
+index ebf6ac9..1870753 100644
+--- a/localedata/Makefile
++++ b/localedata/Makefile
@@ -21,12 +21,22 @@ subdir := localedata
include ../Makeconfig
# List with all available character set descriptions.
-locales := $(wildcard locales/*)
+-
+all-charmaps := $(wildcard charmaps/[A-I]*) $(wildcard charmaps/[J-Z]*)
+
+all-locales := $(wildcard locales/*)
-
++
+# If the EGLIBC_LOCALES option group is not enabled, trim the
+# list of charmap and locale source files.
+ifeq ($(OPTION_EGLIBC_LOCALES),y)
subdir-dirs = tests-mbwc
vpath %.c tests-mbwc
-@@ -71,14 +81,20 @@ locale_test_suite := tst_iswalnum tst_is
+@@ -71,14 +81,20 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans \
tst_wctype tst_wcwidth
tests-special += $(objpfx)sort-test.out $(objpfx)tst-fmon.out \
$(objpfx)tst-locale.out $(objpfx)tst-rpmatch.out \
$(objpfx)tst-trans.out $(objpfx)tst-ctype.out \
-@@ -113,6 +130,7 @@ CHARMAPS := $(shell echo "$(LOCALES)" |
- CTYPE_FILES = $(addsuffix /LC_CTYPE,$(LOCALES))
- tests-special += $(addprefix $(objpfx),$(CTYPE_FILES))
+@@ -109,6 +126,7 @@ LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
+ tr_TR.ISO-8859-9 en_GB.UTF-8 uk_UA.UTF-8
+ include ../gen-locales.mk
endif
+endif
include ../Rules
-@@ -205,6 +223,11 @@ endif
+@@ -191,6 +209,11 @@ endif
include SUPPORTED
INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
# Sometimes the whole collection of locale files should be installed.
-Index: git/login/Makefile
-===================================================================
---- git.orig/login/Makefile
-+++ git/login/Makefile
+diff --git a/login/Makefile b/login/Makefile
+index 0f4bb22..4036ddb 100644
+--- a/login/Makefile
++++ b/login/Makefile
@@ -18,6 +18,7 @@
#
# Sub-makefile for login portion of the library.
ifeq (yes,$(build-pt-chown))
others += pt_chown
@@ -46,8 +49,8 @@ vpath %.c programs
- tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname
+ tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin
# Build the -lutil library with these extra functions.
-extra-libs := libutil
libutil-routines:= login login_tty logout logwtmp openpty forkpty
-Index: git/Makeconfig
-===================================================================
---- git.orig/Makeconfig
-+++ git/Makeconfig
-@@ -582,7 +582,7 @@ elf-objpfx = $(common-objpfx)elf/
- # and run on the build system, causes that program with those
- # arguments to be run on the host for which the library is built.
- ifndef test-wrapper
--test-wrapper =
-+test-wrapper = $(cross-test-wrapper)
- endif
- # Likewise, but the name of the program is preceded by
- # <variable>=<value> assignments for environment variables.
-@@ -1055,6 +1055,24 @@ else
- libm = $(common-objpfx)math/libm.a
- endif
-
-+# Generate a header file that #defines preprocessor symbols indicating
-+# which option groups are enabled. Note that the option-groups.config file
-+# may not exist at all.
-+before-compile += $(common-objpfx)gnu/option-groups.h
-+common-generated += gnu/option-groups.h gnu/option-groups.stmp
-+headers += gnu/option-groups.h
-+$(common-objpfx)gnu/option-groups.h: $(common-objpfx)gnu/option-groups.stmp; @:
-+$(common-objpfx)gnu/option-groups.stmp: \
-+ $(..)scripts/option-groups.awk \
-+ $(..)option-groups.defaults \
-+ $(wildcard $(common-objpfx)option-groups.config)
-+ $(make-target-directory)
-+ @rm -f ${@:stmp=T} $@
-+ LC_ALL=C $(AWK) -f $^ > ${@:stmp=T}
-+ $(move-if-change) ${@:stmp=T} ${@:stmp=h}
-+ touch $@
-+
-+
- # These are the subdirectories containing the library source. The order
- # is more or less arbitrary. The sorting step will take care of the
- # dependencies.
-Index: git/Makerules
-===================================================================
---- git.orig/Makerules
-+++ git/Makerules
-@@ -446,6 +446,25 @@ define sed-remove-objpfx
- endef
- endif
- \f
-+# Include targets in the selected option groups.
-+aux += $(aux-y)
-+extra-libs += $(extra-libs-y)
-+extra-libs-others += $(extra-libs-others-y)
-+extra-objs += $(extra-objs-y)
-+install-bin += $(install-bin-y)
-+install-others += $(install-others-y)
-+install-sbin += $(install-sbin-y)
-+modules += $(modules-y)
-+others += $(others-y)
-+others-pie += $(others-pie-y)
-+routines += $(routines-y)
-+static-only-routines += $(static-only-routines-y)
-+sysdep_routines += $(sysdep_routines-y)
-+test-srcs += $(test-srcs-y)
-+tests += $(tests-y)
-+xtests += $(xtests-y)
-+
-+\f
- # Modify the list of routines we build for different targets
-
- ifeq (yes,$(build-shared))
-Index: git/malloc/Makefile
-===================================================================
---- git.orig/malloc/Makefile
-+++ git/malloc/Makefile
+diff --git a/malloc/Makefile b/malloc/Makefile
+index 67ed293..272ca4d 100644
+--- a/malloc/Makefile
++++ b/malloc/Makefile
@@ -18,6 +18,8 @@
#
# Makefile for malloc routines
subdir := malloc
include ../Makeconfig
-@@ -36,9 +38,15 @@ install-lib := libmcheck.a
+@@ -39,9 +41,15 @@ install-lib := libmcheck.a
non-lib.a := libmcheck.a
# Additional library.
libmemusage-routines = memusage
libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes))
-@@ -65,7 +73,7 @@ endif
+@@ -71,7 +79,7 @@ endif
# Unless we get a test for the availability of libgd which also works
# for cross-compiling we disable the memusagestat generation in this
# situation.
# If the gd library is available we build the `memusagestat' program.
ifneq ($(LIBGD),no)
others: $(objpfx)memusage
-Index: git/malloc/memusage.c
-===================================================================
---- git.orig/malloc/memusage.c
-+++ git/malloc/memusage.c
+diff --git a/malloc/memusage.c b/malloc/memusage.c
+index a57ba8e..732ba9d 100644
+--- a/malloc/memusage.c
++++ b/malloc/memusage.c
@@ -33,6 +33,7 @@
#include <stdint.h>
#include <sys/mman.h>
static size_t buffer_size;
static int fd = -1;
-Index: git/malloc/memusage.sh
-===================================================================
---- git.orig/malloc/memusage.sh
-+++ git/malloc/memusage.sh
+diff --git a/malloc/memusage.sh b/malloc/memusage.sh
+index 8ab8cc2..d18f446 100755
+--- a/malloc/memusage.sh
++++ b/malloc/memusage.sh
@@ -35,7 +35,7 @@ do_missing_arg() {
# Print help message
Profile memory usage of PROGRAM.
-n,--progname=NAME Name of the program file to profile
-Index: git/math/Makefile
-===================================================================
---- git.orig/math/Makefile
-+++ git/math/Makefile
+diff --git a/math/Makefile b/math/Makefile
+index 6388bae..ed1c511 100644
+--- a/math/Makefile
++++ b/math/Makefile
@@ -21,6 +21,8 @@ subdir := math
include ../Makeconfig
# Installed header files.
headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \
-@@ -33,8 +35,8 @@ aux := setfpucw fpu_control
+@@ -34,8 +36,8 @@ aux := setfpucw fpu_control
# Build the -lm library.
libm-support = s_lib_version s_matherr s_signgam \
fclrexcpt fgetexcptflg fraiseexcpt fsetexcptflg \
-Index: git/misc/err.c
-===================================================================
---- git.orig/misc/err.c
-+++ git/misc/err.c
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <string.h>
- #include <stdio.h>
-+#include <gnu/option-groups.h>
+diff --git a/misc/Makefile b/misc/Makefile
+index aecb0da..e6b7c23 100644
+--- a/misc/Makefile
++++ b/misc/Makefile
+@@ -19,6 +19,10 @@
+ # Sub-makefile for misc portion of the library.
+ #
- #include <wchar.h>
- #define flockfile(s) _IO_flockfile (s)
-@@ -37,6 +38,7 @@ extern char *__progname;
- va_end (ap); \
++# Some system-dependent implementations of these functions use option
++# groups (see sysdeps/unix/sysv/linux/Makefile, for example).
++include ../option-groups.mak
++
+ subdir := misc
+
+ include ../Makeconfig
+@@ -46,40 +50,47 @@ routines := brk sbrk sstk ioctl \
+ select pselect \
+ acct chroot fsync sync fdatasync syncfs reboot \
+ gethostid sethostid \
+- revoke vhangup \
++ vhangup \
+ swapon swapoff mktemp mkstemp mkstemp64 mkdtemp \
+ mkostemp mkostemp64 mkstemps mkstemps64 mkostemps mkostemps64 \
+ ualarm usleep \
+ gtty stty \
+ ptrace \
+- fstab mntent mntent_r \
++ mntent mntent_r \
+ utimes lutimes futimes futimesat \
+ truncate ftruncate truncate64 ftruncate64 \
+- chflags fchflags \
+ insremque getttyent getusershell getpass ttyslot \
+ syslog syscall daemon \
+ mmap mmap64 munmap mprotect msync madvise mincore remap_file_pages\
+ mlock munlock mlockall munlockall \
+- efgcvt efgcvt_r qefgcvt qefgcvt_r \
+ hsearch hsearch_r tsearch lsearch \
+ err error ustat \
+- getsysstats dirname regexp \
++ getsysstats dirname \
+ getloadavg getclktck \
+ fgetxattr flistxattr fremovexattr fsetxattr getxattr \
+ listxattr lgetxattr llistxattr lremovexattr lsetxattr \
+ removexattr setxattr getauxval ifunc-impl-list
+
++routines-$(OPTION_POSIX_REGEXP) += regexp
++routines-$(OPTION_EGLIBC_FSTAB) += fstab
++routines-$(OPTION_EGLIBC_BSD) += chflags fchflags revoke
++routines-$(OPTION_EGLIBC_FCVT) += efgcvt efgcvt_r qefgcvt qefgcvt_r
++
+ generated += tst-error1.mtrace tst-error1-mem.out
+
+ aux := init-misc
+ install-lib := libg.a
+ gpl2lgpl := error.c error.h
+
+-tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
+- tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1
++tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \
++ tst-pselect tst-insremque tst-mntent2 bug-hsearch1
++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += tst-error1
++tests-$(OPTION_EGLIBC_FCVT) += tst-efgcvt
+ ifeq ($(run-built-tests),yes)
++ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO))
+ tests-special += $(objpfx)tst-error1-mem.out
+ endif
++endif
+
+ CFLAGS-select.c = -fexceptions -fasynchronous-unwind-tables
+ CFLAGS-tsearch.c = $(uses-callbacks)
+diff --git a/misc/err.c b/misc/err.c
+index 7b98157..efce8d5 100644
+--- a/misc/err.c
++++ b/misc/err.c
+@@ -22,6 +22,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <gnu/option-groups.h>
+
+ #include <wchar.h>
+ #define flockfile(s) _IO_flockfile (s)
+@@ -37,6 +38,7 @@ extern char *__progname;
+ va_end (ap); \
}
+#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
static void
convert_and_print (const char *format, __gnuc_va_list ap)
{
-@@ -81,6 +83,7 @@ convert_and_print (const char *format, _
+@@ -81,6 +83,7 @@ convert_and_print (const char *format, __gnuc_va_list ap)
__vfwprintf (stderr, wformat, ap);
}
void
vwarnx (const char *format, __gnuc_va_list ap)
-@@ -88,9 +91,13 @@ vwarnx (const char *format, __gnuc_va_li
+@@ -88,9 +91,13 @@ vwarnx (const char *format, __gnuc_va_list ap)
flockfile (stderr);
if (_IO_fwide (stderr, 0) > 0)
{
}
else
{
-@@ -111,6 +118,7 @@ vwarn (const char *format, __gnuc_va_lis
+@@ -111,6 +118,7 @@ vwarn (const char *format, __gnuc_va_list ap)
flockfile (stderr);
if (_IO_fwide (stderr, 0) > 0)
{
__fwprintf (stderr, L"%s: ", __progname);
if (format)
{
-@@ -119,6 +127,9 @@ vwarn (const char *format, __gnuc_va_lis
+@@ -119,6 +127,9 @@ vwarn (const char *format, __gnuc_va_list ap)
}
__set_errno (error);
__fwprintf (stderr, L"%m\n");
}
else
{
-Index: git/misc/error.c
-===================================================================
---- git.orig/misc/error.c
-+++ git/misc/error.c
+diff --git a/misc/error.c b/misc/error.c
+index aaa120d..d6cbc82 100644
+--- a/misc/error.c
++++ b/misc/error.c
@@ -35,6 +35,7 @@
#endif
# include <libintl.h>
# include <stdbool.h>
# include <stdint.h>
-@@ -205,6 +206,7 @@ error_tail (int status, int errnum, cons
+@@ -205,6 +206,7 @@ error_tail (int status, int errnum, const char *message, va_list args)
#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
{
size_t len = strlen (message) + 1;
wchar_t *wmessage = NULL;
mbstate_t st;
-@@ -265,6 +267,9 @@ error_tail (int status, int errnum, cons
+@@ -265,6 +267,9 @@ error_tail (int status, int errnum, const char *message, va_list args)
if (use_malloc)
free (wmessage);
}
else
#endif
-Index: git/misc/Makefile
-===================================================================
---- git.orig/misc/Makefile
-+++ git/misc/Makefile
-@@ -19,6 +19,10 @@
- # Sub-makefile for misc portion of the library.
- #
-
-+# Some system-dependent implementations of these functions use option
-+# groups (see sysdeps/unix/sysv/linux/Makefile, for example).
-+include ../option-groups.mak
-+
- subdir := misc
-
- include ../Makeconfig
-@@ -46,40 +50,47 @@ routines := brk sbrk sstk ioctl \
- select pselect \
- acct chroot fsync sync fdatasync syncfs reboot \
- gethostid sethostid \
-- revoke vhangup \
-+ vhangup \
- swapon swapoff mktemp mkstemp mkstemp64 mkdtemp \
- mkostemp mkostemp64 mkstemps mkstemps64 mkostemps mkostemps64 \
- ualarm usleep \
- gtty stty \
- ptrace \
-- fstab mntent mntent_r \
-+ mntent mntent_r \
- utimes lutimes futimes futimesat \
- truncate ftruncate truncate64 ftruncate64 \
-- chflags fchflags \
- insremque getttyent getusershell getpass ttyslot \
- syslog syscall daemon \
- mmap mmap64 munmap mprotect msync madvise mincore remap_file_pages\
- mlock munlock mlockall munlockall \
-- efgcvt efgcvt_r qefgcvt qefgcvt_r \
- hsearch hsearch_r tsearch lsearch \
- err error ustat \
-- getsysstats dirname regexp \
-+ getsysstats dirname \
- getloadavg getclktck \
- fgetxattr flistxattr fremovexattr fsetxattr getxattr \
- listxattr lgetxattr llistxattr lremovexattr lsetxattr \
- removexattr setxattr getauxval ifunc-impl-list
-
-+routines-$(OPTION_POSIX_REGEXP) += regexp
-+routines-$(OPTION_EGLIBC_FSTAB) += fstab
-+routines-$(OPTION_EGLIBC_BSD) += chflags fchflags revoke
-+routines-$(OPTION_EGLIBC_FCVT) += efgcvt efgcvt_r qefgcvt qefgcvt_r
-+
- generated += tst-error1.mtrace tst-error1-mem.out
-
- aux := init-misc
- install-lib := libg.a
- gpl2lgpl := error.c error.h
-
--tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
-- tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1
-+tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \
-+ tst-pselect tst-insremque tst-mntent2 bug-hsearch1
-+tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += tst-error1
-+tests-$(OPTION_EGLIBC_FCVT) += tst-efgcvt
- ifeq ($(run-built-tests),yes)
-+ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO))
- tests-special += $(objpfx)tst-error1-mem.out
- endif
-+endif
-
- CFLAGS-select.c = -fexceptions -fasynchronous-unwind-tables
- CFLAGS-tsearch.c = $(uses-callbacks)
-Index: git/misc/tst-efgcvt.c
-===================================================================
---- git.orig/misc/tst-efgcvt.c
-+++ git/misc/tst-efgcvt.c
+diff --git a/misc/tst-efgcvt.c b/misc/tst-efgcvt.c
+index 5083fec..79ed36c 100644
+--- a/misc/tst-efgcvt.c
++++ b/misc/tst-efgcvt.c
@@ -59,7 +59,7 @@ static testcase ecvt_tests[] =
{ 123.01, -4, 3, "" },
{ 126.71, -4, 3, "" },
{ 0x1p-1074, 3, -323, "494" },
{ -0x1p-1074, 3, -323, "494" },
#endif
-Index: git/nis/Makefile
-===================================================================
---- git.orig/nis/Makefile
-+++ git/nis/Makefile
+diff --git a/nis/Makefile b/nis/Makefile
+index 037e674..c967850 100644
+--- a/nis/Makefile
++++ b/nis/Makefile
@@ -18,6 +18,8 @@
#
# Makefile for NIS/NIS+ part.
vpath %.c $(subdir-dirs)
libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
-@@ -60,11 +69,11 @@ libnsl-routines = yp_xdr ypclnt ypupdate
+@@ -60,11 +69,11 @@ libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
libnss_compat-routines := $(addprefix compat-,grp pwd spwd initgroups)
libnss_compat-inhibit-o = $(filter-out .os,$(object-suffixes))
nss-nisplus nisplus-initgroups
libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes))
-@@ -80,12 +89,12 @@ libnsl-libc = $(common-objpfx)linkobj/li
+@@ -80,12 +89,12 @@ libnsl-libc = $(common-objpfx)linkobj/libc.so
# Target-specific variable setting to link objects using deprecated
# RPC interfaces with the version of libc.so that makes them available
# for new links:
-$(others:%=$(objpfx)%): $(objpfx)libnsl.a
+$(others-y:%=$(objpfx)%): $(objpfx)libnsl.a
endif
-Index: git/nptl/Makefile
-===================================================================
---- git.orig/nptl/Makefile
-+++ git/nptl/Makefile
+diff --git a/nptl/Makefile b/nptl/Makefile
+index aaca0a4..596ca3c 100644
+--- a/nptl/Makefile
++++ b/nptl/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for NPTL portion of the library.
subdir := nptl
include ../Makeconfig
-@@ -117,7 +119,7 @@ libpthread-routines = nptl-init vars eve
+@@ -118,7 +120,7 @@ libpthread-routines = nptl-init vars events version pt-interp \
pt-raise pt-system \
flockfile ftrylockfile funlockfile \
sigaction \
pthread_kill_other_threads \
pthread_getaffinity pthread_setaffinity \
pthread_attr_getaffinity pthread_attr_setaffinity \
-@@ -137,6 +139,8 @@ libpthread-routines = nptl-init vars eve
+@@ -138,8 +140,10 @@ libpthread-routines = nptl-init vars events version pt-interp \
# pthread_setgid pthread_setegid pthread_setregid \
# pthread_setresgid
+libpthread-routines-$(OPTION_EGLIBC_INET) := herrno res
+ libpthread-shared-only-routines = version pt-interp pt-allocrtsig \
+ unwind-forcedunwind
+
- libpthread-shared-only-routines = version pt-allocrtsig unwind-forcedunwind
libpthread-static-only-routines = pthread_atfork
-@@ -211,7 +215,7 @@ tests = tst-typesizes \
+ # Since cancellation handling is in large parts handled using exceptions
+@@ -220,7 +224,7 @@ tests = tst-typesizes \
tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 tst-mutexpi5 \
tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a tst-mutexpi8 \
tst-mutexpi9 \
tst-cond1 tst-cond2 tst-cond3 tst-cond4 tst-cond5 tst-cond6 tst-cond7 \
tst-cond8 tst-cond9 tst-cond10 tst-cond11 tst-cond12 tst-cond13 \
tst-cond14 tst-cond15 tst-cond16 tst-cond17 tst-cond18 tst-cond19 \
-@@ -245,14 +249,14 @@ tests = tst-typesizes \
+@@ -256,14 +260,14 @@ tests = tst-typesizes \
tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \
tst-cancel11 tst-cancel12 tst-cancel13 tst-cancel14 tst-cancel15 \
tst-cancel16 tst-cancel17 tst-cancel18 tst-cancel19 tst-cancel20 \
tst-exit1 tst-exit2 tst-exit3 \
tst-stdio1 tst-stdio2 \
tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \
-@@ -260,13 +264,12 @@ tests = tst-typesizes \
+@@ -271,13 +275,12 @@ tests = tst-typesizes \
tst-unload \
tst-dlsym1 \
tst-sysconf \
- tst-backtrace1 \
tst-abstime \
tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \
- tst-getpid1 tst-getpid2 tst-getpid3 \
-@@ -277,6 +280,17 @@ xtests = tst-setuid1 tst-setuid1-static
+ tst-getpid3 \
+@@ -288,9 +291,16 @@ xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
test-srcs = tst-oddstacklimit
+-# Test expected to fail on most targets (except x86_64) due to bug
+-# 18435 - pthread_once hangs when init routine throws an exception.
+-test-xfail-tst-once5 = yes
+# This test uses the posix_spawn functions.
+tests-$(OPTION_EGLIBC_SPAWN) += tst-exec1
+
+tests-$(OPTION_EGLIBC_CXX_TESTS) += tst-cancel24
+
+tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-locale1
-+
+
# Files which must not be linked with libpthread.
tests-nolibpthread = tst-unload
-
-@@ -363,12 +377,18 @@
- $(common-objpfx)libc.a
-
- tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \
-- tst-cancel21-static tst-cancel24-static tst-cond8-static \
-+ tst-cancel21-static tst-cond8-static \
- tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
- tst-sem12-static
--tests += tst-stackguard1-static tst-cancel21-static tst-cancel24-static \
-+
-+ifeq (y,$(OPTION_EGLIBC_CXX_TESTS))
-+tests-static += tst-cancel24-static
-+endif
-+
-+tests += tst-stackguard1-static tst-cancel21-static \
- tst-cond8-static tst-mutex8-static tst-mutexpi8-static \
- tst-sem11-static tst-sem12-static
-+tests-$(OPTION_EGLIBC_CXX_TESTS) += tst-cancel24-static
- xtests-static += tst-setuid1-static
-
- # These tests are linked with libc before libpthread
-Index: git/nptl/pthread_create.c
-===================================================================
---- git.orig/nptl/pthread_create.c
-+++ git/nptl/pthread_create.c
-@@ -32,6 +32,7 @@
- #include <exit-thread.h>
+diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
+index d10f4ea..14257ce 100644
+--- a/nptl/pthread_create.c
++++ b/nptl/pthread_create.c
+@@ -33,6 +33,7 @@
#include <default-sched.h>
+ #include <futex-internal.h>
+#include <gnu/option-groups.h>
#include <shlib-compat.h>
#include <stap-probe.h>
-@@ -261,8 +262,10 @@ START_THREAD_DEFN
+@@ -262,8 +263,10 @@ START_THREAD_DEFN
THREAD_SETMEM (pd, cpuclock_offset, now);
#endif
/* Initialize pointers to locale data. */
__ctype_init ();
-@@ -345,8 +348,10 @@ START_THREAD_DEFN
+@@ -346,8 +349,10 @@ START_THREAD_DEFN
/* Run the destructor for the thread-local data. */
__nptl_deallocate_tsd ();
/* If this is the last thread we terminate the process now. We
do not notify the debugger, it might just irritate it if there
-Index: git/nscd/Makefile
-===================================================================
---- git.orig/nscd/Makefile
-+++ git/nscd/Makefile
+diff --git a/nscd/Makefile b/nscd/Makefile
+index ede941d..f4f3f8d 100644
+--- a/nscd/Makefile
++++ b/nscd/Makefile
@@ -18,14 +18,17 @@
#
# Sub-makefile for nscd portion of the library.
endif
# To find xmalloc.c
-@@ -37,14 +40,18 @@ nscd-modules := nscd connections pwdcach
+@@ -37,14 +40,18 @@ nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
xmalloc xstrdup aicache initgrcache gai res_hconf \
netgroupcache
endif
-@@ -100,7 +107,15 @@ include $(patsubst %,$(..)cppflags-itera
+@@ -100,7 +107,15 @@ include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
$(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
ifeq ($(build-shared),yes)
+$(objpfx)nscd: $(common-objpfx)nis/libnsl.a
+endif
endif
-Index: git/nscd/nis_hash.c
-===================================================================
+diff --git a/nscd/nis_hash.c b/nscd/nis_hash.c
+new file mode 100644
+index 0000000..d244c41
--- /dev/null
-+++ git/nscd/nis_hash.c
++++ b/nscd/nis_hash.c
@@ -0,0 +1,3 @@
+/* If OPTION_EGLIBC_NIS is disabled, nscd can't get this from libnsl.so;
+ we need our own copy. */
+#include "../nis/nis_hash.c"
-Index: git/nss/fixed-nsswitch.conf
-===================================================================
+diff --git a/nss/Makefile b/nss/Makefile
+index 65ab7b5..19f0aef 100644
+--- a/nss/Makefile
++++ b/nss/Makefile
+@@ -18,28 +18,35 @@
+ #
+ # Makefile for name service switch.
+ #
++include ../option-groups.mak
++
+ subdir := nss
+
+ include ../Makeconfig
+
+ headers := nss.h
+
+-# This is the trivial part which goes into libc itself.
+-routines = nsswitch getnssent getnssent_r digits_dots \
+- $(addsuffix -lookup,$(databases))
+-
+ # These are the databases that go through nss dispatch.
+ # Caution: if you add a database here, you must add its real name
+ # in databases.def, too.
+-databases = proto service hosts network grp pwd ethers \
+- spwd netgrp alias sgrp
++databases-y = grp pwd spwd sgrp
++databases-$(OPTION_EGLIBC_INET) \
++ += proto service hosts network ethers \
++ netgrp
++databases-$(OPTION_EGLIBC_DB_ALIASES) += alias
++
++routines-$(OPTION_EGLIBC_INET) += digits_dots
+
+ ifneq (,$(filter sunrpc,$(subdirs)))
+-databases += key rpc
++databases-$(OPTION_EGLIBC_INET) += key rpc
+ have-sunrpc := 1
+ else
+ have-sunrpc := 0
+ endif
++# This is the trivial part which goes into libc itself.
++routines-y += nsswitch getnssent getnssent_r \
++ $(addsuffix -lookup,$(databases-y))
++
+ CPPFLAGS-getent.c = -DHAVE_SUNRPC=$(have-sunrpc)
+
+ others := getent makedb
+@@ -47,8 +54,9 @@ install-bin := getent makedb
+ makedb-modules = xmalloc hash-string
+ extra-objs += $(makedb-modules:=.o)
+
+-tests = test-netdb tst-nss-test1 test-digits-dots tst-nss-getpwent
+-xtests = bug-erange
++tests = tst-nss-test1 tst-nss-getpwent
++tests-$(OPTION_EGLIBC_INET) += test-netdb test-digits-dots
++xtests-$(OPTION_EGLIBC_INET) += bug-erange
+
+ # Specify rules for the nss_* modules. We have some services.
+ services := files db
+@@ -63,7 +71,7 @@ subdir-dirs = $(services:%=nss_%)
+ vpath %.c $(subdir-dirs) ../locale/programs ../intl
+
+
+-libnss_files-routines := $(addprefix files-,$(databases)) \
++libnss_files-routines := $(addprefix files-,$(databases-y)) \
+ files-initgroups files-have_o_cloexec files-init
+
+ libnss_db-dbs := $(addprefix db-,\
+@@ -86,6 +94,45 @@ tests-static = tst-nss-static
+ tests += $(tests-static)
+ endif
+
++ifneq ($(OPTION_EGLIBC_NSSWITCH),y)
++
++ifndef OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG
++$(error OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG variable left unset)
++endif
++
++ifndef OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS
++$(error OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS variable left unset)
++endif
++
++ifeq (,$(wildcard $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)))
++$(warning OPTION_EGLIBC_NSSWITCH is disabled, but fixed config file)
++$(error does not exist: $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG))
++endif
++
++ifeq (,$(wildcard $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)))
++$(warning OPTION_EGLIBC_NSSWITCH is disabled, but fixed functions file)
++$(error does not exist: $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS))
++endif
++
++before-compile := $(objpfx)fixed-nsswitch.h
++generated := fixed-nsswitch.h
++$(objpfx)fixed-nsswitch.h $(objfpx)fixed-nsswitch-libs: \
++ $(objpfx)gen-fixed-nsswitch \
++ $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)
++ $< $(objpfx)fixed-nsswitch.h \
++ $(objpfx)fixed-nsswitch-libs \
++ $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)
++
++$(objpfx)gen-fixed-nsswitch: gen-fixed-nsswitch.c \
++ $(common-objpfx)option-groups.config \
++ $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)
++ $(native-compile)
++gen-fixed-nsswitch-CFLAGS = \
++ -g3 -O -Wall \
++ -I $(objpfx) \
++ -DFIXED_FUNCTIONS='"$(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)"'
++endif
++
+ include ../Rules
+
+ ifeq (yes,$(have-selinux))
+diff --git a/nss/fixed-nsswitch.conf b/nss/fixed-nsswitch.conf
+new file mode 100644
+index 0000000..91bb675
--- /dev/null
-+++ git/nss/fixed-nsswitch.conf
++++ b/nss/fixed-nsswitch.conf
@@ -0,0 +1,22 @@
+# /etc/nsswitch.conf
+#
+rpc: files
+
+netgroup: files
-Index: git/nss/fixed-nsswitch.functions
-===================================================================
+diff --git a/nss/fixed-nsswitch.functions b/nss/fixed-nsswitch.functions
+new file mode 100644
+index 0000000..2f3fa83
--- /dev/null
-+++ git/nss/fixed-nsswitch.functions
++++ b/nss/fixed-nsswitch.functions
@@ -0,0 +1,121 @@
+/* List of functions defined for fixed NSS in GNU C Library.
+ Copyright (C) 1996, 1997, 1998, 2005 Free Software Foundation, Inc.
+/* shadow */
+DEFINE_ENT (shadow, files, sp)
+DEFINE_GET (shadow, files, spnam)
-Index: git/nss/gen-fixed-nsswitch.c
-===================================================================
+diff --git a/nss/gen-fixed-nsswitch.c b/nss/gen-fixed-nsswitch.c
+new file mode 100644
+index 0000000..6e1c98c
--- /dev/null
-+++ git/nss/gen-fixed-nsswitch.c
++++ b/nss/gen-fixed-nsswitch.c
@@ -0,0 +1,803 @@
+/* gen-fixed-nsswitch.c --- generate fixed name service data structures
+ Copyright (C) 1996-1999, 2001-2006, 2007 Free Software Foundation, Inc.
+
+ return 0;
+}
-Index: git/nss/getent.c
-===================================================================
---- git.orig/nss/getent.c
-+++ git/nss/getent.c
+diff --git a/nss/getent.c b/nss/getent.c
+index 34df848..674c8ee 100644
+--- a/nss/getent.c
++++ b/nss/getent.c
@@ -39,6 +39,7 @@
#include <netinet/ether.h>
#include <netinet/in.h>
/* Get libc version number. */
#include <version.h>
-@@ -91,6 +92,7 @@ warranty; not even for MERCHANTABILITY o
+@@ -91,6 +92,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
fprintf (stream, gettext ("Written by %s.\n"), "Thorsten Kukuk");
}
/* This is for protocols */
static void
print_protocols (struct protoent *proto)
-@@ -805,6 +813,7 @@ services_keys (int number, char *key[])
+@@ -807,6 +815,7 @@ services_keys (int number, char *key[])
return result;
}
/* This is for shadow */
static void
-@@ -871,21 +880,34 @@ struct
+@@ -873,23 +882,36 @@ struct
} databases[] =
{
#define D(name) { #name, name ## _keys },
-D(ethers)
+
+#if __OPTION_EGLIBC_INET
-+#define DN(name) D(name)
++# define DN(name) D(name)
+#else
-+#define DN(name)
++# define DN(name)
+#endif
+
+#if __OPTION_EGLIBC_DB_ALIASES
-+#define DA(name) D(name)
++# define DA(name) D(name)
+#else
-+#define DA(name)
++# define DA(name)
+#endif
+
+DN(ahosts)
+DN(networks)
D(passwd)
-D(protocols)
--D(rpc)
--D(services)
+DN(protocols)
+ #if HAVE_SUNRPC
+-D(rpc)
+DN(rpc)
+ #endif
+-D(services)
+DN(services)
D(shadow)
#undef D
{ NULL, NULL }
-Index: git/nss/getnssent_r.c
-===================================================================
---- git.orig/nss/getnssent_r.c
-+++ git/nss/getnssent_r.c
+diff --git a/nss/getnssent_r.c b/nss/getnssent_r.c
+index f5b9036..f09f7fe 100644
+--- a/nss/getnssent_r.c
++++ b/nss/getnssent_r.c
@@ -16,6 +16,7 @@
<http://www.gnu.org/licenses/>. */
#include <netdb.h>
#include "nsswitch.h"
-@@ -59,11 +60,13 @@ __nss_setent (const char *func_name, db_
+@@ -59,11 +60,13 @@ __nss_setent (const char *func_name, db_lookup_function lookup_fct,
} fct;
int no_more;
/* Cycle through the services and run their `setXXent' functions until
we find an available service. */
-@@ -101,11 +104,13 @@ __nss_endent (const char *func_name, db_
+@@ -101,11 +104,13 @@ __nss_endent (const char *func_name, db_lookup_function lookup_fct,
} fct;
int no_more;
/* Cycle through all the services and run their endXXent functions. */
no_more = setup (func_name, lookup_fct, &fct.ptr, nip, startp, 1);
-@@ -141,12 +146,14 @@ __nss_getent_r (const char *getent_func_
+@@ -141,12 +146,14 @@ __nss_getent_r (const char *getent_func_name,
int no_more;
enum nss_status status;
/* Initialize status to return if no more functions are found. */
status = NSS_STATUS_NOTFOUND;
-@@ -161,7 +168,7 @@ __nss_getent_r (const char *getent_func_
+@@ -161,7 +168,7 @@ __nss_getent_r (const char *getent_func_name,
int is_last_nip = *nip == *last_nip;
status = DL_CALL_FCT (fct.f,
/* The status is NSS_STATUS_TRYAGAIN and errno is ERANGE the
provided buffer is too small. In this case we should give
-Index: git/nss/Makefile
-===================================================================
---- git.orig/nss/Makefile
-+++ git/nss/Makefile
-@@ -18,29 +18,36 @@
- #
- # Makefile for name service switch.
- #
-+include ../option-groups.mak
-+
- subdir := nss
-
- include ../Makeconfig
-
- headers := nss.h
-
--# This is the trivial part which goes into libc itself.
--routines = nsswitch getnssent getnssent_r digits_dots \
-- $(addsuffix -lookup,$(databases))
--
- # These are the databases that go through nss dispatch.
- # Caution: if you add a database here, you must add its real name
- # in databases.def, too.
--databases = proto service hosts network grp pwd rpc ethers \
-- spwd netgrp key alias sgrp
-+databases-y = grp pwd spwd sgrp
-+databases-$(OPTION_EGLIBC_INET) \
-+ += proto service hosts network rpc ethers \
-+ netgrp key
-+databases-$(OPTION_EGLIBC_DB_ALIASES) += alias
-+
-+# This is the trivial part which goes into libc itself.
-+routines-y += nsswitch getnssent getnssent_r \
-+ $(addsuffix -lookup,$(databases-y))
-+routines-$(OPTION_EGLIBC_INET) += digits_dots
-
- others := getent makedb
- install-bin := getent makedb
- makedb-modules = xmalloc hash-string
- extra-objs += $(makedb-modules:=.o)
-
--tests = test-netdb tst-nss-test1 test-digits-dots
--xtests = bug-erange
-+tests = tst-nss-test1
-+tests-$(OPTION_EGLIBC_INET) += test-netdb test-digits-dots
-+xtests-$(OPTION_EGLIBC_INET) += bug-erange
-
- # Specify rules for the nss_* modules. We have some services.
- services := files db
-@@ -55,7 +62,7 @@ subdir-dirs = $(services:%=nss_%)
- vpath %.c $(subdir-dirs) ../locale/programs ../intl
-
-
--libnss_files-routines := $(addprefix files-,$(databases)) \
-+libnss_files-routines := $(addprefix files-,$(databases-y)) \
- files-initgroups files-have_o_cloexec files-init
-
- libnss_db-dbs := $(addprefix db-,\
-@@ -78,6 +85,45 @@ tests-static = tst-nss-static
- tests += $(tests-static)
- endif
-
-+ifneq ($(OPTION_EGLIBC_NSSWITCH),y)
-+
-+ifndef OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG
-+$(error OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG variable left unset)
-+endif
-+
-+ifndef OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS
-+$(error OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS variable left unset)
-+endif
-+
-+ifeq (,$(wildcard $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)))
-+$(warning OPTION_EGLIBC_NSSWITCH is disabled, but fixed config file)
-+$(error does not exist: $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG))
-+endif
-+
-+ifeq (,$(wildcard $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)))
-+$(warning OPTION_EGLIBC_NSSWITCH is disabled, but fixed functions file)
-+$(error does not exist: $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS))
-+endif
-+
-+before-compile := $(objpfx)fixed-nsswitch.h
-+generated := fixed-nsswitch.h
-+$(objpfx)fixed-nsswitch.h $(objfpx)fixed-nsswitch-libs: \
-+ $(objpfx)gen-fixed-nsswitch \
-+ $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)
-+ $< $(objpfx)fixed-nsswitch.h \
-+ $(objpfx)fixed-nsswitch-libs \
-+ $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)
-+
-+$(objpfx)gen-fixed-nsswitch: gen-fixed-nsswitch.c \
-+ $(common-objpfx)option-groups.config \
-+ $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)
-+ $(native-compile)
-+gen-fixed-nsswitch-CFLAGS = \
-+ -g3 -O -Wall \
-+ -I $(objpfx) \
-+ -DFIXED_FUNCTIONS='"$(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)"'
-+endif
-+
- include ../Rules
-
- ifeq (yes,$(have-selinux))
-Index: git/nss/nsswitch.c
-===================================================================
---- git.orig/nss/nsswitch.c
-+++ git/nss/nsswitch.c
-@@ -26,6 +26,7 @@
- #include <stdio_ext.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <gnu/option-groups.h>
+diff --git a/nss/nsswitch.c b/nss/nsswitch.c
+index 9712623..c81e207 100644
+--- a/nss/nsswitch.c
++++ b/nss/nsswitch.c
+@@ -26,6 +26,7 @@
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <gnu/option-groups.h>
#include <aliases.h>
#include <grp.h>
/* Prototypes for the local functions. */
static name_database *nss_parse_file (const char *fname) internal_function;
static name_database_entry *nss_getline (char *line) internal_function;
-@@ -79,6 +89,9 @@ bool __nss_database_custom[NSS_DBSIDX_ma
+@@ -79,6 +89,9 @@ bool __nss_database_custom[NSS_DBSIDX_max];
__libc_lock_define_initialized (static, lock)
#ifdef USE_NSCD
/* Nonzero if this is the nscd process. */
-@@ -109,20 +136,22 @@ __nss_database_lookup (const char *datab
+@@ -109,20 +136,22 @@ __nss_database_lookup (const char *database, const char *alternate_name,
const char *defconfig, service_user **ni)
{
/* Prevent multiple threads to change the service table. */
/* Test whether configuration data is available. */
if (service_table != NULL)
-@@ -144,6 +173,7 @@ __nss_database_lookup (const char *datab
+@@ -144,6 +173,7 @@ __nss_database_lookup (const char *database, const char *alternate_name,
*ni = entry->service;
}
/* No configuration data is available, either because nsswitch.conf
doesn't exist or because it doesn't have a line for this database.
-@@ -166,13 +196,23 @@ __nss_database_lookup (const char *datab
+@@ -166,13 +196,23 @@ __nss_database_lookup (const char *database, const char *alternate_name,
{
entry->next = defconfig_entries;
entry->service = *ni;
return *ni != NULL ? 0 : -1;
}
-@@ -252,6 +292,7 @@ __nss_next2 (service_user **ni, const ch
+@@ -252,6 +292,7 @@ __nss_next2 (service_user **ni, const char *fct_name, const char *fct2_name,
libc_hidden_def (__nss_next2)
int
attribute_compat_text_section
__nss_next (service_user **ni, const char *fct_name, void **fctp, int status,
-@@ -300,13 +341,13 @@ __nss_configure_lookup (const char *dbna
+@@ -300,13 +341,13 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
}
/* Prevent multiple threads to change the service table. */
return 0;
}
-@@ -402,7 +443,7 @@ __nss_lookup_function (service_user *ni,
+@@ -402,7 +443,7 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
void **found, *result;
/* We now modify global data. Protect it. */
/* Search the tree of functions previously requested. Data in the
tree are `known_function' structures, whose first member is a
-@@ -413,7 +454,7 @@ __nss_lookup_function (service_user *ni,
+@@ -413,7 +454,7 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
enough to a pointer to our structure to use as a lookup key that
will be passed to `known_compare' (above). */
if (found == NULL)
/* This means out-of-memory. */
result = NULL;
-@@ -440,7 +481,7 @@ __nss_lookup_function (service_user *ni,
+@@ -440,7 +481,7 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
#endif
/* Oops. We can't instantiate this node properly.
Remove it from the tree. */
free (known);
result = NULL;
}
-@@ -520,13 +561,43 @@ __nss_lookup_function (service_user *ni,
+@@ -520,13 +561,43 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
}
/* Remove the lock. */
static name_database *
internal_function
nss_parse_file (const char *fname)
-@@ -632,8 +703,10 @@ nss_parse_service_list (const char *line
+@@ -632,8 +703,10 @@ nss_parse_service_list (const char *line)
+ (line - name + 1));
if (new_service == NULL)
return result;
/* Set default actions. */
new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE;
-@@ -642,7 +715,7 @@ nss_parse_service_list (const char *line
+@@ -642,7 +715,7 @@ nss_parse_service_list (const char *line)
new_service->actions[2 + NSS_STATUS_SUCCESS] = NSS_ACTION_RETURN;
new_service->actions[2 + NSS_STATUS_RETURN] = NSS_ACTION_RETURN;
new_service->library = NULL;
/* Parse the list of services. */
result->service = nss_parse_service_list (line);
-@@ -816,6 +890,7 @@ nss_new_service (name_database *database
+@@ -816,6 +890,7 @@ nss_new_service (name_database *database, const char *name)
return *currentp;
}
#endif
#if defined SHARED && defined USE_NSCD
-@@ -834,6 +909,7 @@ nss_load_all_libraries (const char *serv
+@@ -834,6 +909,7 @@ nss_load_all_libraries (const char *service, const char *def)
}
/* Called by nscd and nscd alone. */
void
__nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
-@@ -857,8 +933,10 @@ __nss_disable_nscd (void (*cb) (size_t,
+@@ -857,8 +933,10 @@ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
__nss_not_use_nscd_services = -1;
__nss_not_use_nscd_netgroup = -1;
}
static void
free_database_entries (name_database_entry *entry)
{
-@@ -871,8 +949,8 @@ free_database_entries (name_database_ent
+@@ -871,8 +949,8 @@ free_database_entries (name_database_entry *entry)
{
service_user *olds = service;
free (top);
}
+#endif /* __OPTION_EGLIBC_NSSWITCH */
-Index: git/nss/nsswitch.h
-===================================================================
---- git.orig/nss/nsswitch.h
-+++ git/nss/nsswitch.h
+diff --git a/nss/nsswitch.h b/nss/nsswitch.h
+index a5318fa..1730977 100644
+--- a/nss/nsswitch.h
++++ b/nss/nsswitch.h
@@ -65,10 +65,20 @@ typedef struct service_user
lookup_actions actions[5];
/* Link to the underlying library object. */
} name_database_entry;
-Index: git/posix/bug-regex1.c
-===================================================================
---- git.orig/posix/bug-regex1.c
-+++ git/posix/bug-regex1.c
+diff --git a/posix/Makefile b/posix/Makefile
+index 15e8818..609ed03 100644
+--- a/posix/Makefile
++++ b/posix/Makefile
+@@ -18,6 +18,8 @@
+ #
+ # Sub-makefile for POSIX portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir := posix
+
+ include ../Makeconfig
+@@ -43,13 +45,24 @@ routines := \
+ getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \
+ getresuid getresgid setresuid setresgid \
+ pathconf sysconf fpathconf \
+- glob glob64 fnmatch regex \
++ glob glob64 fnmatch \
+ confstr \
+ getopt getopt1 getopt_init \
+ sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \
+ sched_primin sched_rr_gi sched_getaffinity sched_setaffinity \
+- getaddrinfo gai_strerror wordexp \
+ pread pwrite pread64 pwrite64 \
++ posix_madvise \
++ get_child_max sched_cpucount sched_cpualloc sched_cpufree
++
++routines-$(OPTION_EGLIBC_INET) += getaddrinfo gai_strerror
++
++ifeq (y,$(OPTION_POSIX_REGEXP_GLIBC))
++routines-$(OPTION_POSIX_REGEXP) += regex
++else
++routines-$(OPTION_POSIX_REGEXP) += xregex
++endif
++
++routines-$(OPTION_EGLIBC_SPAWN) += \
+ spawn_faction_init spawn_faction_destroy spawn_faction_addclose \
+ spawn_faction_addopen spawn_faction_adddup2 \
+ spawnattr_init spawnattr_destroy \
+@@ -61,37 +74,54 @@ routines := \
+ posix_madvise \
+ get_child_max sched_cpucount sched_cpualloc sched_cpufree
+
++routines-$(OPTION_EGLIBC_WORDEXP) += wordexp
++
+ aux := init-posix environ
+-tests := tstgetopt testfnm runtests runptests \
++tests := tstgetopt testfnm runtests \
+ tst-preadwrite tst-preadwrite64 test-vfork regexbug1 \
+- tst-mmap tst-getaddrinfo tst-truncate \
+- tst-truncate64 tst-fork tst-fnmatch tst-regexloc tst-dir \
+- tst-chmod bug-regex1 bug-regex2 bug-regex3 bug-regex4 \
+- tst-gnuglob tst-regex bug-regex5 bug-regex6 bug-regex7 \
+- bug-regex8 bug-regex9 bug-regex10 bug-regex11 bug-regex12 \
+- bug-regex13 bug-regex14 bug-regex15 bug-regex16 \
+- bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
+- bug-regex21 bug-regex22 bug-regex23 bug-regex24 \
+- bug-regex25 bug-regex26 bug-regex27 bug-regex28 \
++ tst-mmap tst-truncate \
++ tst-truncate64 tst-fork tst-dir \
++ tst-chmod bug-regex2 bug-regex3 bug-regex4 \
++ tst-gnuglob bug-regex6 bug-regex7 \
++ bug-regex8 bug-regex9 bug-regex10 bug-regex12 \
++ bug-regex14 bug-regex15 \
++ bug-regex21 bug-regex24 \
++ bug-regex27 bug-regex28 \
+ bug-regex29 bug-regex30 bug-regex31 bug-regex32 \
+- bug-regex33 tst-nice tst-nanosleep tst-regex2 \
+- transbug tst-rxspencer tst-pcre tst-boost \
+- bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
+- tst-getaddrinfo2 bug-glob1 bug-glob2 bug-glob3 tst-sysconf \
++ tst-nice tst-nanosleep \
++ transbug \
++ tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
++ bug-glob1 bug-glob2 bug-glob3 tst-sysconf \
+ tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
+ tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
+ tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
+- tst-execvp3 tst-execvp4 tst-rfc3484 tst-rfc3484-2 \
+- tst-rfc3484-3 \
+- tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \
++ tst-execvp3 tst-execvp4 \
++ tst-fnmatch2 tst-cpucount tst-cpuset \
+ bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \
+ bug-getopt5 tst-getopt_long1 bug-regex34 bug-regex35 \
+ tst-pathconf tst-getaddrinfo4 tst-rxspencer-no-utf8 \
+ tst-fnmatch3 bug-regex36 tst-getaddrinfo5
+-xtests := bug-ga2
++
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++ += tst-fnmatch tst-regexloc bug-regex1 bug-regex5 \
++ bug-regex23 bug-regex25 bug-regex32 bug-regex33
++tests-$(OPTION_EGLIBC_INET) \
++ += tst-getaddrinfo bug-ga1 tst-getaddrinfo2 \
++ tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 tst-getaddrinfo3
++tests-$(OPTION_POSIX_REGEXP_GLIBC) \
++ += runptests bug-regex11 bug-regex13 bug-regex16 \
++ tst-regex2 tst-rxspencer tst-pcre tst-boost
++ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_POSIX_REGEXP_GLIBC))
++tests += tst-regex bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
++ bug-regex22 bug-regex26
++endif
++xtests-$(OPTION_EGLIBC_INET) += bug-ga2
++
+ ifeq (yes,$(build-shared))
+ test-srcs := globtest
+-tests += wordexp-test tst-exec tst-spawn
++tests += tst-exec
++tests-$(OPTION_EGLIBC_SPAWN) += tst-spawn
++tests-$(OPTION_EGLIBC_WORDEXP) += wordexp-test
+ endif
+ tests-static = tst-exec-static tst-spawn-static
+ tests += $(tests-static)
+@@ -117,7 +147,10 @@ generated += $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
+
+ ifeq ($(run-built-tests),yes)
+ ifeq (yes,$(build-shared))
+-tests-special += $(objpfx)globtest.out $(objpfx)wordexp-tst.out
++tests-special += $(objpfx)globtest.out
++ifeq (y,$(OPTION_EGLIBC_WORDEXP))
++tests-special += $(objpfx)wordexp-tst.out
++endif
+ endif
+ endif
+
+@@ -125,12 +158,16 @@ endif
+ # XXX Please note that for now we ignore the result of this test.
+ tests-special += $(objpfx)annexc.out
+ ifeq ($(run-built-tests),yes)
+-tests-special += $(objpfx)bug-regex2-mem.out $(objpfx)bug-regex14-mem.out \
++tests-special += $(objpfx)bug-regex2-mem.out \
+ $(objpfx)bug-regex21-mem.out $(objpfx)bug-regex31-mem.out \
+- $(objpfx)tst-rxspencer-no-utf8-mem.out $(objpfx)tst-pcre-mem.out \
+- $(objpfx)tst-boost-mem.out $(objpfx)tst-getconf.out \
++ $(objpfx)tst-getconf.out \
+ $(objpfx)bug-glob2-mem.out $(objpfx)tst-vfork3-mem.out \
+ $(objpfx)tst-fnmatch-mem.out $(objpfx)bug-regex36-mem.out
++ifeq (y,$(OPTION_POSIX_REGEXP_GLIBC))
++tests-special += $(objpfx)bug-regex14-mem.out $(objpfx)tst-rxspencer-no-utf8-mem.out \
++ $(objpfx)tst-pcre-mem.out $(objpfx)tst-boost-mem.out
++endif
++
+ xtests-special += $(objpfx)bug-ga2-mem.out
+ endif
+
+@@ -143,6 +180,8 @@ $(objpfx)globtest.out: globtest.sh $(objpfx)globtest
+ $(SHELL) $< $(common-objpfx) '$(test-via-rtld-prefix)' \
+ '$(test-program-prefix)' '$(test-wrapper-env)'; \
+ $(evaluate-test)
++LDLIBS-globtest += $(shell cat $(common-objpfx)nss/fixed-nsswitch-libs)
++
+ $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
+ $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+ '$(run-program-env)' '$(test-program-prefix-after-env)'; \
+@@ -205,7 +244,10 @@ tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir);
+ tst-chmod-ARGS = $(objdir)
+ tst-vfork3-ARGS = --test-dir=$(objpfx)
+
+-tst-rxspencer-ARGS = --utf8 rxspencer/tests
++tst-rxspencer-ARGS = rxspencer/tests
++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
++tst-rxspencer-ARGS += --utf8
++endif
+ tst-rxspencer-no-utf8-ARGS = rxspencer/tests
+ tst-pcre-ARGS = PCRE.tests
+ tst-boost-ARGS = BOOST.tests
+diff --git a/posix/bug-regex1.c b/posix/bug-regex1.c
+index 38eb543..17cd1a0 100644
+--- a/posix/bug-regex1.c
++++ b/posix/bug-regex1.c
@@ -4,6 +4,7 @@
#include <string.h>
#include <regex.h>
re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_DEBUG);
-Index: git/posix/bug-regex6.c
-===================================================================
---- git.orig/posix/bug-regex6.c
-+++ git/posix/bug-regex6.c
+diff --git a/posix/bug-regex6.c b/posix/bug-regex6.c
+index efcc890..3b270c7 100644
+--- a/posix/bug-regex6.c
++++ b/posix/bug-regex6.c
@@ -22,6 +22,7 @@
#include <string.h>
#include <sys/types.h>
const char *string = "http://www.regex.com/pattern/matching.html#intro";
regmatch_t expect[10] = {
{ 0, 48 }, { 0, 5 }, { 0, 4 }, { 5, 20 }, { 7, 20 }, { 20, 42 },
-Index: git/posix/fnmatch.c
-===================================================================
---- git.orig/posix/fnmatch.c
-+++ git/posix/fnmatch.c
+diff --git a/posix/fnmatch.c b/posix/fnmatch.c
+index fd85efa..01cc9fe 100644
+--- a/posix/fnmatch.c
++++ b/posix/fnmatch.c
@@ -30,6 +30,10 @@
#include <ctype.h>
#include <string.h>
#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#endif
-@@ -131,7 +135,7 @@ extern int fnmatch (const char *pattern,
+@@ -131,7 +135,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
# define ISWCTYPE(WC, WT) iswctype (WC, WT)
# endif
/* In this case we are implementing the multibyte character handling. */
# define HANDLE_MULTIBYTE 1
# endif
-Index: git/posix/fnmatch_loop.c
-===================================================================
---- git.orig/posix/fnmatch_loop.c
-+++ git/posix/fnmatch_loop.c
+diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
+index f46c9df..74e1754 100644
+--- a/posix/fnmatch_loop.c
++++ b/posix/fnmatch_loop.c
@@ -15,6 +15,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <stdint.h>
struct STRUCT
-@@ -54,10 +56,15 @@ FCT (pattern, string, string_end, no_lea
+@@ -54,10 +56,15 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
const char *collseq = (const char *)
_NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC);
# else
while ((c = *p++) != L('\0'))
{
-@@ -277,7 +284,7 @@ FCT (pattern, string, string_end, no_lea
+@@ -277,7 +284,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
/* Leave room for the null. */
CHAR str[CHAR_CLASS_MAX_LENGTH + 1];
size_t c1 = 0;
wctype_t wt;
#endif
const CHAR *startp = p;
-@@ -307,7 +314,7 @@ FCT (pattern, string, string_end, no_lea
+@@ -307,7 +314,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
}
str[c1] = L('\0');
wt = IS_CHAR_CLASS (str);
if (wt == 0)
/* Invalid character class name. */
-@@ -680,8 +687,10 @@ FCT (pattern, string, string_end, no_lea
+@@ -680,8 +687,10 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
else
lcollseq = __collseq_table_lookup (collseq, cold);
# else
# endif
is_seqval = 0;
-@@ -857,7 +866,7 @@ FCT (pattern, string, string_end, no_lea
+@@ -857,7 +866,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
goto matched;
}
# else
# endif
}
-Index: git/posix/glob.c
-===================================================================
---- git.orig/posix/glob.c
-+++ git/posix/glob.c
+diff --git a/posix/glob.c b/posix/glob.c
+index d65e55d..1ac00a1 100644
+--- a/posix/glob.c
++++ b/posix/glob.c
@@ -25,6 +25,9 @@
#include <sys/types.h>
#include <sys/stat.h>
if (home_dir == NULL || home_dir[0] == '\0')
{
if (flags & GLOB_TILDE_CHECK)
-Index: git/posix/Makefile
-===================================================================
---- git.orig/posix/Makefile
-+++ git/posix/Makefile
-@@ -18,6 +18,8 @@
- #
- # Sub-makefile for POSIX portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := posix
-
- include ../Makeconfig
-@@ -43,13 +45,24 @@ routines := \
- getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \
- getresuid getresgid setresuid setresgid \
- pathconf sysconf fpathconf \
-- glob glob64 fnmatch regex \
-+ glob glob64 fnmatch \
- confstr \
- getopt getopt1 getopt_init \
- sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \
- sched_primin sched_rr_gi sched_getaffinity sched_setaffinity \
-- getaddrinfo gai_strerror wordexp \
- pread pwrite pread64 pwrite64 \
-+ posix_madvise \
-+ get_child_max sched_cpucount sched_cpualloc sched_cpufree
-+
-+routines-$(OPTION_EGLIBC_INET) += getaddrinfo gai_strerror
-+
-+ifeq (y,$(OPTION_POSIX_REGEXP_GLIBC))
-+routines-$(OPTION_POSIX_REGEXP) += regex
-+else
-+routines-$(OPTION_POSIX_REGEXP) += xregex
-+endif
-+
-+routines-$(OPTION_EGLIBC_SPAWN) += \
- spawn_faction_init spawn_faction_destroy spawn_faction_addclose \
- spawn_faction_addopen spawn_faction_adddup2 \
- spawnattr_init spawnattr_destroy \
-@@ -61,37 +74,53 @@ routines := \
- posix_madvise \
- get_child_max sched_cpucount sched_cpualloc sched_cpufree
-
-+routines-$(OPTION_EGLIBC_WORDEXP) += wordexp
-+
- aux := init-posix environ
--tests := tstgetopt testfnm runtests runptests \
-+tests := tstgetopt testfnm runtests \
- tst-preadwrite tst-preadwrite64 test-vfork regexbug1 \
-- tst-getlogin tst-mmap tst-getaddrinfo tst-truncate \
-- tst-truncate64 tst-fork tst-fnmatch tst-regexloc tst-dir \
-- tst-chmod bug-regex1 bug-regex2 bug-regex3 bug-regex4 \
-- tst-gnuglob tst-regex bug-regex5 bug-regex6 bug-regex7 \
-- bug-regex8 bug-regex9 bug-regex10 bug-regex11 bug-regex12 \
-- bug-regex13 bug-regex14 bug-regex15 bug-regex16 \
-- bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
-- bug-regex21 bug-regex22 bug-regex23 bug-regex24 \
-- bug-regex25 bug-regex26 bug-regex27 bug-regex28 \
-- bug-regex29 bug-regex30 bug-regex31 bug-regex32 \
-- bug-regex33 tst-nice tst-nanosleep tst-regex2 \
-- transbug tst-rxspencer tst-pcre tst-boost \
-- bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
-- tst-getaddrinfo2 bug-glob1 bug-glob2 bug-glob3 tst-sysconf \
-+ tst-getlogin tst-mmap tst-truncate \
-+ tst-truncate64 tst-fork tst-dir \
-+ tst-chmod bug-regex2 bug-regex3 bug-regex4 \
-+ tst-gnuglob bug-regex6 bug-regex7 \
-+ bug-regex8 bug-regex9 bug-regex10 bug-regex12 \
-+ bug-regex14 bug-regex15 \
-+ bug-regex21 bug-regex24 \
-+ bug-regex27 bug-regex28 \
-+ bug-regex29 bug-regex30 bug-regex31 \
-+ tst-nice tst-nanosleep \
-+ transbug \
-+ tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
-+ bug-glob1 bug-glob2 bug-glob3 tst-sysconf \
- tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
- tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
- tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
-- tst-execvp3 tst-execvp4 tst-rfc3484 tst-rfc3484-2 \
-- tst-rfc3484-3 \
-- tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \
-+ tst-execvp3 tst-execvp4 \
-+ tst-fnmatch2 tst-cpucount tst-cpuset \
- bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \
- bug-getopt5 tst-getopt_long1 bug-regex34 bug-regex35 \
- tst-pathconf tst-getaddrinfo4 tst-rxspencer-no-utf8 \
- tst-fnmatch3 bug-regex36 tst-getaddrinfo5
--xtests := bug-ga2
-+tests-$(OPTION_EGLIBC_LOCALE_CODE) \
-+ += tst-fnmatch tst-regexloc bug-regex1 bug-regex5 \
-+ bug-regex23 bug-regex25 bug-regex32 bug-regex33
-+tests-$(OPTION_EGLIBC_INET) \
-+ += tst-getaddrinfo bug-ga1 tst-getaddrinfo2 \
-+ tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 tst-getaddrinfo3
-+tests-$(OPTION_POSIX_REGEXP_GLIBC) \
-+ += runptests bug-regex11 bug-regex13 bug-regex16 \
-+ tst-regex2 tst-rxspencer tst-pcre tst-boost
-+ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_POSIX_REGEXP_GLIBC))
-+tests += tst-regex bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
-+ bug-regex22 bug-regex26
-+endif
-+xtests-$(OPTION_EGLIBC_INET) += bug-ga2
-+
- ifeq (yes,$(build-shared))
- test-srcs := globtest
--tests += wordexp-test tst-exec tst-spawn
-+tests += tst-exec
-+tests-$(OPTION_EGLIBC_SPAWN) += tst-spawn
-+tests-$(OPTION_EGLIBC_WORDEXP) += wordexp-test
- endif
- tests-static = tst-exec-static tst-spawn-static
- tests += $(tests-static)
-@@ -117,7 +146,10 @@ generated += $(addprefix wordexp-test-re
-
- ifeq ($(run-built-tests),yes)
- ifeq (yes,$(build-shared))
--tests-special += $(objpfx)globtest.out $(objpfx)wordexp-tst.out
-+tests-special += $(objpfx)globtest.out
-+ifeq (y,$(OPTION_EGLIBC_WORDEXP))
-+tests-special += $(objpfx)wordexp-tst.out
-+endif
- endif
- endif
-
-@@ -125,12 +157,16 @@ endif
- # XXX Please note that for now we ignore the result of this test.
- tests-special += $(objpfx)annexc.out
- ifeq ($(run-built-tests),yes)
--tests-special += $(objpfx)bug-regex2-mem.out $(objpfx)bug-regex14-mem.out \
-+tests-special += $(objpfx)bug-regex2-mem.out \
- $(objpfx)bug-regex21-mem.out $(objpfx)bug-regex31-mem.out \
-- $(objpfx)tst-rxspencer-no-utf8-mem.out $(objpfx)tst-pcre-mem.out \
-- $(objpfx)tst-boost-mem.out $(objpfx)tst-getconf.out \
-+ $(objpfx)tst-getconf.out \
- $(objpfx)bug-glob2-mem.out $(objpfx)tst-vfork3-mem.out \
- $(objpfx)tst-fnmatch-mem.out $(objpfx)bug-regex36-mem.out
-+ifeq (y,$(OPTION_POSIX_REGEXP_GLIBC))
-+tests-special += $(objpfx)bug-regex14-mem.out $(objpfx)tst-rxspencer-no-utf8-mem.out \
-+ $(objpfx)tst-pcre-mem.out $(objpfx)tst-boost-mem.out
-+endif
-+
- xtests-special += $(objpfx)bug-ga2-mem.out
- endif
-
-@@ -143,6 +179,8 @@ $(objpfx)globtest.out: globtest.sh $(obj
- $(SHELL) $< $(common-objpfx) '$(test-via-rtld-prefix)' \
- '$(test-program-prefix)' '$(test-wrapper-env)'; \
- $(evaluate-test)
-+LDLIBS-globtest += $(shell cat $(common-objpfx)nss/fixed-nsswitch-libs)
-+
- $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
- $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
- '$(run-program-env)' '$(test-program-prefix-after-env)'; \
-@@ -205,7 +243,10 @@ tst-dir-ARGS = `pwd` `cd $(common-objdir
- tst-chmod-ARGS = $(objdir)
- tst-vfork3-ARGS = --test-dir=$(objpfx)
-
--tst-rxspencer-ARGS = --utf8 rxspencer/tests
-+tst-rxspencer-ARGS = rxspencer/tests
-+ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
-+tst-rxspencer-ARGS += --utf8
-+endif
- tst-rxspencer-no-utf8-ARGS = rxspencer/tests
- tst-pcre-ARGS = PCRE.tests
- tst-boost-ARGS = BOOST.tests
-Index: git/posix/regcomp.c
-===================================================================
---- git.orig/posix/regcomp.c
-+++ git/posix/regcomp.c
-@@ -18,6 +18,7 @@
- <http://www.gnu.org/licenses/>. */
+diff --git a/posix/regcomp.c b/posix/regcomp.c
+index bf8aa16..6a41251 100644
+--- a/posix/regcomp.c
++++ b/posix/regcomp.c
+@@ -18,6 +18,7 @@
+ <http://www.gnu.org/licenses/>. */
#include <stdint.h>
+#include <gnu/option-groups.h>
#ifdef _LIBC
# include <locale/weight.h>
-@@ -309,7 +310,7 @@ re_compile_fastmap_iter (regex_t *bufp,
+@@ -309,7 +310,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
{
re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
int node_cnt;
for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt)
{
int node = init_state->nodes.elems[node_cnt];
-@@ -319,9 +320,9 @@ re_compile_fastmap_iter (regex_t *bufp,
+@@ -319,9 +320,9 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
{
re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c);
#ifdef RE_ENABLE_I18N
wchar_t wc;
mbstate_t state;
-@@ -352,7 +353,11 @@ re_compile_fastmap_iter (regex_t *bufp,
+@@ -352,7 +353,11 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
re_set_fastmap (fastmap, icase, ch);
}
}
else if (type == COMPLEX_BRACKET)
{
re_charset_t *cset = dfa->nodes[node].opr.mbcset;
-@@ -380,7 +385,7 @@ re_compile_fastmap_iter (regex_t *bufp,
+@@ -380,7 +385,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
i.e. where we would not find an invalid sequence. This only
applies to multibyte character sets; for single byte character
sets, the SIMPLE_BRACKET again suffices. */
&& (cset->nchar_classes || cset->non_match || cset->nranges
# ifdef _LIBC
|| cset->nequiv_classes
-@@ -408,7 +413,7 @@ re_compile_fastmap_iter (regex_t *bufp,
+@@ -408,7 +413,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
memset (&state, '\0', sizeof (state));
if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
- if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
+ if ((bufp->syntax & RE_ICASE) && dfa_mb_cur_max (dfa) > 1)
{
- if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
+ if (__wcrtomb (buf, __towlower (cset->mbchars[i]), &state)
!= (size_t) -1)
-@@ -417,7 +422,7 @@ re_compile_fastmap_iter (regex_t *bufp,
+@@ -417,7 +422,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
}
}
}
{
if (dfa->is_utf8)
dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map;
-@@ -1788,7 +1797,7 @@ peek_token (re_token_t *token, re_string
+@@ -1788,7 +1797,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
token->word_char = 0;
#ifdef RE_ENABLE_I18N
token->mb_partial = 0;
!re_string_first_byte (input, re_string_cur_idx (input)))
{
token->type = CHARACTER;
-@@ -1809,7 +1818,7 @@ peek_token (re_token_t *token, re_string
+@@ -1809,7 +1818,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
token->opr.c = c2;
token->type = CHARACTER;
#ifdef RE_ENABLE_I18N
{
wint_t wc = re_string_wchar_at (input,
re_string_cur_idx (input) + 1);
-@@ -1923,7 +1932,7 @@ peek_token (re_token_t *token, re_string
+@@ -1923,7 +1932,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
token->type = CHARACTER;
#ifdef RE_ENABLE_I18N
{
wint_t wc = re_string_wchar_at (input, re_string_cur_idx (input));
token->word_char = IS_WIDE_WORD_CHAR (wc) != 0;
-@@ -2023,7 +2032,7 @@ peek_token_bracket (re_token_t *token, r
+@@ -2023,7 +2032,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
token->opr.c = c;
#ifdef RE_ENABLE_I18N
!re_string_first_byte (input, re_string_cur_idx (input)))
{
token->type = CHARACTER;
-@@ -2246,7 +2255,7 @@ parse_expression (re_string_t *regexp, r
+@@ -2246,7 +2255,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
return NULL;
}
#ifdef RE_ENABLE_I18N
{
while (!re_string_eoi (regexp)
&& !re_string_first_byte (regexp, re_string_cur_idx (regexp)))
-@@ -2384,7 +2393,7 @@ parse_expression (re_string_t *regexp, r
+@@ -2384,7 +2393,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
*err = REG_ESPACE;
return NULL;
}
dfa->has_mb_node = 1;
break;
case OP_WORD:
-@@ -2690,7 +2699,7 @@ build_range_exp (bitset_t sbcset, bracke
+@@ -2690,7 +2699,7 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
However, for !_LIBC we have no collation elements: if the
character set is single byte, the single byte character set
that we build below suffices. parse_bracket_exp passes
if (mbcset)
{
/* Check the space of the arrays. */
-@@ -2786,7 +2795,13 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -2786,7 +2795,13 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
reg_syntax_t syntax, reg_errcode_t *err)
{
#ifdef _LIBC
const char *collseqwc;
uint32_t nrules;
int32_t table_size;
-@@ -2834,18 +2849,20 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -2834,18 +2849,20 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
if (MB_CUR_MAX == 1)
*/
if (nrules == 0)
else if (br_elem->type == COLL_SYM)
{
size_t sym_name_len = strlen ((char *) br_elem->opr.name);
-@@ -2876,11 +2893,11 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -2876,11 +2893,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
{
/* No valid character. Match it as a single byte
character. */
}
return UINT_MAX;
}
-@@ -2920,7 +2937,7 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -2920,7 +2937,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
However, if we have no collation elements, and the character set
is single byte, the single byte character set that we
build below suffices. */
{
/* Check the space of the arrays. */
if (BE (*range_alloc == mbcset->nranges, 0))
-@@ -2957,7 +2974,7 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -2957,7 +2974,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
if (MB_CUR_MAX == 1)
*/
if (nrules == 0)
else
ch_collseq = __collseq_table_lookup (collseqwc, __btowc (ch));
if (start_collseq <= ch_collseq && ch_collseq <= end_collseq)
-@@ -3035,7 +3052,10 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -3035,7 +3052,10 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
re_bitset_ptr_t sbcset;
#ifdef RE_ENABLE_I18N
re_charset_t *mbcset;
int equiv_class_alloc = 0, char_class_alloc = 0;
#endif /* not RE_ENABLE_I18N */
int non_match = 0;
-@@ -3043,9 +3063,15 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -3043,9 +3063,15 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
int token_len;
int first_round = 1;
#ifdef _LIBC
if (nrules)
{
/*
-@@ -3175,7 +3201,7 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -3175,7 +3201,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
#else
# ifdef RE_ENABLE_I18N
*err = build_range_exp (sbcset,
&range_alloc, &start_elem, &end_elem);
# else
*err = build_range_exp (sbcset, &start_elem, &end_elem);
-@@ -3191,7 +3217,7 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -3191,7 +3217,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
case SB_CHAR:
bitset_set (sbcset, start_elem.opr.ch);
break;
case MB_CHAR:
/* Check whether the array has enough space. */
if (BE (mbchar_alloc == mbcset->nmbchars, 0))
-@@ -3209,7 +3235,7 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -3209,7 +3235,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
}
mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch;
break;
case EQUIV_CLASS:
*err = build_equiv_class (sbcset,
#ifdef RE_ENABLE_I18N
-@@ -3259,11 +3285,11 @@ parse_bracket_exp (re_string_t *regexp,
+@@ -3259,11 +3285,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
#ifdef RE_ENABLE_I18N
/* Ensure only single byte characters are set. */
|| mbcset->non_match)))
{
bin_tree_t *mbc_tree;
-@@ -3332,7 +3358,7 @@ parse_bracket_element (bracket_elem_t *e
+@@ -3332,7 +3358,7 @@ parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
re_token_t *token, int token_len, re_dfa_t *dfa,
reg_syntax_t syntax, int accept_hyphen)
{
int cur_char_size;
cur_char_size = re_string_char_size_at (regexp, re_string_cur_idx (regexp));
if (cur_char_size > 1)
-@@ -3342,7 +3368,7 @@ parse_bracket_element (bracket_elem_t *e
+@@ -3342,7 +3368,7 @@ parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
re_string_skip_bytes (regexp, cur_char_size);
return REG_NOERROR;
}
re_string_skip_bytes (regexp, token_len); /* Skip a token. */
if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS
|| token->type == OP_OPEN_EQUIV_CLASS)
-@@ -3422,7 +3448,9 @@ build_equiv_class (bitset_t sbcset, re_c
+@@ -3422,7 +3448,9 @@ build_equiv_class (bitset_t sbcset, re_charset_t *mbcset,
build_equiv_class (bitset_t sbcset, const unsigned char *name)
#endif /* not RE_ENABLE_I18N */
{
uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
if (nrules != 0)
{
-@@ -3492,7 +3520,7 @@ build_equiv_class (bitset_t sbcset, cons
+@@ -3492,7 +3520,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
mbcset->equiv_classes[mbcset->nequiv_classes++] = idx1;
}
else
{
if (BE (strlen ((const char *) name) != 1, 0))
return REG_ECOLLATE;
-@@ -3526,7 +3554,7 @@ build_charclass (RE_TRANSLATE_TYPE trans
+@@ -3526,7 +3554,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
&& (strcmp (name, "upper") == 0 || strcmp (name, "lower") == 0))
name = "alpha";
/* Check the space of the arrays. */
if (BE (*char_class_alloc == mbcset->nchar_classes, 0))
{
-@@ -3542,7 +3570,7 @@ build_charclass (RE_TRANSLATE_TYPE trans
+@@ -3542,7 +3570,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
*char_class_alloc = new_char_class_alloc;
}
mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name);
#define BUILD_CHARCLASS_LOOP(ctype_func) \
do { \
-@@ -3653,7 +3681,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TR
+@@ -3653,7 +3681,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
#ifdef RE_ENABLE_I18N
/* Ensure only single byte characters are set. */
bitset_mask (sbcset, dfa->sb_char);
#endif
-@@ -3665,7 +3693,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TR
+@@ -3665,7 +3693,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
goto build_word_op_espace;
#ifdef RE_ENABLE_I18N
{
bin_tree_t *mbc_tree;
/* Build a tree for complex bracket. */
-Index: git/posix/regexec.c
-===================================================================
---- git.orig/posix/regexec.c
-+++ git/posix/regexec.c
-@@ -18,6 +18,7 @@
- <http://www.gnu.org/licenses/>. */
+diff --git a/posix/regex.h b/posix/regex.h
+index 5b1981e..2941f94 100644
+--- a/posix/regex.h
++++ b/posix/regex.h
+@@ -21,6 +21,7 @@
+ #define _REGEX_H 1
- #include <stdint.h>
+ #include <sys/types.h>
+#include <gnu/option-groups.h>
- static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
- int n) internal_function;
-@@ -186,11 +187,11 @@ static int build_trtable (const re_dfa_t
- static int check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
- const re_string_t *input, int idx)
- internal_function;
--# ifdef _LIBC
-+# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
- static unsigned int find_collation_sequence_value (const unsigned char *mbs,
- size_t name_len)
- internal_function;
--# endif /* _LIBC */
-+# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
- #endif /* RE_ENABLE_I18N */
- static int group_nodes_into_DFAstates (const re_dfa_t *dfa,
- const re_dfastate_t *state,
-@@ -255,25 +256,9 @@ regexec (preg, string, nmatch, pmatch, e
- return err != REG_NOERROR;
- }
+ /* Allow the use in C++ code. */
+ #ifdef __cplusplus
+@@ -156,6 +157,8 @@ typedef unsigned long int reg_syntax_t;
+ treated as 'a\{1'. */
+ # define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
--#ifdef _LIBC
--# include <shlib-compat.h>
--versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
--
--# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
--__typeof__ (__regexec) __compat_regexec;
--
--int
--attribute_compat_text_section
--__compat_regexec (const regex_t *__restrict preg,
-- const char *__restrict string, size_t nmatch,
-- regmatch_t pmatch[], int eflags)
--{
-- return regexec (preg, string, nmatch, pmatch,
-- eflags & (REG_NOTBOL | REG_NOTEOL));
--}
--compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
--# endif
--#endif
-+/* EGLIBC: The code that used to be here was move to a separate file
-+ so that it can be shared with xregex.c. */
-+#include "regexec-compat.c"
++/* EGLIBC: Old regex implementation does not support these. */
++# if __OPTION_POSIX_REGEXP_GLIBC
+ /* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+ # define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
+@@ -172,6 +175,7 @@ typedef unsigned long int reg_syntax_t;
+ /* If this bit is set, then no_sub will be set to 1 during
+ re_compile_pattern. */
+ # define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
++# endif /* __OPTION_POSIX_REGEXP_GLIBC */
+ #endif
- /* Entry points for GNU code. */
+ /* This global variable defines the particular regexp syntax to use (for
+@@ -231,8 +235,13 @@ extern reg_syntax_t re_syntax_options;
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
-@@ -728,7 +713,7 @@ re_search_internal (preg, string, length
- incr = (range < 0) ? -1 : 1;
- left_lim = (range < 0) ? start + range : start;
- right_lim = (range < 0) ? start : start + range;
-- sb = dfa->mb_cur_max == 1;
-+ sb = dfa_mb_cur_max (dfa) == 1;
- match_kind =
- (fastmap
- ? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0)
-@@ -3448,7 +3433,7 @@ out_free:
- if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0))
- goto out_free;
++#if __OPTION_POSIX_REGEXP_GLIBC
+ #define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
++#else
++#define RE_SYNTAX_POSIX_BASIC \
++ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
++#endif
-- if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1)
-+ if (dest_states[i] != dest_states_word[i] && dfa_mb_cur_max (dfa) > 1)
- need_word_trtable = 1;
+ /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+@@ -298,9 +307,11 @@ extern reg_syntax_t re_syntax_options;
+ /* Like REG_NOTBOL, except for the end-of-line. */
+ #define REG_NOTEOL (1 << 1)
- dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows,
-@@ -3590,7 +3575,7 @@ group_nodes_into_DFAstates (const re_dfa
- else if (type == OP_PERIOD)
- {
- #ifdef RE_ENABLE_I18N
-- if (dfa->mb_cur_max > 1)
-+ if (dfa_mb_cur_max (dfa) > 1)
- bitset_merge (accepts, dfa->sb_char);
- else
- #endif
-@@ -3641,7 +3626,7 @@ group_nodes_into_DFAstates (const re_dfa
- continue;
- }
- #ifdef RE_ENABLE_I18N
-- if (dfa->mb_cur_max > 1)
-+ if (dfa_mb_cur_max (dfa) > 1)
- for (j = 0; j < BITSET_WORDS; ++j)
- any_set |= (accepts[j] &= (dfa->word_char[j] | ~dfa->sb_char[j]));
- else
-@@ -3660,7 +3645,7 @@ group_nodes_into_DFAstates (const re_dfa
- continue;
- }
- #ifdef RE_ENABLE_I18N
-- if (dfa->mb_cur_max > 1)
-+ if (dfa_mb_cur_max (dfa) > 1)
- for (j = 0; j < BITSET_WORDS; ++j)
- any_set |= (accepts[j] &= ~(dfa->word_char[j] & dfa->sb_char[j]));
- else
-@@ -3836,12 +3821,6 @@ check_node_accept_bytes (const re_dfa_t
- if (node->type == COMPLEX_BRACKET)
- {
- const re_charset_t *cset = node->opr.mbcset;
--# ifdef _LIBC
-- const unsigned char *pin
-- = ((const unsigned char *) re_string_get_buffer (input) + str_idx);
-- int j;
-- uint32_t nrules;
--# endif /* _LIBC */
- int match_len = 0;
- wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars)
- ? re_string_wchar_at (input, str_idx) : 0);
-@@ -3853,6 +3832,7 @@ check_node_accept_bytes (const re_dfa_t
- match_len = char_len;
- goto check_node_accept_bytes_match;
- }
-+#if __OPTION_EGLIBC_LOCALE_CODE
- /* match with character_class? */
- for (i = 0; i < cset->nchar_classes; ++i)
- {
-@@ -3863,14 +3843,22 @@ check_node_accept_bytes (const re_dfa_t
- goto check_node_accept_bytes_match;
- }
- }
-+#endif
-+
-+ /* When __OPTION_EGLIBC_LOCALE_CODE is disabled, only the C
-+ locale is supported; it has no collation rules. */
-+# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
-+ const unsigned char *pin
-+ = ((const unsigned char *) re_string_get_buffer (input) + str_idx);
-+ int j;
-+ uint32_t nrules;
-
--# ifdef _LIBC
- nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
- if (nrules != 0)
- {
- unsigned int in_collseq = 0;
- const int32_t *table, *indirect;
-- const unsigned char *weights, *extra;
-+ const unsigned char *weights, *extra = NULL;
- const char *collseqwc;
-
- /* match with collating_symbol? */
-@@ -3955,8 +3943,12 @@ check_node_accept_bytes (const re_dfa_t
- }
- }
- else
--# endif /* _LIBC */
-+# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
- {
-+ /* In the _LIBC version, if OPTION_EGLIBC_LOCALE_CODE is
-+ disabled, there can be no multibyte range endpoints, and
-+ cset->nranges is always zero. */
-+#if __OPTION_EGLIBC_LOCALE_CODE
- /* match with range expression? */
- #if __GNUC__ >= 2
- wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'};
-@@ -3975,6 +3967,7 @@ check_node_accept_bytes (const re_dfa_t
- goto check_node_accept_bytes_match;
- }
- }
-+#endif /* __OPTION_EGLIBC_LOCALE_CODE */
- }
- check_node_accept_bytes_match:
- if (!cset->non_match)
-@@ -3990,7 +3983,7 @@ check_node_accept_bytes (const re_dfa_t
- return 0;
- }
-
--# ifdef _LIBC
-+# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
- static unsigned int
- internal_function
- find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
-@@ -4048,7 +4041,7 @@ find_collation_sequence_value (const uns
- return UINT_MAX;
- }
- }
--# endif /* _LIBC */
-+# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
- #endif /* RE_ENABLE_I18N */
-
- /* Check whether the node accepts the byte which is IDX-th
-@@ -4139,7 +4132,7 @@ extend_buffers (re_match_context_t *mctx
- if (pstr->icase)
- {
- #ifdef RE_ENABLE_I18N
-- if (pstr->mb_cur_max > 1)
-+ if (string_mb_cur_max (pstr) > 1)
- {
- ret = build_wcs_upper_buffer (pstr);
- if (BE (ret != REG_NOERROR, 0))
-@@ -4152,7 +4145,7 @@ extend_buffers (re_match_context_t *mctx
- else
- {
- #ifdef RE_ENABLE_I18N
-- if (pstr->mb_cur_max > 1)
-+ if (string_mb_cur_max (pstr) > 1)
- build_wcs_buffer (pstr);
- else
- #endif /* RE_ENABLE_I18N */
-Index: git/posix/regexec-compat.c
-===================================================================
---- /dev/null
-+++ git/posix/regexec-compat.c
-@@ -0,0 +1,39 @@
-+/* Extended regular expression matching and search library.
-+ Copyright (C) 2008 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#ifdef _LIBC
-+# include <shlib-compat.h>
-+versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
-+
-+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
-+__typeof__ (__regexec) __compat_regexec;
-+
-+int
-+attribute_compat_text_section
-+__compat_regexec (const regex_t *__restrict preg,
-+ const char *__restrict string, size_t nmatch,
-+ regmatch_t pmatch[], int eflags)
-+{
-+ return regexec (preg, string, nmatch, pmatch,
-+ eflags & (REG_NOTBOL | REG_NOTEOL));
-+}
-+compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
-+# endif
-+#endif
-Index: git/posix/regex.h
-===================================================================
---- git.orig/posix/regex.h
-+++ git/posix/regex.h
-@@ -21,6 +21,7 @@
- #define _REGEX_H 1
-
- #include <sys/types.h>
-+#include <gnu/option-groups.h>
-
- /* Allow the use in C++ code. */
- #ifdef __cplusplus
-@@ -156,6 +157,8 @@ typedef unsigned long int reg_syntax_t;
- treated as 'a\{1'. */
- # define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
-
-+/* EGLIBC: Old regex implementation does not support these. */
-+# if __OPTION_POSIX_REGEXP_GLIBC
- /* If this bit is set, then ignore case when matching.
- If not set, then case is significant. */
- # define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
-@@ -172,6 +175,7 @@ typedef unsigned long int reg_syntax_t;
- /* If this bit is set, then no_sub will be set to 1 during
- re_compile_pattern. */
- # define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
-+# endif /* __OPTION_POSIX_REGEXP_GLIBC */
- #endif
-
- /* This global variable defines the particular regexp syntax to use (for
-@@ -231,8 +235,13 @@ extern reg_syntax_t re_syntax_options;
- (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
- | RE_INTERVALS | RE_NO_EMPTY_RANGES)
-
-+#if __OPTION_POSIX_REGEXP_GLIBC
- #define RE_SYNTAX_POSIX_BASIC \
- (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
-+#else
-+#define RE_SYNTAX_POSIX_BASIC \
-+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
-+#endif
-
- /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
- RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
-@@ -298,9 +307,11 @@ extern reg_syntax_t re_syntax_options;
- /* Like REG_NOTBOL, except for the end-of-line. */
- #define REG_NOTEOL (1 << 1)
-
-+#if __OPTION_POSIX_REGEXP_GLIBC
- /* Use PMATCH[0] to delimit the start and end of the search in the
- buffer. */
- #define REG_STARTEND (1 << 2)
-+#endif
-
-
- /* If any error codes are removed, changed, or added, update the
-Index: git/posix/regex_internal.c
-===================================================================
---- git.orig/posix/regex_internal.c
-+++ git/posix/regex_internal.c
-@@ -43,8 +43,8 @@ re_string_allocate (re_string_t *pstr, c
- int init_buf_len;
-
- /* Ensure at least one character fits into the buffers. */
-- if (init_len < dfa->mb_cur_max)
-- init_len = dfa->mb_cur_max;
-+ if (init_len < dfa_mb_cur_max (dfa))
-+ init_len = dfa_mb_cur_max (dfa);
- init_buf_len = (len + 1 < init_len) ? len + 1: init_len;
- re_string_construct_common (str, len, pstr, trans, icase, dfa);
-
-@@ -55,7 +55,7 @@ re_string_allocate (re_string_t *pstr, c
- pstr->word_char = dfa->word_char;
- pstr->word_ops_used = dfa->word_ops_used;
- pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
-- pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len;
-+ pstr->valid_len = (pstr->mbs_allocated || dfa_mb_cur_max (dfa) > 1) ? 0 : len;
- pstr->valid_raw_len = pstr->valid_len;
- return REG_NOERROR;
- }
-@@ -82,7 +82,7 @@ re_string_construct (re_string_t *pstr,
- if (icase)
- {
++#if __OPTION_POSIX_REGEXP_GLIBC
+ /* Use PMATCH[0] to delimit the start and end of the search in the
+ buffer. */
+ #define REG_STARTEND (1 << 2)
++#endif
+
+
+ /* If any error codes are removed, changed, or added, update the
+diff --git a/posix/regex_internal.c b/posix/regex_internal.c
+index 8597d7e..d53b2a8 100644
+--- a/posix/regex_internal.c
++++ b/posix/regex_internal.c
+@@ -43,8 +43,8 @@ re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len,
+ int init_buf_len;
+
+ /* Ensure at least one character fits into the buffers. */
+- if (init_len < dfa->mb_cur_max)
+- init_len = dfa->mb_cur_max;
++ if (init_len < dfa_mb_cur_max (dfa))
++ init_len = dfa_mb_cur_max (dfa);
+ init_buf_len = (len + 1 < init_len) ? len + 1: init_len;
+ re_string_construct_common (str, len, pstr, trans, icase, dfa);
+
+@@ -55,7 +55,7 @@ re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len,
+ pstr->word_char = dfa->word_char;
+ pstr->word_ops_used = dfa->word_ops_used;
+ pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
+- pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len;
++ pstr->valid_len = (pstr->mbs_allocated || dfa_mb_cur_max (dfa) > 1) ? 0 : len;
+ pstr->valid_raw_len = pstr->valid_len;
+ return REG_NOERROR;
+ }
+@@ -82,7 +82,7 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
+ if (icase)
+ {
#ifdef RE_ENABLE_I18N
- if (dfa->mb_cur_max > 1)
+ if (dfa_mb_cur_max (dfa) > 1)
{
while (1)
{
-@@ -91,7 +91,7 @@ re_string_construct (re_string_t *pstr,
+@@ -91,7 +91,7 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
return ret;
if (pstr->valid_raw_len >= len)
break;
break;
ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2);
if (BE (ret != REG_NOERROR, 0))
-@@ -105,7 +105,7 @@ re_string_construct (re_string_t *pstr,
+@@ -105,7 +105,7 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
else
{
#ifdef RE_ENABLE_I18N
build_wcs_buffer (pstr);
else
#endif /* RE_ENABLE_I18N */
-@@ -130,7 +130,7 @@ internal_function __attribute_warn_unuse
+@@ -130,7 +130,7 @@ internal_function __attribute_warn_unused_result__
re_string_realloc_buffers (re_string_t *pstr, int new_buf_len)
{
#ifdef RE_ENABLE_I18N
{
wint_t *new_wcs;
-@@ -177,7 +177,7 @@ re_string_construct_common (const char *
+@@ -177,7 +177,7 @@ re_string_construct_common (const char *str, int len, re_string_t *pstr,
pstr->trans = trans;
pstr->icase = icase ? 1 : 0;
pstr->mbs_allocated = (trans != NULL || icase);
{
ch = pstr->raw_mbs [pstr->raw_mbs_idx + byte_idx + i];
buf[i] = pstr->mbs[byte_idx + i] = pstr->trans[ch];
-@@ -275,7 +275,7 @@ build_wcs_upper_buffer (re_string_t *pst
+@@ -275,7 +275,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
size_t mbclen;
#ifdef _LIBC
char buf[MB_LEN_MAX];
#else
char buf[64];
#endif
-@@ -369,7 +369,7 @@ build_wcs_upper_buffer (re_string_t *pst
+@@ -369,7 +369,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
{
int i, ch;
{
ch = pstr->raw_mbs [pstr->raw_mbs_idx + src_idx + i];
buf[i] = pstr->trans[ch];
-@@ -567,8 +567,9 @@ re_string_translate_buffer (re_string_t
+@@ -567,8 +567,9 @@ re_string_translate_buffer (re_string_t *pstr)
}
/* This function re-construct the buffers.
static reg_errcode_t
internal_function __attribute_warn_unused_result__
-@@ -579,7 +580,7 @@ re_string_reconstruct (re_string_t *pstr
+@@ -579,7 +580,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
{
/* Reset buffer. */
#ifdef RE_ENABLE_I18N
memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
#endif /* RE_ENABLE_I18N */
pstr->len = pstr->raw_len;
-@@ -670,7 +671,7 @@ re_string_reconstruct (re_string_t *pstr
+@@ -670,7 +671,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
pstr->tip_context = re_string_context_at (pstr, offset - 1,
eflags);
#ifdef RE_ENABLE_I18N
memmove (pstr->wcs, pstr->wcs + offset,
(pstr->valid_len - offset) * sizeof (wint_t));
#endif /* RE_ENABLE_I18N */
-@@ -699,7 +700,7 @@ re_string_reconstruct (re_string_t *pstr
+@@ -699,7 +700,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
#endif
pstr->valid_len = 0;
#ifdef RE_ENABLE_I18N
{
int wcs_idx;
wint_t wc = WEOF;
-@@ -711,7 +712,7 @@ re_string_reconstruct (re_string_t *pstr
+@@ -711,7 +712,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
/* Special case UTF-8. Multi-byte chars start with any
byte other than 0x80 - 0xbf. */
raw = pstr->raw_mbs + pstr->raw_mbs_idx;
if (end < pstr->raw_mbs)
end = pstr->raw_mbs;
p = raw + offset - 1;
-@@ -803,7 +804,7 @@ re_string_reconstruct (re_string_t *pstr
+@@ -803,7 +804,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
/* Then build the buffers. */
#ifdef RE_ENABLE_I18N
{
if (pstr->icase)
{
-@@ -841,7 +842,7 @@ re_string_peek_byte_case (const re_strin
+@@ -841,7 +842,7 @@ re_string_peek_byte_case (const re_string_t *pstr, int idx)
return re_string_peek_byte (pstr, idx);
#ifdef RE_ENABLE_I18N
&& ! re_string_is_single_byte_char (pstr, pstr->cur_idx + idx))
return re_string_peek_byte (pstr, idx);
#endif
-@@ -930,7 +931,7 @@ re_string_context_at (const re_string_t
+@@ -930,7 +931,7 @@ re_string_context_at (const re_string_t *input, int idx, int eflags)
return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
: CONTEXT_NEWLINE | CONTEXT_ENDBUF);
#ifdef RE_ENABLE_I18N
{
wint_t wc;
int wc_idx = idx;
-@@ -1444,7 +1445,7 @@ re_dfa_add_node (re_dfa_t *dfa, re_token
+@@ -1444,7 +1445,7 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
dfa->nodes[dfa->nodes_len].constraint = 0;
#ifdef RE_ENABLE_I18N
dfa->nodes[dfa->nodes_len].accept_mb =
#endif
dfa->nexts[dfa->nodes_len] = -1;
re_node_set_init_empty (dfa->edests + dfa->nodes_len);
-Index: git/posix/regex_internal.h
-===================================================================
---- git.orig/posix/regex_internal.h
-+++ git/posix/regex_internal.h
+diff --git a/posix/regex_internal.h b/posix/regex_internal.h
+index 154e969..c43909a 100644
+--- a/posix/regex_internal.h
++++ b/posix/regex_internal.h
@@ -26,6 +26,10 @@
#include <stdlib.h>
#include <string.h>
#define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
#define re_node_set_remove(set,id) \
(re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
-@@ -714,7 +733,7 @@ internal_function __attribute__ ((pure,
+@@ -714,7 +733,7 @@ internal_function __attribute__ ((pure, unused))
re_string_char_size_at (const re_string_t *pstr, int idx)
{
int byte_idx;
return (wint_t) pstr->mbs[idx];
return (wint_t) pstr->wcs[idx];
}
-Index: git/posix/xregex.c
-===================================================================
+diff --git a/posix/regexec-compat.c b/posix/regexec-compat.c
+new file mode 100644
+index 0000000..0f9b7c7
--- /dev/null
-+++ git/posix/xregex.c
-@@ -0,0 +1,8215 @@
-+/* Extended regular expression matching and search library,
-+ version 0.12.
-+ (Implements POSIX draft P1003.2/D11.2, except for some of the
-+ internationalization features.)
-+
-+ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-+ 2002, 2005 Free Software Foundation, Inc.
++++ b/posix/regexec-compat.c
+@@ -0,0 +1,39 @@
++/* Extended regular expression matching and search library.
++ Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
++ Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+ 02110-1301 USA. */
-+
-+/* AIX requires this to be the first thing in the file. */
-+#if defined _AIX && !defined __GNUC__ && !defined REGEX_MALLOC
-+ #pragma alloca
-+#endif
-+
-+#undef _GNU_SOURCE
-+#define _GNU_SOURCE
-+
-+#ifndef INSIDE_RECURSION
-+# ifdef HAVE_CONFIG_H
-+# include <config.h>
-+# endif
-+#endif
-+
-+/*#include <ansidecl.h>*/
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
+
++#ifdef _LIBC
++# include <shlib-compat.h>
++versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
+
-+#ifndef INSIDE_RECURSION
++# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
++__typeof__ (__regexec) __compat_regexec;
++
++int
++attribute_compat_text_section
++__compat_regexec (const regex_t *__restrict preg,
++ const char *__restrict string, size_t nmatch,
++ regmatch_t pmatch[], int eflags)
++{
++ return regexec (preg, string, nmatch, pmatch,
++ eflags & (REG_NOTBOL | REG_NOTEOL));
++}
++compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
++# endif
++#endif
+diff --git a/posix/regexec.c b/posix/regexec.c
+index 70cd606..e3b49e4 100644
+--- a/posix/regexec.c
++++ b/posix/regexec.c
+@@ -18,6 +18,7 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #include <stdint.h>
++#include <gnu/option-groups.h>
+
+ static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
+ int n) internal_function;
+@@ -186,11 +187,11 @@ static int build_trtable (const re_dfa_t *dfa,
+ static int check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ const re_string_t *input, int idx)
+ internal_function;
+-# ifdef _LIBC
++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
+ static unsigned int find_collation_sequence_value (const unsigned char *mbs,
+ size_t name_len)
+ internal_function;
+-# endif /* _LIBC */
++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
+ #endif /* RE_ENABLE_I18N */
+ static int group_nodes_into_DFAstates (const re_dfa_t *dfa,
+ const re_dfastate_t *state,
+@@ -255,25 +256,9 @@ regexec (preg, string, nmatch, pmatch, eflags)
+ return err != REG_NOERROR;
+ }
+
+-#ifdef _LIBC
+-# include <shlib-compat.h>
+-versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
+-
+-# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
+-__typeof__ (__regexec) __compat_regexec;
+-
+-int
+-attribute_compat_text_section
+-__compat_regexec (const regex_t *__restrict preg,
+- const char *__restrict string, size_t nmatch,
+- regmatch_t pmatch[], int eflags)
+-{
+- return regexec (preg, string, nmatch, pmatch,
+- eflags & (REG_NOTBOL | REG_NOTEOL));
+-}
+-compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
+-# endif
+-#endif
++/* EGLIBC: The code that used to be here was move to a separate file
++ so that it can be shared with xregex.c. */
++#include "regexec-compat.c"
+
+ /* Entry points for GNU code. */
+
+@@ -728,7 +713,7 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
+ incr = (range < 0) ? -1 : 1;
+ left_lim = (range < 0) ? start + range : start;
+ right_lim = (range < 0) ? start : start + range;
+- sb = dfa->mb_cur_max == 1;
++ sb = dfa_mb_cur_max (dfa) == 1;
+ match_kind =
+ (fastmap
+ ? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0)
+@@ -3448,7 +3433,7 @@ out_free:
+ if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0))
+ goto out_free;
+
+- if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1)
++ if (dest_states[i] != dest_states_word[i] && dfa_mb_cur_max (dfa) > 1)
+ need_word_trtable = 1;
+
+ dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows,
+@@ -3590,7 +3575,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
+ else if (type == OP_PERIOD)
+ {
+ #ifdef RE_ENABLE_I18N
+- if (dfa->mb_cur_max > 1)
++ if (dfa_mb_cur_max (dfa) > 1)
+ bitset_merge (accepts, dfa->sb_char);
+ else
+ #endif
+@@ -3641,7 +3626,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
+ continue;
+ }
+ #ifdef RE_ENABLE_I18N
+- if (dfa->mb_cur_max > 1)
++ if (dfa_mb_cur_max (dfa) > 1)
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= (dfa->word_char[j] | ~dfa->sb_char[j]));
+ else
+@@ -3660,7 +3645,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
+ continue;
+ }
+ #ifdef RE_ENABLE_I18N
+- if (dfa->mb_cur_max > 1)
++ if (dfa_mb_cur_max (dfa) > 1)
+ for (j = 0; j < BITSET_WORDS; ++j)
+ any_set |= (accepts[j] &= ~(dfa->word_char[j] & dfa->sb_char[j]));
+ else
+@@ -3836,12 +3821,6 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ if (node->type == COMPLEX_BRACKET)
+ {
+ const re_charset_t *cset = node->opr.mbcset;
+-# ifdef _LIBC
+- const unsigned char *pin
+- = ((const unsigned char *) re_string_get_buffer (input) + str_idx);
+- int j;
+- uint32_t nrules;
+-# endif /* _LIBC */
+ int match_len = 0;
+ wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars)
+ ? re_string_wchar_at (input, str_idx) : 0);
+@@ -3853,6 +3832,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ match_len = char_len;
+ goto check_node_accept_bytes_match;
+ }
++#if __OPTION_EGLIBC_LOCALE_CODE
+ /* match with character_class? */
+ for (i = 0; i < cset->nchar_classes; ++i)
+ {
+@@ -3863,14 +3843,22 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ goto check_node_accept_bytes_match;
+ }
+ }
++#endif
++
++ /* When __OPTION_EGLIBC_LOCALE_CODE is disabled, only the C
++ locale is supported; it has no collation rules. */
++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
++ const unsigned char *pin
++ = ((const unsigned char *) re_string_get_buffer (input) + str_idx);
++ int j;
++ uint32_t nrules;
+
+-# ifdef _LIBC
+ nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+ if (nrules != 0)
+ {
+ unsigned int in_collseq = 0;
+ const int32_t *table, *indirect;
+- const unsigned char *weights, *extra;
++ const unsigned char *weights, *extra = NULL;
+ const char *collseqwc;
+
+ /* match with collating_symbol? */
+@@ -3955,8 +3943,12 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ }
+ }
+ else
+-# endif /* _LIBC */
++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
+ {
++ /* In the _LIBC version, if OPTION_EGLIBC_LOCALE_CODE is
++ disabled, there can be no multibyte range endpoints, and
++ cset->nranges is always zero. */
++#if __OPTION_EGLIBC_LOCALE_CODE
+ /* match with range expression? */
+ #if __GNUC__ >= 2
+ wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'};
+@@ -3975,6 +3967,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ goto check_node_accept_bytes_match;
+ }
+ }
++#endif /* __OPTION_EGLIBC_LOCALE_CODE */
+ }
+ check_node_accept_bytes_match:
+ if (!cset->non_match)
+@@ -3990,7 +3983,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ return 0;
+ }
+
+-# ifdef _LIBC
++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
+ static unsigned int
+ internal_function
+ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
+@@ -4048,7 +4041,7 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
+ return UINT_MAX;
+ }
+ }
+-# endif /* _LIBC */
++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
+ #endif /* RE_ENABLE_I18N */
+
+ /* Check whether the node accepts the byte which is IDX-th
+@@ -4139,7 +4132,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
+ if (pstr->icase)
+ {
+ #ifdef RE_ENABLE_I18N
+- if (pstr->mb_cur_max > 1)
++ if (string_mb_cur_max (pstr) > 1)
+ {
+ ret = build_wcs_upper_buffer (pstr);
+ if (BE (ret != REG_NOERROR, 0))
+@@ -4152,7 +4145,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
+ else
+ {
+ #ifdef RE_ENABLE_I18N
+- if (pstr->mb_cur_max > 1)
++ if (string_mb_cur_max (pstr) > 1)
+ build_wcs_buffer (pstr);
+ else
+ #endif /* RE_ENABLE_I18N */
+diff --git a/posix/xregex.c b/posix/xregex.c
+new file mode 100644
+index 0000000..d3f7ace
+--- /dev/null
++++ b/posix/xregex.c
+@@ -0,0 +1,8215 @@
++/* Extended regular expression matching and search library,
++ version 0.12.
++ (Implements POSIX draft P1003.2/D11.2, except for some of the
++ internationalization features.)
++
++ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
++ 2002, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++ 02110-1301 USA. */
++
++/* AIX requires this to be the first thing in the file. */
++#if defined _AIX && !defined __GNUC__ && !defined REGEX_MALLOC
++ #pragma alloca
++#endif
++
++#undef _GNU_SOURCE
++#define _GNU_SOURCE
++
++#ifndef INSIDE_RECURSION
++# ifdef HAVE_CONFIG_H
++# include <config.h>
++# endif
++#endif
++
++/*#include <ansidecl.h>*/
++
++
++#ifndef INSIDE_RECURSION
+
+# if defined STDC_HEADERS && !defined emacs
+# include <stddef.h>
+# undef WCHAR
+
+# define DEFINED_ONCE
-Index: git/pwd/Makefile
-===================================================================
---- git.orig/pwd/Makefile
-+++ git/pwd/Makefile
+diff --git a/pwd/Makefile b/pwd/Makefile
+index 7f6de03..916d546 100644
+--- a/pwd/Makefile
++++ b/pwd/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for pwd portion of the library.
subdir := pwd
include ../Makeconfig
-Index: git/resolv/Makefile
-===================================================================
---- git.orig/resolv/Makefile
-+++ git/resolv/Makefile
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 1dcb75f..2e4b630 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for resolv portion of the library.
subdir := resolv
include ../Makeconfig
-@@ -27,20 +29,21 @@ headers := resolv.h \
+@@ -27,21 +29,22 @@ headers := resolv.h \
arpa/nameser.h arpa/nameser_compat.h \
sys/bitypes.h
-routines += gai_sigqueue
+extra-libs-$(OPTION_EGLIBC_INET_ANL) += libanl
+routines-$(OPTION_EGLIBC_INET) += gai_sigqueue
+ tests += tst-res_hconf_reorder
endif
-extra-libs-others = $(extra-libs)
+extra-libs-others-y += $(extra-libs-y)
libresolv-routines := gethnamaddr res_comp res_debug \
res_data res_mkquery res_query res_send \
inet_net_ntop inet_net_pton inet_neta base64 \
-@@ -60,7 +63,7 @@ routines += $(libnss_dns-
+@@ -61,7 +64,7 @@ routines += $(libnss_dns-routines) $(libresolv-routines)
static-only-routines += $(libnss_dns-routines) $(libresolv-routines)
endif
tests: $(objpfx)ga_test
endif
-Index: git/stdio-common/fxprintf.c
-===================================================================
---- git.orig/stdio-common/fxprintf.c
-+++ git/stdio-common/fxprintf.c
-@@ -23,6 +23,7 @@
- #include <wchar.h>
- #include <string.h>
- #include <libioP.h>
-+#include <gnu/option-groups.h>
-
-
- int
-@@ -37,6 +38,7 @@ __fxprintf (FILE *fp, const char *fmt, .
- int res;
- if (_IO_fwide (fp, 0) > 0)
- {
-+#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
- size_t len = strlen (fmt) + 1;
- wchar_t wfmt[len];
- for (size_t i = 0; i < len; ++i)
-@@ -45,6 +47,9 @@ __fxprintf (FILE *fp, const char *fmt, .
- wfmt[i] = fmt[i];
- }
- res = __vfwprintf (fp, wfmt, ap);
-+#else
-+ abort();
-+#endif
- }
- else
- res = _IO_vfprintf (fp, fmt, ap);
-Index: git/stdio-common/_i18n_number.h
-===================================================================
---- git.orig/stdio-common/_i18n_number.h
-+++ git/stdio-common/_i18n_number.h
-@@ -19,10 +19,13 @@
- #include <stdbool.h>
- #include <wchar.h>
- #include <wctype.h>
-+#include <gnu/option-groups.h>
-
- #include "../locale/outdigits.h"
- #include "../locale/outdigitswc.h"
-
-+#if __OPTION_EGLIBC_LOCALE_CODE
-+
- static CHAR_T *
- _i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
- {
-@@ -115,3 +118,13 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T
-
- return w;
- }
-+
-+#else
-+
-+static CHAR_T *
-+_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
-+{
-+ return w;
-+}
-+
-+#endif
-Index: git/stdio-common/Makefile
-===================================================================
---- git.orig/stdio-common/Makefile
-+++ git/stdio-common/Makefile
-@@ -18,6 +18,8 @@
- #
- # Specific makefile for stdio-common.
- #
-+include ../option-groups.mak
-+
- subdir := stdio-common
+diff --git a/stdio-common/Makefile b/stdio-common/Makefile
+index d0bf0e1..8655801 100644
+--- a/stdio-common/Makefile
++++ b/stdio-common/Makefile
+@@ -18,6 +18,8 @@
+ #
+ # Specific makefile for stdio-common.
+ #
++include ../option-groups.mak
++
+ subdir := stdio-common
include ../Makeconfig
@@ -30,7 +32,7 @@ routines := \
+ bug19 tst-popen2 scanf14 scanf15 bug21 bug22 \
+ scanf16 scanf17 tst-setvbuf1 bug23 bug24 \
+ bug-vfprintf-nargs tst-sprintf3 \
- bug25 tst-printf-round bug23-2 bug23-3 bug23-4 bug26
+ bug25 tst-printf-round bug23-2 bug23-3 bug23-4 bug26 tst-fmemopen3
+tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+ += tst-sscanf tst-swprintf test-vfprintf bug14 scanf13 tst-grouping
+tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
test-srcs = tst-unbputc tst-printf
-Index: git/stdio-common/printf_fp.c
-===================================================================
---- git.orig/stdio-common/printf_fp.c
-+++ git/stdio-common/printf_fp.c
+diff --git a/stdio-common/_i18n_number.h b/stdio-common/_i18n_number.h
+index 3c73044..ac62b3a 100644
+--- a/stdio-common/_i18n_number.h
++++ b/stdio-common/_i18n_number.h
+@@ -19,10 +19,13 @@
+ #include <stdbool.h>
+ #include <wchar.h>
+ #include <wctype.h>
++#include <gnu/option-groups.h>
+
+ #include "../locale/outdigits.h"
+ #include "../locale/outdigitswc.h"
+
++#if __OPTION_EGLIBC_LOCALE_CODE
++
+ static CHAR_T *
+ _i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
+ {
+@@ -115,3 +118,13 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
+
+ return w;
+ }
++
++#else
++
++static CHAR_T *
++_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
++{
++ return w;
++}
++
++#endif
+diff --git a/stdio-common/fxprintf.c b/stdio-common/fxprintf.c
+index 7b2eb94..8476076 100644
+--- a/stdio-common/fxprintf.c
++++ b/stdio-common/fxprintf.c
+@@ -23,6 +23,7 @@
+ #include <wchar.h>
+ #include <string.h>
+ #include <libioP.h>
++#include <gnu/option-groups.h>
+
+
+ int
+@@ -37,6 +38,7 @@ __fxprintf (FILE *fp, const char *fmt, ...)
+ int res;
+ if (_IO_fwide (fp, 0) > 0)
+ {
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ size_t len = strlen (fmt) + 1;
+ wchar_t wfmt[len];
+ for (size_t i = 0; i < len; ++i)
+@@ -45,6 +47,9 @@ __fxprintf (FILE *fp, const char *fmt, ...)
+ wfmt[i] = fmt[i];
+ }
+ res = __vfwprintf (fp, wfmt, ap);
++#else
++ abort();
++#endif
+ }
+ else
+ res = _IO_vfprintf (fp, fmt, ap);
+diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
+index 3023b20..bd0df66 100644
+--- a/stdio-common/printf_fp.c
++++ b/stdio-common/printf_fp.c
@@ -39,6 +39,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>
#include <rounding-mode.h>
-@@ -142,6 +143,10 @@ extern mp_size_t __mpn_extract_long_doub
+@@ -142,6 +143,10 @@ extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
extern unsigned int __guess_grouping (unsigned int intdig_max,
const char *grouping);
/* Fetch the argument value. */
#ifndef __NO_LONG_DOUBLE_MATH
-Index: git/stdio-common/printf_fphex.c
-===================================================================
---- git.orig/stdio-common/printf_fphex.c
-+++ git/stdio-common/printf_fphex.c
+diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
+index 6c3b5e9..f660ce0 100644
+--- a/stdio-common/printf_fphex.c
++++ b/stdio-common/printf_fphex.c
@@ -28,6 +28,7 @@
#include <_itoa.h>
#include <_itowa.h>
/* Fetch the argument value. */
-Index: git/stdio-common/printf_size.c
-===================================================================
---- git.orig/stdio-common/printf_size.c
-+++ git/stdio-common/printf_size.c
+diff --git a/stdio-common/printf_size.c b/stdio-common/printf_size.c
+index 7dcd58e..6fb7491 100644
+--- a/stdio-common/printf_size.c
++++ b/stdio-common/printf_size.c
@@ -23,6 +23,7 @@
#include <math.h>
#include <printf.h>
/* This defines make it possible to use the same code for GNU C library and
-@@ -116,7 +117,14 @@ __printf_size (FILE *fp, const struct pr
+@@ -116,7 +117,14 @@ __printf_size (FILE *fp, const struct printf_info *info,
struct printf_info fp_info;
int done = 0;
int res;
/* Fetch the argument value. */
-Index: git/stdio-common/scanf14.c
-===================================================================
---- git.orig/stdio-common/scanf14.c
-+++ git/stdio-common/scanf14.c
+diff --git a/stdio-common/scanf14.c b/stdio-common/scanf14.c
+index cffccb0..6cc260a 100644
+--- a/stdio-common/scanf14.c
++++ b/stdio-common/scanf14.c
@@ -3,6 +3,7 @@
#include <string.h>
#include <wchar.h>
if (sscanf ("4.25[0-9.] x", "%a[0-9.]%8c", &sp, c) != 2)
FAIL ();
else
-Index: git/stdio-common/tstdiomisc.c
-===================================================================
---- git.orig/stdio-common/tstdiomisc.c
-+++ git/stdio-common/tstdiomisc.c
-@@ -4,6 +4,7 @@
- #include <string.h>
- #include <wchar.h>
- #include <libc-internal.h>
-+#include <gnu/option-groups.h>
-
- static int
- t1 (void)
-@@ -134,6 +135,7 @@ F (void)
- printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
- buf);
-
-+#if __OPTION_POSIX_C_LANG_WIDE_CHAR
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
- qnanval, qnanval, qnanval, qnanval,
- qnanval, qnanval, qnanval, qnanval);
-@@ -171,6 +173,7 @@ F (void)
- result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
- printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
- wbuf);
-+#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
-
- lqnanval = NAN;
-
-@@ -215,6 +218,7 @@ F (void)
- printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
- buf);
-
-+#if __OPTION_POSIX_C_LANG_WIDE_CHAR
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
- L"%La %LA %Le %LE %Lf %LF %Lg %LG",
- lqnanval, lqnanval, lqnanval, lqnanval,
-@@ -259,6 +263,7 @@ F (void)
- result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
- printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
- wbuf);
-+#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
-
- return result;
- }
-Index: git/stdio-common/tst-popen.c
-===================================================================
---- git.orig/stdio-common/tst-popen.c
-+++ git/stdio-common/tst-popen.c
+diff --git a/stdio-common/tst-popen.c b/stdio-common/tst-popen.c
+index 5def27f..7c9b91e 100644
+--- a/stdio-common/tst-popen.c
++++ b/stdio-common/tst-popen.c
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <string.h>
if (getline (&line, &len, f) != 5)
{
-Index: git/stdio-common/tst-sprintf.c
-===================================================================
---- git.orig/stdio-common/tst-sprintf.c
-+++ git/stdio-common/tst-sprintf.c
+diff --git a/stdio-common/tst-sprintf.c b/stdio-common/tst-sprintf.c
+index d5284b9..f1e3d21 100644
+--- a/stdio-common/tst-sprintf.c
++++ b/stdio-common/tst-sprintf.c
@@ -3,7 +3,7 @@
#include <locale.h>
#include <string.h>
#define SIZE (1024*70000)
#define STR(x) #x
-Index: git/stdio-common/vfprintf.c
-===================================================================
---- git.orig/stdio-common/vfprintf.c
-+++ git/stdio-common/vfprintf.c
+diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
+index 5548a71..31ed024 100644
+--- a/stdio-common/tstdiomisc.c
++++ b/stdio-common/tstdiomisc.c
+@@ -4,6 +4,7 @@
+ #include <string.h>
+ #include <wchar.h>
+ #include <libc-internal.h>
++#include <gnu/option-groups.h>
+
+ static int
+ t1 (void)
+@@ -134,6 +135,7 @@ F (void)
+ printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
+ buf);
+
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+ swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+ qnanval, qnanval, qnanval, qnanval,
+ qnanval, qnanval, qnanval, qnanval);
+@@ -171,6 +173,7 @@ F (void)
+ result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
+ printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
+ wbuf);
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+
+ lqnanval = NAN;
+
+@@ -215,6 +218,7 @@ F (void)
+ printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
+ buf);
+
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+ swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+ L"%La %LA %Le %LE %Lf %LF %Lg %LG",
+ lqnanval, lqnanval, lqnanval, lqnanval,
+@@ -259,6 +263,7 @@ F (void)
+ result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
+ printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
+ wbuf);
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+
+ return result;
+ }
+diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
+index 0592e70..f21d973 100644
+--- a/stdio-common/vfprintf.c
++++ b/stdio-common/vfprintf.c
@@ -29,6 +29,7 @@
#include <_itoa.h>
#include <locale/localeinfo.h>
/* This code is shared between the standard stdio implementation found
in GNU C library and the libio implementation originally found in
-@@ -138,6 +139,18 @@
+@@ -140,6 +141,18 @@ typedef wchar_t THOUSANDS_SEP_T;
# define EOF WEOF
#endif
#include "_i18n_number.h"
/* Include the shared code for parsing the format string. */
-@@ -1129,8 +1142,11 @@ vfprintf (FILE *s, const CHAR_T *format,
+@@ -1065,8 +1078,11 @@ static const uint8_t jump_table[] =
# define process_string_arg(fspec) \
LABEL (form_character): \
/* Character. */ \
--width; /* Account for the character itself. */ \
if (!left) \
PAD (' '); \
-@@ -1143,6 +1159,7 @@ vfprintf (FILE *s, const CHAR_T *format,
+@@ -1079,6 +1095,7 @@ static const uint8_t jump_table[] =
break; \
\
LABEL (form_wcharacter): \
{ \
/* Wide character. */ \
char buf[MB_CUR_MAX]; \
-@@ -1209,6 +1226,7 @@ vfprintf (FILE *s, const CHAR_T *format,
+@@ -1145,6 +1162,7 @@ static const uint8_t jump_table[] =
} \
else \
{ \
const wchar_t *s2 = (const wchar_t *) string; \
mbstate_t mbstate; \
\
-@@ -1409,7 +1427,9 @@ vfprintf (FILE *s, const CHAR_T *format,
+@@ -1399,7 +1417,9 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
LABEL (flag_quote):
group = 1;
{
#ifdef COMPILE_WPRINTF
thousands_sep = _NL_CURRENT_WORD (LC_NUMERIC,
-@@ -1708,7 +1728,9 @@ do_positional:
- free (workstart);
- workstart = NULL;
-
-- if (grouping == (const char *) -1)
-+ if (! LOCALE_SUPPORT)
-+ grouping = NULL;
-+ else if (grouping == (const char *) -1)
- {
+@@ -1728,8 +1748,9 @@ printf_positional (_IO_FILE *s, const CHAR_T *format, int readonly_format,
+ size_t cnt;
+
+ CHAR_T *workstart = NULL;
+-
+- if (grouping == (const char *) -1)
++ if (! LOCALE_SUPPORT)
++ grouping = NULL;
++ else if (grouping == (const char *) -1)
+ {
#ifdef COMPILE_WPRINTF
- thousands_sep = _NL_CURRENT_WORD (LC_NUMERIC,
-Index: git/stdio-common/vfscanf.c
-===================================================================
---- git.orig/stdio-common/vfscanf.c
-+++ git/stdio-common/vfscanf.c
+ thousands_sep = _NL_CURRENT_WORD (LC_NUMERIC,
+diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
+index 0e204e7..66cc0af 100644
+--- a/stdio-common/vfscanf.c
++++ b/stdio-common/vfscanf.c
@@ -29,6 +29,7 @@
#include <wctype.h>
#include <bits/libc-lock.h>
#define encode_error() do { \
errval = 4; \
__set_errno (EILSEQ); \
-@@ -316,24 +323,35 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -316,24 +323,35 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
ARGCHECK (s, format);
{
}
/* Lock the stream. */
-@@ -385,6 +403,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -385,6 +403,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
#ifndef COMPILE_WSCANF
if (!isascii ((unsigned char) *f))
{
/* Non-ASCII, may be a multibyte. */
int len = __mbrlen (f, strlen (f), &state);
if (len > 0)
-@@ -830,6 +850,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -830,6 +850,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
}
/* FALLTHROUGH */
case L_('C'):
if (width == -1)
width = 1;
-@@ -1172,6 +1194,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -1172,6 +1194,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
/* FALLTHROUGH */
case L_('S'):
{
#ifndef COMPILE_WSCANF
mbstate_t cstate;
-@@ -1419,10 +1443,17 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -1419,10 +1443,17 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
const char *mbdigits[10];
const char *mbdigits_extended[10];
#endif
int n;
from_level = 0;
-@@ -2088,6 +2119,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -2088,6 +2119,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
--width;
}
wctrans_t map;
if (__builtin_expect ((flags & I18N) != 0, 0)
/* Hexadecimal floats make no sense, fixing localized
-@@ -2304,6 +2336,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -2304,6 +2336,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
;
#endif
}
/* Have we read any character? If we try to read a number
in hexadecimal notation and we have read only the `0x'
-@@ -2343,7 +2376,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -2343,7 +2376,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
case L_('['): /* Character class. */
if (flags & LONG)
else
STRING_ARG (str, char, 100);
-@@ -2417,6 +2453,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const
+@@ -2417,6 +2453,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
if (flags & LONG)
{
size_t now = read_in;
#ifdef COMPILE_WSCANF
if (__glibc_unlikely (inchar () == WEOF))
input_error ();
-Index: git/stdlib/Makefile
-===================================================================
---- git.orig/stdlib/Makefile
-+++ git/stdlib/Makefile
+diff --git a/stdlib/Makefile b/stdlib/Makefile
+index 402466a..7e7e304 100644
+--- a/stdlib/Makefile
++++ b/stdlib/Makefile
@@ -18,6 +18,8 @@
#
# Makefile for stdlib routines
subdir := stdlib
include ../Makeconfig
-@@ -30,7 +32,7 @@ headers := stdlib.h bits/stdlib.h bits/s
+@@ -30,7 +32,7 @@ headers := stdlib.h bits/stdlib.h bits/stdlib-ldbl.h bits/stdlib-float.h \
alloca.h fmtmsg.h \
bits/stdlib-bsearch.h
aux = grouping groupingwc tens_in_limb
# These routines will be omitted from the libc shared object.
-@@ -62,20 +72,22 @@ aux = grouping groupingwc tens_in_limb
+@@ -62,20 +72,24 @@ aux = grouping groupingwc tens_in_limb
# linked against when the shared library will be used.
static-only-routines = atexit at_quick_exit
-test-srcs := tst-fmtmsg
-tests := tst-strtol tst-strtod testmb testrand testsort testdiv \
-+test-srcs-$(OPTION_EGLIBC_FMTMSG) := tst-fmtmsg
-+tests := tst-strtol tst-strtod testrand testsort testdiv \
++test-srcs-$(OPTION_EGLIBC_FMTMSG) := tst-fmtmsg
++tests := tst-strtol tst-strtod testrand testsort testdiv \
test-canon test-canon2 tst-strtoll tst-environ \
tst-xpg-basename tst-random tst-random2 tst-bsearch \
- tst-limits tst-rand48 bug-strtod tst-setcontext \
-- test-a64l tst-qsort tst-system testmb2 bug-strtod2 \
-- tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
-- tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2 \
-- tst-makecontext2 tst-strtod6 tst-unsetenv1 \
-- tst-makecontext3 bug-getcontext bug-fmtmsg1 \
-+ test-a64l tst-qsort tst-system bug-strtod2 \
-+ tst-atof1 tst-atof2 tst-strtod2 tst-rand48-2 \
-+ tst-makecontext tst-qsort2 tst-makecontext2 tst-strtod6 \
-+ tst-unsetenv1 tst-makecontext3 bug-getcontext bug-fmtmsg1 \
+ tst-limits tst-rand48 bug-strtod tst-setcontext \
+- tst-setcontext2 test-a64l tst-qsort tst-system testmb2 \
+- bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 \
+- tst-rand48-2 tst-makecontext tst-strtod4 tst-strtod5 \
++ tst-setcontext2 test-a64l tst-qsort tst-system \
++ bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 \
++ tst-rand48-2 tst-makecontext \
+ tst-qsort2 tst-makecontext2 tst-strtod6 tst-unsetenv1 \
+ tst-makecontext3 bug-getcontext bug-fmtmsg1 \
tst-secure-getenv tst-strtod-overflow tst-strtod-round \
- tst-tininess tst-strtod-underflow tst-tls-atexit
+ tst-tininess tst-strtod-underflow tst-tls-atexit \
+ tst-setcontext3 tst-tls-atexit-nodelete
tests-static := tst-secure-getenv
--
+tests-$(OPTION_EGLIBC_LOCALE_CODE) \
+ += tst-strtod3 tst-strtod4 tst-strtod5 testmb2
+tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
+ += testmb
+
modules-names = tst-tls-atexit-lib
- ifeq ($(build-shared),yes)
-@@ -115,8 +127,10 @@ CFLAGS-tst-makecontext2.c = $(stack-alig
+@@ -116,8 +130,10 @@ CFLAGS-tst-makecontext2.c = $(stack-align-test-flags)
tests-special += $(objpfx)isomac.out
ifeq ($(run-built-tests),yes)
include ../Rules
-Index: git/stdlib/strtod_l.c
-===================================================================
---- git.orig/stdlib/strtod_l.c
-+++ git/stdlib/strtod_l.c
+diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
+index e13ab1e..63efe41 100644
+--- a/stdlib/strtod_l.c
++++ b/stdlib/strtod_l.c
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <xlocale.h>
extern double ____strtod_l_internal (const char *, char **, int, __locale_t);
-@@ -548,6 +549,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+@@ -548,6 +549,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
/* Used in several places. */
int cnt;
struct __locale_data *current = loc->__locales[LC_NUMERIC];
if (__glibc_unlikely (group))
-@@ -586,6 +588,17 @@ ____STRTOF_INTERNAL (nptr, endptr, group
+@@ -586,6 +588,17 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
decimal_len = strlen (decimal);
assert (decimal_len > 0);
#endif
/* Prepare number representation. */
exponent = 0;
-Index: git/stdlib/tst-strtod.c
-===================================================================
---- git.orig/stdlib/tst-strtod.c
-+++ git/stdlib/tst-strtod.c
+diff --git a/stdlib/tst-strtod.c b/stdlib/tst-strtod.c
+index a469208..28fb423 100644
+--- a/stdlib/tst-strtod.c
++++ b/stdlib/tst-strtod.c
@@ -23,6 +23,7 @@
#include <errno.h>
#include <string.h>
return result;
}
+#endif /* __OPTION_EGLIBC_LOCALE_CODE */
-Index: git/streams/Makefile
-===================================================================
---- git.orig/streams/Makefile
-+++ git/streams/Makefile
+diff --git a/streams/Makefile b/streams/Makefile
+index a8a6162..ceb423f 100644
+--- a/streams/Makefile
++++ b/streams/Makefile
@@ -18,11 +18,14 @@
#
# Makefile for streams.
+ += isastream getmsg getpmsg putmsg putpmsg fattach fdetach
include ../Rules
-Index: git/string/Makefile
-===================================================================
---- git.orig/string/Makefile
-+++ git/string/Makefile
+diff --git a/string/Makefile b/string/Makefile
+index 8424a61..5988834 100644
+--- a/string/Makefile
++++ b/string/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for string portion of library.
subdir := string
include ../Makeconfig
-@@ -39,10 +41,12 @@ routines := strcat strchr strcmp strcoll
+@@ -39,10 +41,12 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
$(addprefix argz-,append count create ctsep next \
delete extract insert stringify \
addsep replace) \
strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \
stpcpy stpncpy strcat strchr strcmp strcpy strcspn \
strlen strncmp strncpy strpbrk strrchr strspn memmem \
-@@ -51,10 +55,12 @@ strop-tests := memchr memcmp memcpy memm
+@@ -51,10 +55,12 @@ strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \
tests := tester inl-tester noinl-tester testcopy test-ffs \
tst-strlen stratcliff tst-svc tst-inlcall \
bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \
xtests = tst-strcoll-overflow
-Index: git/string/strcoll_l.c
-===================================================================
---- git.orig/string/strcoll_l.c
-+++ git/string/strcoll_l.c
+diff --git a/string/strcoll_l.c b/string/strcoll_l.c
+index 8f1225f..b36b18c 100644
+--- a/string/strcoll_l.c
++++ b/string/strcoll_l.c
@@ -24,6 +24,7 @@
#include <stdint.h>
#include <string.h>
#ifndef STRING_TYPE
# define STRING_TYPE char
-@@ -247,7 +248,11 @@ int
+@@ -260,7 +261,11 @@ int
STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
{
struct __locale_data *current = l->__locales[LC_COLLATE];
/* We don't assign the following values right away since it might be
unnecessary in case there are no rules. */
const unsigned char *rulesets;
-Index: git/string/strerror_l.c
-===================================================================
---- git.orig/string/strerror_l.c
-+++ git/string/strerror_l.c
+diff --git a/string/strerror_l.c b/string/strerror_l.c
+index 2ed78b5..6584813 100644
+--- a/string/strerror_l.c
++++ b/string/strerror_l.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
}
-Index: git/string/strxfrm_l.c
-===================================================================
---- git.orig/string/strxfrm_l.c
-+++ git/string/strxfrm_l.c
+diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c
+index 8b61ea2..41fdc22 100644
+--- a/string/strxfrm_l.c
++++ b/string/strxfrm_l.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
#ifndef STRING_TYPE
# define STRING_TYPE char
-@@ -670,7 +671,11 @@ STRXFRM (STRING_TYPE *dest, const STRING
+@@ -669,7 +670,11 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l)
{
locale_data_t l_data;
struct __locale_data *current = l->__locales[LC_COLLATE];
/* Handle byte comparison case. */
if (l_data.nrules == 0)
-Index: git/string/test-strcmp.c
-===================================================================
---- git.orig/string/test-strcmp.c
-+++ git/string/test-strcmp.c
+diff --git a/string/test-strcmp.c b/string/test-strcmp.c
+index dc4ba6f..a978656 100644
+--- a/string/test-strcmp.c
++++ b/string/test-strcmp.c
@@ -329,34 +329,6 @@ check (void)
FOR_EACH_IMPL (impl, 0)
check_result (impl, s1 + i1, s2 + i2, exp_result);
}
-Index: git/string/tst-strxfrm2.c
-===================================================================
---- git.orig/string/tst-strxfrm2.c
-+++ git/string/tst-strxfrm2.c
+diff --git a/string/tst-strxfrm.c b/string/tst-strxfrm.c
+index f48cfc0..c3a51f9 100644
+--- a/string/tst-strxfrm.c
++++ b/string/tst-strxfrm.c
+@@ -3,6 +3,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <gnu/option-groups.h>
+
+
+ char const string[] = "";
+@@ -64,8 +65,10 @@ do_test (void)
+ int result = 0;
+
+ result |= test ("C");
++#if __OPTION_EGLIBC_LOCALE_CODE
+ result |= test ("en_US.ISO-8859-1");
+ result |= test ("de_DE.UTF-8");
++#endif
+
+ return result;
+ }
+diff --git a/string/tst-strxfrm2.c b/string/tst-strxfrm2.c
+index d5a1115..19c7f30 100644
+--- a/string/tst-strxfrm2.c
++++ b/string/tst-strxfrm2.c
@@ -1,6 +1,7 @@
#include <locale.h>
#include <stdio.h>
return res;
}
-Index: git/string/tst-strxfrm.c
-===================================================================
---- git.orig/string/tst-strxfrm.c
-+++ git/string/tst-strxfrm.c
-@@ -3,6 +3,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <gnu/option-groups.h>
-
-
- char const string[] = "";
-@@ -64,8 +65,10 @@ do_test (void)
- int result = 0;
-
- result |= test ("C");
-+#if __OPTION_EGLIBC_LOCALE_CODE
- result |= test ("en_US.ISO-8859-1");
- result |= test ("de_DE.UTF-8");
-+#endif
-
- return result;
- }
-Index: git/sunrpc/Makefile
-===================================================================
---- git.orig/sunrpc/Makefile
-+++ git/sunrpc/Makefile
+diff --git a/sunrpc/Makefile b/sunrpc/Makefile
+index 60caa0a..5bc70ab 100644
+--- a/sunrpc/Makefile
++++ b/sunrpc/Makefile
@@ -18,6 +18,8 @@
#
# Sub-makefile for sunrpc portion of the library.
subdir := sunrpc
include ../Makeconfig
-@@ -55,7 +57,6 @@ headers-in-tirpc = $(addprefix rpc/,auth
+@@ -55,7 +57,6 @@ headers-in-tirpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \
headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \
$(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
headers = rpc/netdb.h
generated += $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
$(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
generated-dirs += rpcsvc
-@@ -65,18 +66,28 @@ headers += $(headers-in-tirpc) $(headers
+@@ -65,20 +66,28 @@ headers += $(headers-in-tirpc) $(headers-not-in-tirpc)
endif
ifeq ($(build-shared),yes)
-need-export-routines := auth_des auth_unix clnt_gen clnt_perr clnt_tcp \
-+need-export-routines-$(OPTION_EGLIBC_SUNRPC) += \
++need-export-routines-$(OPTION_EGLIBC_SUNRPC) := \
+ auth_des auth_unix clnt_gen clnt_perr clnt_tcp \
clnt_udp get_myaddr key_call netname pm_getport \
- rpc_thread svc svc_tcp svc_udp xcrypt xdr_array xdr \
+ rpc_thread svc svc_tcp svc_udp xdr_array xdr \
xdr_intXX_t xdr_mem xdr_ref xdr_sizeof xdr_stdio \
svc_run
-
--routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
+need-export-routines-y += xcrypt
-+
+need-export-routines := $(need-export-routines-y)
-+
-+routines-$(OPTION_EGLIBC_SUNRPC) \
-+ += auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
+
+-routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
++routines-$(OPTION_EGLIBC_SUNRPC) := \
++ auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
rpc_dtable getrpcport pmap_clnt pm_getmaps pmap_prot pmap_prot2 \
pmap_rmt rpc_prot rpc_common rpc_cmsg svc_auth svc_authux svc_raw \
svc_simple xdr_float xdr_rec publickey authdes_prot \
- des_crypt des_impl des_soft key_prot openchild rtime svcauth_des \
-- clnt_unix svc_unix create_xid $(need-export-routines)
+ key_prot openchild rtime svcauth_des \
+ getrpcent getrpcbyname getrpcbynumber \
+ getrpcent_r getrpcbyname_r getrpcbynumber_r \
+- clnt_unix svc_unix create_xid $(need-export-routines)
+ clnt_unix svc_unix create_xid
+
+# xdecrypt is also used by nss/nss_files/files-key.c.
ifneq ($(link-obsolete-rpc),yes)
# We only add the RPC for compatibility to libc.so.
shared-only-routines = $(routines)
-@@ -85,25 +96,28 @@ endif
+@@ -87,25 +96,28 @@ endif
# We do not build rpcinfo anymore. It is not needed for a bootstrap
# and not wanted on complete systems.
+
+install-others-$(OPTION_EGLIBC_SUNRPC) += $(inst_sysconfdir)/rpc
--tests = tst-xdrmem tst-xdrmem2
+-tests = tst-xdrmem tst-xdrmem2 test-rpcent
-xtests := tst-getmyaddr
-+tests-$(OPTION_EGLIBC_SUNRPC) = tst-xdrmem tst-xdrmem2
++tests-$(OPTION_EGLIBC_SUNRPC) = tst-xdrmem tst-xdrmem2 test-rpcent
+xtests-$(OPTION_EGLIBC_SUNRPC) := tst-getmyaddr
ifeq ($(have-thread-library),yes)
librpcsvc-routines = $(rpcsvc:%.x=x%)
librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
omit-deps = $(librpcsvc-routines)
-Index: git/sysdeps/generic/ldsodefs.h
-===================================================================
---- git.orig/sysdeps/generic/ldsodefs.h
-+++ git/sysdeps/generic/ldsodefs.h
-@@ -425,6 +425,12 @@ extern struct rtld_global _rtld_global _
+diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
+index 17c129b..543791a 100644
+--- a/sysdeps/arm/Makefile
++++ b/sysdeps/arm/Makefile
+@@ -37,10 +37,13 @@ ifeq ($(subdir),csu)
+ # get offset to rtld_global._dl_hwcap
+ gen-as-const-headers += rtld-global-offsets.sym tlsdesc.sym
+ aeabi_constants = aeabi_lcsts aeabi_sighandlers aeabi_math
+-aeabi_routines = aeabi_assert aeabi_localeconv aeabi_errno_addr \
++aeabi_routines = aeabi_assert aeabi_errno_addr \
+ aeabi_mb_cur_max aeabi_atexit aeabi_memclr aeabi_memcpy \
+ aeabi_memmove aeabi_memset \
+ aeabi_read_tp libc-aeabi_read_tp
++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
++aeabi_routines += aeabi_localeconv
++endif
+
+ sysdep_routines += $(aeabi_constants) $(aeabi_routines)
+ static-only-routines += $(aeabi_constants) aeabi_read_tp
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 7a0fe8d..a3e2c0a 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -435,6 +435,12 @@ extern struct rtld_global _rtld_global __rtld_global_attribute__;
# undef __rtld_global_attribute__
#endif
#ifndef SHARED
# define GLRO(name) _##name
#else
-@@ -437,8 +443,10 @@ struct rtld_global_ro
+@@ -447,8 +453,10 @@ struct rtld_global_ro
{
#endif
#define DL_DEBUG_LIBS (1 << 0)
#define DL_DEBUG_IMPCALLS (1 << 1)
#define DL_DEBUG_BINDINGS (1 << 2)
-Index: git/sysdeps/gnu/Makefile
-===================================================================
---- git.orig/sysdeps/gnu/Makefile
-+++ git/sysdeps/gnu/Makefile
-@@ -59,7 +59,8 @@ $(foreach o,$(object-suffixes) $(object-
+diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
+index ea68037..3175cc3 100644
+--- a/sysdeps/gnu/Makefile
++++ b/sysdeps/gnu/Makefile
+@@ -59,7 +59,8 @@ $(foreach o,$(object-suffixes) $(object-suffixes:=.d),\
endif
ifeq ($(subdir),login)
pututxline utmpxname updwtmpx getutmpx getutmp
sysdep_headers += utmpx.h bits/utmpx.h
-Index: git/sysdeps/ieee754/ldbl-opt/Makefile
-===================================================================
---- git.orig/sysdeps/ieee754/ldbl-opt/Makefile
-+++ git/sysdeps/ieee754/ldbl-opt/Makefile
+diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
+index 222122d..4509357 100644
+--- a/sysdeps/ieee754/ldbl-opt/Makefile
++++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -11,19 +11,18 @@ libm-routines += s_nexttowardfd
routines += math_ldbl_opt nldbl-compat
strtold strtold_l strtoldint wcstold wcstold_l wcstoldint \
qecvt qfcvt qgcvt qecvt_r qfcvt_r \
isinf isnan finite signbit scalb log2 lgamma_r ceil \
-@@ -38,9 +37,15 @@ libnldbl-calls = asprintf dprintf fprint
+@@ -38,9 +37,15 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
casinh cexp clog cproj csin csinh csqrt ctan ctanh cpow \
cabs carg cimag creal clog10 \
isoc99_scanf isoc99_fscanf isoc99_sscanf \
libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
libnldbl-inhibit-o = $(object-suffixes)
libnldbl-static-only-routines = $(libnldbl-routines)
-Index: git/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
-===================================================================
---- git.orig/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
-+++ git/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+index 0198886..55501cd 100644
+--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
++++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
@@ -26,6 +26,7 @@
#include <locale/localeinfo.h>
#include <sys/syslog.h>
static void
__nldbl_cleanup (void *arg)
-@@ -117,6 +121,7 @@ __nldbl_fprintf (FILE *stream, const cha
+@@ -117,6 +121,7 @@ __nldbl_fprintf (FILE *stream, const char *fmt, ...)
}
weak_alias (__nldbl_fprintf, __nldbl__IO_fprintf)
int
attribute_compat_text_section weak_function
__nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...)
-@@ -130,6 +135,7 @@ __nldbl_fwprintf (FILE *stream, const wc
+@@ -130,6 +135,7 @@ __nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...)
return done;
}
int
attribute_compat_text_section
-@@ -226,6 +232,7 @@ __nldbl_snprintf (char *s, size_t maxlen
+@@ -226,6 +232,7 @@ __nldbl_snprintf (char *s, size_t maxlen, const char *fmt, ...)
return done;
}
int
attribute_compat_text_section
__nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...)
-@@ -239,6 +246,7 @@ __nldbl_swprintf (wchar_t *s, size_t n,
+@@ -239,6 +246,7 @@ __nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...)
return done;
}
int
attribute_compat_text_section weak_function
-@@ -264,6 +272,7 @@ __nldbl_vdprintf (int d, const char *fmt
+@@ -264,6 +272,7 @@ __nldbl_vdprintf (int d, const char *fmt, va_list arg)
}
libc_hidden_def (__nldbl_vdprintf)
int
attribute_compat_text_section weak_function
__nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap)
-@@ -275,6 +284,7 @@ __nldbl_vfwprintf (FILE *s, const wchar_
+@@ -275,6 +284,7 @@ __nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap)
return res;
}
libc_hidden_def (__nldbl_vfwprintf)
int
attribute_compat_text_section
-@@ -297,6 +307,7 @@ __nldbl_vsnprintf (char *string, size_t
+@@ -297,6 +307,7 @@ __nldbl_vsnprintf (char *string, size_t maxlen, const char *fmt,
libc_hidden_def (__nldbl_vsnprintf)
weak_alias (__nldbl_vsnprintf, __nldbl___vsnprintf)
int
attribute_compat_text_section weak_function
__nldbl_vswprintf (wchar_t *string, size_t maxlen, const wchar_t *fmt,
-@@ -330,6 +341,7 @@ __nldbl_wprintf (const wchar_t *fmt, ...
+@@ -330,6 +341,7 @@ __nldbl_wprintf (const wchar_t *fmt, ...)
return done;
}
int
attribute_compat_text_section
-@@ -506,6 +520,7 @@ __nldbl___fprintf_chk (FILE *stream, int
+@@ -506,6 +520,7 @@ __nldbl___fprintf_chk (FILE *stream, int flag, const char *fmt, ...)
return done;
}
int
attribute_compat_text_section
__nldbl___fwprintf_chk (FILE *stream, int flag, const wchar_t *fmt, ...)
-@@ -519,6 +534,7 @@ __nldbl___fwprintf_chk (FILE *stream, in
+@@ -519,6 +534,7 @@ __nldbl___fwprintf_chk (FILE *stream, int flag, const wchar_t *fmt, ...)
return done;
}
int
attribute_compat_text_section
-@@ -563,6 +579,7 @@ __nldbl___sprintf_chk (char *s, int flag
+@@ -563,6 +579,7 @@ __nldbl___sprintf_chk (char *s, int flag, size_t slen, const char *fmt, ...)
return done;
}
int
attribute_compat_text_section
__nldbl___swprintf_chk (wchar_t *s, size_t n, int flag, size_t slen,
-@@ -577,6 +594,7 @@ __nldbl___swprintf_chk (wchar_t *s, size
+@@ -577,6 +594,7 @@ __nldbl___swprintf_chk (wchar_t *s, size_t n, int flag, size_t slen,
return done;
}
int
attribute_compat_text_section
-@@ -590,6 +608,7 @@ __nldbl___vfprintf_chk (FILE *s, int fla
+@@ -590,6 +608,7 @@ __nldbl___vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)
}
libc_hidden_def (__nldbl___vfprintf_chk)
int
attribute_compat_text_section
__nldbl___vfwprintf_chk (FILE *s, int flag, const wchar_t *fmt, va_list ap)
-@@ -601,6 +620,7 @@ __nldbl___vfwprintf_chk (FILE *s, int fl
+@@ -601,6 +620,7 @@ __nldbl___vfwprintf_chk (FILE *s, int flag, const wchar_t *fmt, va_list ap)
return res;
}
libc_hidden_def (__nldbl___vfwprintf_chk)
int
attribute_compat_text_section
-@@ -635,6 +655,7 @@ __nldbl___vsprintf_chk (char *string, in
+@@ -635,6 +655,7 @@ __nldbl___vsprintf_chk (char *string, int flag, size_t slen, const char *fmt,
}
libc_hidden_def (__nldbl___vsprintf_chk)
int
attribute_compat_text_section
__nldbl___vswprintf_chk (wchar_t *string, size_t maxlen, int flag, size_t slen,
-@@ -668,6 +689,7 @@ __nldbl___wprintf_chk (int flag, const w
+@@ -668,6 +689,7 @@ __nldbl___wprintf_chk (int flag, const wchar_t *fmt, ...)
return done;
}
int
attribute_compat_text_section
-@@ -775,6 +797,7 @@ __nldbl___printf_fp (FILE *fp, const str
+@@ -775,6 +797,7 @@ __nldbl___printf_fp (FILE *fp, const struct printf_info *info,
return ___printf_fp (fp, &info_no_ldbl, args);
}
ssize_t
attribute_compat_text_section
__nldbl_strfmon (char *s, size_t maxsize, const char *format, ...)
-@@ -829,6 +852,7 @@ __nldbl___vstrfmon_l (char *s, size_t ma
+@@ -829,6 +852,7 @@ __nldbl___vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
return res;
}
libc_hidden_def (__nldbl___vstrfmon_l)
void
attribute_compat_text_section
-@@ -941,6 +965,7 @@ __nldbl___isoc99_scanf (const char *fmt,
+@@ -941,6 +965,7 @@ __nldbl___isoc99_scanf (const char *fmt, ...)
return done;
}
int
attribute_compat_text_section
__nldbl___isoc99_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap)
-@@ -1014,6 +1039,7 @@ __nldbl___isoc99_wscanf (const wchar_t *
+@@ -1014,6 +1039,7 @@ __nldbl___isoc99_wscanf (const wchar_t *fmt, ...)
return done;
}
#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0);
-@@ -1057,6 +1083,7 @@ compat_symbol (libc, __nldbl_printf_size
+@@ -1057,6 +1083,7 @@ compat_symbol (libc, __nldbl_printf_size, printf_size, GLIBC_2_1);
compat_symbol (libc, __nldbl___strfmon_l, __strfmon_l, GLIBC_2_1);
#endif
#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_2)
compat_symbol (libc, __nldbl_swprintf, swprintf, GLIBC_2_2);
compat_symbol (libc, __nldbl_vwprintf, vwprintf, GLIBC_2_2);
compat_symbol (libc, __nldbl_wprintf, wprintf, GLIBC_2_2);
-@@ -1069,6 +1096,7 @@ compat_symbol (libc, __nldbl_vfwscanf, v
+@@ -1069,6 +1096,7 @@ compat_symbol (libc, __nldbl_vfwscanf, vfwscanf, GLIBC_2_2);
compat_symbol (libc, __nldbl_vswscanf, vswscanf, GLIBC_2_2);
compat_symbol (libc, __nldbl_vwscanf, vwscanf, GLIBC_2_2);
compat_symbol (libc, __nldbl_wscanf, wscanf, GLIBC_2_2);
#endif
#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3)
compat_symbol (libc, __nldbl_strfmon_l, strfmon_l, GLIBC_2_3);
-Index: git/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
-===================================================================
---- git.orig/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
-+++ git/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
+diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
+index 0d2c8af..f4cea50 100644
+--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
++++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
@@ -30,6 +30,7 @@
#include <math.h>
#include <monetary.h>
/* This one does not exist in the normal interface, only
__nldbl___vstrfmon really exists. */
-@@ -82,22 +85,23 @@ extern ssize_t __nldbl___vstrfmon (char
+@@ -82,22 +85,23 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list)
since we don't compile with _FORTIFY_SOURCE. */
extern int __nldbl___vfprintf_chk (FILE *__restrict, int,
const char *__restrict, _G_va_list);
+#endif
#endif /* __NLDBL_COMPAT_H */
-Index: git/sysdeps/unix/sysv/linux/gethostid.c
-===================================================================
---- git.orig/sysdeps/unix/sysv/linux/gethostid.c
-+++ git/sysdeps/unix/sysv/linux/gethostid.c
-@@ -21,6 +21,7 @@
- #include <unistd.h>
- #include <netdb.h>
- #include <not-cancel.h>
-+#include <gnu/option-groups.h>
-
- #define HOSTIDFILE "/etc/hostid"
-
-@@ -89,6 +90,7 @@ gethostid (void)
- return id;
- }
-
-+#if __OPTION_EGLIBC_INET
- /* Getting from the file was not successful. An intelligent guess for
- a unique number of a host is its IP address. Return this. */
- if (__gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0')
-@@ -115,5 +117,9 @@ gethostid (void)
- /* For the return value to be not exactly the IP address we do some
- bit fiddling. */
- return (int32_t) (in.s_addr << 16 | in.s_addr >> 16);
-+#else
-+ /* Return an arbitrary value. */
-+ return 0;
-+#endif
- }
- #endif
-Index: git/sysdeps/unix/sysv/linux/libc_fatal.c
-===================================================================
---- git.orig/sysdeps/unix/sysv/linux/libc_fatal.c
-+++ git/sysdeps/unix/sysv/linux/libc_fatal.c
-@@ -23,6 +23,7 @@
- #include <string.h>
- #include <sys/mman.h>
- #include <sys/uio.h>
-+#include <gnu/option-groups.h>
-
- static bool
- writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total)
-@@ -40,6 +41,7 @@ writev_for_fatal (int fd, const struct i
- static void
- backtrace_and_maps (int do_abort, bool written, int fd)
- {
-+#if __OPTION_EGLIBC_BACKTRACE
- if (do_abort > 1 && written)
- {
- void *addrs[64];
-@@ -62,6 +64,7 @@ backtrace_and_maps (int do_abort, bool w
- close_not_cancel_no_status (fd2);
- }
- }
-+#endif /* __OPTION_EGLIBC_BACKTRACE */
- }
- #define BEFORE_ABORT backtrace_and_maps
-
-Index: git/time/Makefile
-===================================================================
---- git.orig/time/Makefile
-+++ git/time/Makefile
-@@ -18,6 +18,8 @@
- #
- # Makefile for time routines
- #
-+include ../option-groups.mak
-+
- subdir := time
-
- include ../Makeconfig
-@@ -30,15 +32,23 @@ routines := offtime asctime clock ctime
- tzfile getitimer setitimer \
- stime dysize timegm ftime \
- getdate strptime strptime_l \
-- strftime wcsftime strftime_l wcsftime_l \
-+ strftime strftime_l \
- timespec_get
--aux := era alt_digit lc-time-cleanup
+diff --git a/sysdeps/nptl/Makefile b/sysdeps/nptl/Makefile
+index e9339a3..782009b 100644
+--- a/sysdeps/nptl/Makefile
++++ b/sysdeps/nptl/Makefile
+@@ -18,6 +18,9 @@
--tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
-- tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
-+routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
-+ := wcsftime wcsftime_l
-+aux-$(OPTION_EGLIBC_LOCALE_CODE) += alt_digit era lc-time-cleanup
-+
-+tests := test_time clocktest tst-posixtz \
-+ tst-getdate tst-mktime tst-mktime2 tst-strftime \
- tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
- tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime
+ ifeq ($(subdir),nptl)
+ libpthread-sysdep_routines += errno-loc
++ifeq ($(OPTION_EGLIBC_BIG_MACROS),n)
++sysdep_routines += small-macros-fns
++endif
+ endif
-+tests-$(OPTION_EGLIBC_LOCALE_CODE) \
-+ += tst-strptime tst-ftime_l
-+tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
-+ += tst_wcsftime
-+
- include ../Rules
+ ifeq ($(subdir),rt)
+diff --git a/sysdeps/nptl/bits/libc-lock.h b/sysdeps/nptl/bits/libc-lock.h
+index 5599cf1..b839378 100644
+--- a/sysdeps/nptl/bits/libc-lock.h
++++ b/sysdeps/nptl/bits/libc-lock.h
+@@ -24,6 +24,14 @@
+ #include <stddef.h>
- tz-cflags = -DTZDIR='"$(zonedir)"' \
-Index: git/time/strftime_l.c
-===================================================================
---- git.orig/time/strftime_l.c
-+++ git/time/strftime_l.c
-@@ -35,6 +35,10 @@
- # include "../locale/localeinfo.h"
- #endif
+#ifdef _LIBC
-+# include <gnu/option-groups.h>
++# include <lowlevellock.h>
++# include <tls.h>
++# include <pthread-functions.h>
++# include <errno.h> /* For EBUSY. */
++# include <gnu/option-groups.h> /* For __OPTION_EGLIBC_BIG_MACROS. */
+#endif
+
- #if defined emacs && !defined HAVE_BCOPY
- # define HAVE_MEMCPY 1
- #endif
-@@ -882,7 +886,7 @@ __strftime_internal (s, maxsize, format,
- case L_('C'):
- if (modifier == L_('E'))
- {
--#if HAVE_STRUCT_ERA_ENTRY
-+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
- struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
- if (era)
- {
-@@ -955,7 +959,7 @@ __strftime_internal (s, maxsize, format,
+ /* Mutex type. */
+ #if defined _LIBC || defined _IO_MTSAFE_IO
+ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+@@ -87,6 +95,15 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
- if (modifier == L_('O') && 0 <= number_value)
- {
--#ifdef _NL_CURRENT
-+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
- /* Get the locale specific alternate representation of
- the number NUMBER_VALUE. If none exist NULL is returned. */
- const CHAR_T *cp = nl_get_alt_digit (number_value
-@@ -1260,7 +1264,7 @@ __strftime_internal (s, maxsize, format,
- case L_('Y'):
- if (modifier == 'E')
- {
--#if HAVE_STRUCT_ERA_ENTRY
-+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
- struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
- if (era)
- {
-@@ -1285,7 +1289,7 @@ __strftime_internal (s, maxsize, format,
- case L_('y'):
- if (modifier == L_('E'))
- {
--#if HAVE_STRUCT_ERA_ENTRY
-+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
- struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
- if (era)
- {
-Index: git/time/strptime_l.c
-===================================================================
---- git.orig/time/strptime_l.c
-+++ git/time/strptime_l.c
-@@ -29,6 +29,7 @@
+ /* Lock the recursive named lock variable. */
+ #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++ !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from
++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */
++extern void __libc_lock_lock_recursive_fn (__libc_lock_recursive_t *);
++libc_hidden_proto (__libc_lock_lock_recursive_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
++
+ # define __libc_lock_lock_recursive(NAME) \
+ do { \
+ void *self = THREAD_SELF; \
+@@ -97,6 +114,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+ } \
+ ++(NAME).cnt; \
+ } while (0)
++# else
++# define __libc_lock_lock_recursive(NAME) \
++ __libc_lock_lock_recursive_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # define __libc_lock_lock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
+@@ -104,6 +125,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
- #ifdef _LIBC
- # define HAVE_LOCALTIME_R 0
-+# include <gnu/option-groups.h>
- # include "../locale/localeinfo.h"
- #endif
+ /* Try to lock the recursive named lock variable. */
+ #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++ !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from
++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */
++extern int __libc_lock_trylock_recursive_fn (__libc_lock_recursive_t *);
++libc_hidden_proto (__libc_lock_trylock_recursive_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
+ # define __libc_lock_trylock_recursive(NAME) \
+ ({ \
+ int result = 0; \
+@@ -122,6 +151,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+ ++(NAME).cnt; \
+ result; \
+ })
++# else
++# define __libc_lock_trylock_recursive(NAME) \
++ __libc_lock_trylock_recursive_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # define __libc_lock_trylock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
+@@ -129,6 +162,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
-@@ -84,7 +85,7 @@ localtime_r (t, tp)
- if (val < from || val > to) \
- return NULL; \
+ /* Unlock the recursive named lock variable. */
+ #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++ !__OPTION_EGLIBC_BIG_MACROS, or we are using a back door from
++ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */
++extern void __libc_lock_unlock_recursive_fn (__libc_lock_recursive_t *);
++libc_hidden_proto (__libc_lock_unlock_recursive_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
+ /* We do no error checking here. */
+ # define __libc_lock_unlock_recursive(NAME) \
+ do { \
+@@ -138,6 +179,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+ lll_unlock ((NAME).lock, LLL_PRIVATE); \
+ } \
} while (0)
--#ifdef _NL_CURRENT
-+#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
- # define get_alt_number(from, to, n) \
- ({ \
- __label__ do_normal; \
-@@ -257,8 +258,10 @@ __strptime_internal (rp, fmt, tmp, state
- int cnt;
- int cnt_longest;
- size_t val;
-+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
- size_t num_eras;
- struct era_entry *era = NULL;
-+#endif
- enum ptime_locale_status { not, loc, raw } decided_longest;
- struct __strptime_state
- {
-@@ -820,6 +823,7 @@ __strptime_internal (rp, fmt, tmp, state
- s.want_xday = 1;
- break;
- case 'C':
-+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
- if (s.decided != raw)
- {
- if (s.era_cnt >= 0)
-@@ -856,10 +860,12 @@ __strptime_internal (rp, fmt, tmp, state
++# else
++# define __libc_lock_unlock_recursive(NAME) \
++ __libc_lock_unlock_recursive_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # define __libc_lock_unlock_recursive(NAME) \
+ __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
+diff --git a/sysdeps/nptl/bits/libc-lockP.h b/sysdeps/nptl/bits/libc-lockP.h
+index f55f621..da98869 100644
+--- a/sysdeps/nptl/bits/libc-lockP.h
++++ b/sysdeps/nptl/bits/libc-lockP.h
+@@ -33,6 +33,8 @@
+ #include <lowlevellock.h>
+ #include <tls.h>
+ #include <pthread-functions.h>
++#include <errno.h> /* For EBUSY. */
++#include <gnu/option-groups.h> /* For __OPTION_EGLIBC_BIG_MACROS. */
- s.decided = raw;
- }
-+#endif
- /* The C locale has no era information, so use the
- normal representation. */
- goto match_century;
- case 'y':
-+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
- if (s.decided != raw)
- {
- get_number(0, 9999, 4);
-@@ -918,9 +924,10 @@ __strptime_internal (rp, fmt, tmp, state
-
- s.decided = raw;
- }
--
-+#endif
- goto match_year_in_century;
- case 'Y':
-+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
- if (s.decided != raw)
- {
- num_eras = _NL_CURRENT_WORD (LC_TIME,
-@@ -948,6 +955,7 @@ __strptime_internal (rp, fmt, tmp, state
-
- s.decided = raw;
- }
-+#endif
- get_number (0, 9999, 4);
- tm->tm_year = val - 1900;
- s.want_century = 0;
-@@ -1118,6 +1126,7 @@ __strptime_internal (rp, fmt, tmp, state
- tm->tm_year = (s.century - 19) * 100;
- }
-
-+#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
- if (s.era_cnt != -1)
- {
- era = _nl_select_era_entry (s.era_cnt HELPER_LOCALE_ARG);
-@@ -1132,6 +1141,7 @@ __strptime_internal (rp, fmt, tmp, state
- tm->tm_year = era->start_date[0];
- }
- else
-+#endif
- if (s.want_era)
- {
- /* No era found but we have seen an E modifier. Rectify some
-Index: git/timezone/Makefile
-===================================================================
---- git.orig/timezone/Makefile
-+++ git/timezone/Makefile
-@@ -117,7 +117,7 @@ $(testdata)/Asia/Tokyo: asia $(zic-deps)
-
- $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
- sed -e 's|/bin/bash|/bin/sh|' \
-- -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
-+ -e '/TZDIR=/s|\$$(pwd)|$(zonedir)|' \
- -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
- -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
- -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
-Index: git/wcsmbs/Makefile
-===================================================================
---- git.orig/wcsmbs/Makefile
-+++ git/wcsmbs/Makefile
-@@ -18,15 +18,21 @@
- #
- # Sub-makefile for wcsmbs portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := wcsmbs
-
- include ../Makeconfig
-
- headers := wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h
-
--routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
-+# These functions are used by printf_fp.c, even in the plain case; see
-+# comments there for OPTION_EGLIBC_LOCALE_CODE.
-+routines := wmemcpy wmemset
-+routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
-+ := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
- wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
-- wmemcmp wmemcpy wmemmove wmemset wcpcpy wcpncpy wmempcpy \
-+ wmemcmp wmemmove wcpcpy wcpncpy wmempcpy \
- btowc wctob mbsinit \
- mbrlen mbrtowc wcrtomb mbsrtowcs wcsrtombs \
- mbsnrtowcs wcsnrtombs wcsnlen wcschrnul \
-@@ -38,14 +44,21 @@ routines := wcscat wcschr wcscmp wcscpy
- wcscoll_l wcsxfrm_l \
- wcscasecmp wcsncase wcscasecmp_l wcsncase_l \
- wcsmbsload mbsrtowcs_l \
-- isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf \
- isoc99_swscanf isoc99_vswscanf \
- mbrtoc16 c16rtomb
-
-+routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
-+ += isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf
-+
- strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy
--tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
-- tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \
-- tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests))
-+
-+tests := tst-wchar-h
-+tests-$(OPTION_EGLIBC_LOCALE_CODE) \
-+ += tst-btowc tst-mbrtowc tst-mbrtowc2 tst-wcrtomb tst-c16c32-1
-+tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
-+ += tst-wcstof wcsmbs-tst1 tst-wcsnlen \
-+ tst-wcpncpy tst-mbsrtowcs \
-+ wcsatcliff $(addprefix test-,$(strop-tests))
-
- include ../Rules
-
-Index: git/wcsmbs/wcsmbsload.c
-===================================================================
---- git.orig/wcsmbs/wcsmbsload.c
-+++ git/wcsmbs/wcsmbsload.c
-@@ -21,6 +21,7 @@
- #include <limits.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <gnu/option-groups.h>
-
- #include <locale/localeinfo.h>
- #include <wcsmbsload.h>
-@@ -143,6 +144,7 @@ __wcsmbs_getfct (const char *to, const c
- })
-
-
-+#if __OPTION_EGLIBC_LOCALE_CODE
- /* Some of the functions here must not be used while setlocale is called. */
- __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
-
-@@ -211,6 +213,17 @@ __wcsmbs_load_conv (struct __locale_data
-
- __libc_rwlock_unlock (__libc_setlocale_lock);
- }
-+#else
-+void
-+internal_function
-+__wcsmbs_load_conv (struct __locale_data *new_category)
-+{
-+ /* When OPTION_EGLIBC_LOCALE_CODE is disabled, we should never reach
-+ this point: there is no way to change locales, so every locale
-+ passed to get_gconv_fcts should be _nl_C_LC_CTYPE. */
-+ abort ();
-+}
-+#endif
-
-
- /* Clone the current conversion function set. */
-Index: git/wctype/Makefile
-===================================================================
---- git.orig/wctype/Makefile
-+++ git/wctype/Makefile
-@@ -18,14 +18,20 @@
- #
- # Sub-makefile for wctype portion of the library.
- #
-+include ../option-groups.mak
-+
- subdir := wctype
-
- include ../Makeconfig
-
- headers := wctype.h
--routines := wcfuncs wctype iswctype wctrans towctrans \
-- wcfuncs_l wctype_l iswctype_l wctrans_l towctrans_l
-+routines := wctrans towctrans towctrans_l
-+routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
-+ := wcfuncs wctype iswctype \
-+ wcfuncs_l wctype_l iswctype_l wctrans_l
-
--tests := test_wctype test_wcfuncs bug-wctypeh
-+tests :=
-+tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
-+ += test_wctype test_wcfuncs bug-wctypeh
-
- include ../Rules
-Index: git/sysdeps/nptl/Makefile
-===================================================================
---- git.orig/sysdeps/nptl/Makefile
-+++ git/sysdeps/nptl/Makefile
-@@ -18,6 +18,9 @@
-
- ifeq ($(subdir),nptl)
- libpthread-sysdep_routines += errno-loc
-+ifeq ($(OPTION_EGLIBC_BIG_MACROS),n)
-+sysdep_routines += small-macros-fns
-+endif
- endif
-
- ifeq ($(subdir),rt)
-Index: git/sysdeps/nptl/bits/libc-lock.h
-===================================================================
---- git.orig/sysdeps/nptl/bits/libc-lock.h
-+++ git/sysdeps/nptl/bits/libc-lock.h
-@@ -24,6 +24,14 @@
- #include <stddef.h>
-
-
-+#ifdef _LIBC
-+# include <lowlevellock.h>
-+# include <tls.h>
-+# include <pthread-functions.h>
-+# include <errno.h> /* For EBUSY. */
-+# include <gnu/option-groups.h> /* For __OPTION_EGLIBC_BIG_MACROS. */
-+#endif
-+
- /* Mutex type. */
- #if defined _LIBC || defined _IO_MTSAFE_IO
- # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
-@@ -87,6 +95,15 @@ typedef struct __libc_lock_recursive_opa
-
- /* Lock the recursive named lock variable. */
- #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
-+# if __OPTION_EGLIBC_BIG_MACROS != 1
-+/* EGLIBC: Declare wrapper function for a big macro if either
-+ !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from
-+ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */
-+extern void __libc_lock_lock_recursive_fn (__libc_lock_recursive_t *);
-+libc_hidden_proto (__libc_lock_lock_recursive_fn);
-+# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
-+# if __OPTION_EGLIBC_BIG_MACROS
-+
- # define __libc_lock_lock_recursive(NAME) \
- do { \
- void *self = THREAD_SELF; \
-@@ -97,6 +114,10 @@ typedef struct __libc_lock_recursive_opa
- } \
- ++(NAME).cnt; \
- } while (0)
-+# else
-+# define __libc_lock_lock_recursive(NAME) \
-+ __libc_lock_lock_recursive_fn (&(NAME))
-+# endif /* __OPTION_EGLIBC_BIG_MACROS */
- #else
- # define __libc_lock_lock_recursive(NAME) \
- __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
-@@ -104,6 +125,14 @@ typedef struct __libc_lock_recursive_opa
-
- /* Try to lock the recursive named lock variable. */
- #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
-+# if __OPTION_EGLIBC_BIG_MACROS != 1
-+/* EGLIBC: Declare wrapper function for a big macro if either
-+ !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from
-+ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */
-+extern int __libc_lock_trylock_recursive_fn (__libc_lock_recursive_t *);
-+libc_hidden_proto (__libc_lock_trylock_recursive_fn);
-+# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
-+# if __OPTION_EGLIBC_BIG_MACROS
- # define __libc_lock_trylock_recursive(NAME) \
- ({ \
- int result = 0; \
-@@ -122,6 +151,10 @@ typedef struct __libc_lock_recursive_opa
- ++(NAME).cnt; \
- result; \
- })
-+# else
-+# define __libc_lock_trylock_recursive(NAME) \
-+ __libc_lock_trylock_recursive_fn (&(NAME))
-+# endif /* __OPTION_EGLIBC_BIG_MACROS */
- #else
- # define __libc_lock_trylock_recursive(NAME) \
- __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
-@@ -129,6 +162,14 @@ typedef struct __libc_lock_recursive_opa
-
- /* Unlock the recursive named lock variable. */
- #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
-+# if __OPTION_EGLIBC_BIG_MACROS != 1
-+/* EGLIBC: Declare wrapper function for a big macro if either
-+ !__OPTION_EGLIBC_BIG_MACROS, or we are using a back door from
-+ small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2). */
-+extern void __libc_lock_unlock_recursive_fn (__libc_lock_recursive_t *);
-+libc_hidden_proto (__libc_lock_unlock_recursive_fn);
-+# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
-+# if __OPTION_EGLIBC_BIG_MACROS
- /* We do no error checking here. */
- # define __libc_lock_unlock_recursive(NAME) \
- do { \
-@@ -138,6 +179,10 @@ typedef struct __libc_lock_recursive_opa
- lll_unlock ((NAME).lock, LLL_PRIVATE); \
- } \
- } while (0)
-+# else
-+# define __libc_lock_unlock_recursive(NAME) \
-+ __libc_lock_unlock_recursive_fn (&(NAME))
-+# endif /* __OPTION_EGLIBC_BIG_MACROS */
- #else
- # define __libc_lock_unlock_recursive(NAME) \
- __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
-Index: git/sysdeps/nptl/bits/libc-lockP.h
-===================================================================
---- git.orig/sysdeps/nptl/bits/libc-lockP.h
-+++ git/sysdeps/nptl/bits/libc-lockP.h
-@@ -33,6 +33,8 @@
- #include <lowlevellock.h>
- #include <tls.h>
- #include <pthread-functions.h>
-+#include <errno.h> /* For EBUSY. */
-+#include <gnu/option-groups.h> /* For __OPTION_EGLIBC_BIG_MACROS. */
-
- #if IS_IN (libpthread)
- /* This gets us the declarations of the __pthread_* internal names,
-@@ -171,10 +173,22 @@ typedef pthread_key_t __libc_key_t;
+ #if IS_IN (libpthread)
+ /* This gets us the declarations of the __pthread_* internal names,
+@@ -171,10 +173,22 @@ typedef pthread_key_t __libc_key_t;
/* Lock the named lock variable. */
#if IS_IN (libc) || IS_IN (libpthread)
#else
# define __libc_lock_unlock(NAME) \
__libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
-Index: git/sysdeps/nptl/small-macros-fns.c
-===================================================================
+diff --git a/sysdeps/nptl/small-macros-fns.c b/sysdeps/nptl/small-macros-fns.c
+new file mode 100644
+index 0000000..f751053
--- /dev/null
-+++ git/sysdeps/nptl/small-macros-fns.c
++++ b/sysdeps/nptl/small-macros-fns.c
@@ -0,0 +1,72 @@
+/* EGLIBC: function wrappers for big macros.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+libc_hidden_def (__libc_lock_unlock_recursive_fn);
+
+#endif /*defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)*/
-Index: git/crypt/crypt_common.c
-===================================================================
---- /dev/null
-+++ git/crypt/crypt_common.c
-@@ -0,0 +1,42 @@
-+/*
-+ * crypt: crypt(3) implementation
-+ *
-+ * Copyright (C) 1991-2014 Free Software Foundation, Inc.
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; see the file COPYING.LIB. If not,
-+ * see <http://www.gnu.org/licenses/>.
-+ *
-+ * General Support routines
-+ *
-+ */
+diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c
+index 26e4692..d0a26c8 100644
+--- a/sysdeps/unix/sysv/linux/gethostid.c
++++ b/sysdeps/unix/sysv/linux/gethostid.c
+@@ -21,6 +21,7 @@
+ #include <unistd.h>
+ #include <netdb.h>
+ #include <not-cancel.h>
++#include <gnu/option-groups.h>
+
+ #define HOSTIDFILE "/etc/hostid"
+
+@@ -89,6 +90,7 @@ gethostid (void)
+ return id;
+ }
+
++#if __OPTION_EGLIBC_INET
+ /* Getting from the file was not successful. An intelligent guess for
+ a unique number of a host is its IP address. Return this. */
+ if (__gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0')
+@@ -115,5 +117,9 @@ gethostid (void)
+ /* For the return value to be not exactly the IP address we do some
+ bit fiddling. */
+ return (int32_t) (in.s_addr << 16 | in.s_addr >> 16);
++#else
++ /* Return an arbitrary value. */
++ return 0;
++#endif
+ }
+ #endif
+diff --git a/sysdeps/unix/sysv/linux/libc_fatal.c b/sysdeps/unix/sysv/linux/libc_fatal.c
+index 53a8bbb..cb110d4 100644
+--- a/sysdeps/unix/sysv/linux/libc_fatal.c
++++ b/sysdeps/unix/sysv/linux/libc_fatal.c
+@@ -23,6 +23,7 @@
+ #include <string.h>
+ #include <sys/mman.h>
+ #include <sys/uio.h>
++#include <gnu/option-groups.h>
+
+ static bool
+ writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total)
+@@ -40,6 +41,7 @@ writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total)
+ static void
+ backtrace_and_maps (int do_abort, bool written, int fd)
+ {
++#if __OPTION_EGLIBC_BACKTRACE
+ if (do_abort > 1 && written)
+ {
+ void *addrs[64];
+@@ -62,6 +64,7 @@ backtrace_and_maps (int do_abort, bool written, int fd)
+ close_not_cancel_no_status (fd2);
+ }
+ }
++#endif /* __OPTION_EGLIBC_BACKTRACE */
+ }
+ #define BEFORE_ABORT backtrace_and_maps
+
+diff --git a/time/Makefile b/time/Makefile
+index a411f62..2d022ca 100644
+--- a/time/Makefile
++++ b/time/Makefile
+@@ -18,6 +18,8 @@
+ #
+ # Makefile for time routines
+ #
++include ../option-groups.mak
+
-+#include "crypt-private.h"
+ subdir := time
+
+ include ../Makeconfig
+@@ -30,15 +32,23 @@ routines := offtime asctime clock ctime ctime_r difftime \
+ tzfile getitimer setitimer \
+ stime dysize timegm ftime \
+ getdate strptime strptime_l \
+- strftime wcsftime strftime_l wcsftime_l \
++ strftime strftime_l \
+ timespec_get
+-aux := era alt_digit lc-time-cleanup
+
+-tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
+- tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++ := wcsftime wcsftime_l
++aux-$(OPTION_EGLIBC_LOCALE_CODE) += alt_digit era lc-time-cleanup
+
-+/* Table with characters for base64 transformation. */
-+static const char b64t[64] =
-+"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
++tests := test_time clocktest tst-posixtz \
++ tst-getdate tst-mktime tst-mktime2 tst-strftime \
+ tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
+ tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime
+
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++ += tst-strptime tst-ftime_l
++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
++ += tst_wcsftime
++
+ include ../Rules
+
+ tz-cflags = -DTZDIR='"$(zonedir)"' \
+diff --git a/time/strftime_l.c b/time/strftime_l.c
+index b48ef34..bfdd618 100644
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -35,6 +35,10 @@
+ # include "../locale/localeinfo.h"
+ #endif
+
++#ifdef _LIBC
++# include <gnu/option-groups.h>
++#endif
+
+ #if defined emacs && !defined HAVE_BCOPY
+ # define HAVE_MEMCPY 1
+ #endif
+@@ -882,7 +886,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+ case L_('C'):
+ if (modifier == L_('E'))
+ {
+-#if HAVE_STRUCT_ERA_ENTRY
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ if (era)
+ {
+@@ -955,7 +959,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+
+ if (modifier == L_('O') && 0 <= number_value)
+ {
+-#ifdef _NL_CURRENT
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
+ /* Get the locale specific alternate representation of
+ the number NUMBER_VALUE. If none exist NULL is returned. */
+ const CHAR_T *cp = nl_get_alt_digit (number_value
+@@ -1260,7 +1264,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+ case L_('Y'):
+ if (modifier == 'E')
+ {
+-#if HAVE_STRUCT_ERA_ENTRY
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ if (era)
+ {
+@@ -1285,7 +1289,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+ case L_('y'):
+ if (modifier == L_('E'))
+ {
+-#if HAVE_STRUCT_ERA_ENTRY
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ if (era)
+ {
+diff --git a/time/strptime_l.c b/time/strptime_l.c
+index 5640cce..784ccbc 100644
+--- a/time/strptime_l.c
++++ b/time/strptime_l.c
+@@ -29,6 +29,7 @@
+
+ #ifdef _LIBC
+ # define HAVE_LOCALTIME_R 0
++# include <gnu/option-groups.h>
+ # include "../locale/localeinfo.h"
+ #endif
+
+@@ -84,7 +85,7 @@ localtime_r (t, tp)
+ if (val < from || val > to) \
+ return NULL; \
+ } while (0)
+-#ifdef _NL_CURRENT
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
+ # define get_alt_number(from, to, n) \
+ ({ \
+ __label__ do_normal; \
+@@ -257,8 +258,10 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ int cnt;
+ int cnt_longest;
+ size_t val;
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+ size_t num_eras;
+ struct era_entry *era = NULL;
++#endif
+ enum ptime_locale_status { not, loc, raw } decided_longest;
+ struct __strptime_state
+ {
+@@ -820,6 +823,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ s.want_xday = 1;
+ break;
+ case 'C':
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+ if (s.decided != raw)
+ {
+ if (s.era_cnt >= 0)
+@@ -856,10 +860,12 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+
+ s.decided = raw;
+ }
++#endif
+ /* The C locale has no era information, so use the
+ normal representation. */
+ goto match_century;
+ case 'y':
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+ if (s.decided != raw)
+ {
+ get_number(0, 9999, 4);
+@@ -918,9 +924,10 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+
+ s.decided = raw;
+ }
+-
++#endif
+ goto match_year_in_century;
+ case 'Y':
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+ if (s.decided != raw)
+ {
+ num_eras = _NL_CURRENT_WORD (LC_TIME,
+@@ -948,6 +955,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+
+ s.decided = raw;
+ }
++#endif
+ get_number (0, 9999, 4);
+ tm->tm_year = val - 1900;
+ s.want_century = 0;
+@@ -1118,6 +1126,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ tm->tm_year = (s.century - 19) * 100;
+ }
+
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+ if (s.era_cnt != -1)
+ {
+ era = _nl_select_era_entry (s.era_cnt HELPER_LOCALE_ARG);
+@@ -1132,6 +1141,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ tm->tm_year = era->start_date[0];
+ }
+ else
++#endif
+ if (s.want_era)
+ {
+ /* No era found but we have seen an E modifier. Rectify some
+diff --git a/timezone/Makefile b/timezone/Makefile
+index 886b06e..f922684 100644
+--- a/timezone/Makefile
++++ b/timezone/Makefile
+@@ -127,7 +127,7 @@ $(testdata)/XT%: testdata/XT%
+
+ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
+ sed -e 's|/bin/bash|/bin/sh|' \
+- -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
++ -e '/TZDIR=/s|\$$(pwd)|$(zonedir)|' \
+ -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
+ -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
+ -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index 44a4494..db9fc24 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -18,15 +18,21 @@
+ #
+ # Sub-makefile for wcsmbs portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir := wcsmbs
+
+ include ../Makeconfig
+
+ headers := wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h
+
+-routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
++# These functions are used by printf_fp.c, even in the plain case; see
++# comments there for OPTION_EGLIBC_LOCALE_CODE.
++routines := wmemcpy wmemset
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++ := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
+- wmemcmp wmemcpy wmemmove wmemset wcpcpy wcpncpy wmempcpy \
++ wmemcmp wmemmove wcpcpy wcpncpy wmempcpy \
+ btowc wctob mbsinit \
+ mbrlen mbrtowc wcrtomb mbsrtowcs wcsrtombs \
+ mbsnrtowcs wcsnrtombs wcsnlen wcschrnul \
+@@ -38,14 +44,21 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ wcscoll_l wcsxfrm_l \
+ wcscasecmp wcsncase wcscasecmp_l wcsncase_l \
+ wcsmbsload mbsrtowcs_l \
+- isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf \
+ isoc99_swscanf isoc99_vswscanf \
+ mbrtoc16 c16rtomb
+
+-strop-tests := wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy
+-tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
+- tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \
+- tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests))
++routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
++ += isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf
++
++strop-tests := wcscmp wmemcmp wmemcmp wcslen wcschr wcsrchr wcscpy
++
++tests := tst-wchar-h
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++ += tst-btowc tst-mbrtowc tst-mbrtowc2 tst-wcrtomb tst-c16c32-1
++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++ += tst-wcstof wcsmbs-tst1 tst-wcsnlen \
++ tst-wcpncpy tst-mbsrtowcs \
++ wcsatcliff $(addprefix test-,$(strop-tests))
+
+ include ../Rules
+
+diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c
+index 6bb49bc..2ab9d07 100644
+--- a/wcsmbs/wcsmbsload.c
++++ b/wcsmbs/wcsmbsload.c
+@@ -21,6 +21,7 @@
+ #include <limits.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <gnu/option-groups.h>
+
+ #include <locale/localeinfo.h>
+ #include <wcsmbsload.h>
+@@ -143,6 +144,7 @@ __wcsmbs_getfct (const char *to, const char *from, size_t *nstepsp)
+ })
+
+
++#if __OPTION_EGLIBC_LOCALE_CODE
+ /* Some of the functions here must not be used while setlocale is called. */
+ __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
+
+@@ -211,6 +213,17 @@ __wcsmbs_load_conv (struct __locale_data *new_category)
+
+ __libc_rwlock_unlock (__libc_setlocale_lock);
+ }
++#else
+void
-+__b64_from_24bit (char **cp, int *buflen,
-+ unsigned int b2, unsigned int b1, unsigned int b0,
-+ int n)
++internal_function
++__wcsmbs_load_conv (struct __locale_data *new_category)
+{
-+ unsigned int w = (b2 << 16) | (b1 << 8) | b0;
-+ while (n-- > 0 && (*buflen) > 0)
-+ {
-+ *(*cp)++ = b64t[w & 0x3f];
-+ --(*buflen);
-+ w >>= 6;
-+ }
++ /* When OPTION_EGLIBC_LOCALE_CODE is disabled, we should never reach
++ this point: there is no way to change locales, so every locale
++ passed to get_gconv_fcts should be _nl_C_LC_CTYPE. */
++ abort ();
+}
-Index: git/crypt/crypt_util.c
-===================================================================
---- git.orig/crypt/crypt_util.c
-+++ git/crypt/crypt_util.c
-@@ -242,10 +242,6 @@ static ufc_long eperm32tab[4][256][2];
- */
- static ufc_long efp[16][64][2];
++#endif
--/* Table with characters for base64 transformation. */
--static const char b64t[64] =
--"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
--
- /*
- * For use by the old, non-reentrant routines
- * (crypt/encrypt/setkey)
-@@ -949,17 +945,3 @@ setkey(__key)
- {
- __setkey_r(__key, &_ufc_foobar);
- }
+
+ /* Clone the current conversion function set. */
+diff --git a/wctype/Makefile b/wctype/Makefile
+index c56f07c..4e8af43 100644
+--- a/wctype/Makefile
++++ b/wctype/Makefile
+@@ -18,14 +18,20 @@
+ #
+ # Sub-makefile for wctype portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir := wctype
+
+ include ../Makeconfig
+
+ headers := wctype.h
+-routines := wcfuncs wctype iswctype wctrans towctrans \
+- wcfuncs_l wctype_l iswctype_l wctrans_l towctrans_l
-
--void
--__b64_from_24bit (char **cp, int *buflen,
-- unsigned int b2, unsigned int b1, unsigned int b0,
-- int n)
--{
-- unsigned int w = (b2 << 16) | (b1 << 8) | b0;
-- while (n-- > 0 && (*buflen) > 0)
-- {
-- *(*cp)++ = b64t[w & 0x3f];
-- --(*buflen);
-- w >>= 6;
-- }
--}
-Index: git/sysdeps/arm/Makefile
-===================================================================
---- git.orig/sysdeps/arm/Makefile
-+++ git/sysdeps/arm/Makefile
-@@ -37,10 +37,13 @@ ifeq ($(subdir),csu)
- # get offset to rtld_global._dl_hwcap
- gen-as-const-headers += rtld-global-offsets.sym tlsdesc.sym
- aeabi_constants = aeabi_lcsts aeabi_sighandlers aeabi_math
--aeabi_routines = aeabi_assert aeabi_localeconv aeabi_errno_addr \
-+aeabi_routines = aeabi_assert aeabi_errno_addr \
- aeabi_mb_cur_max aeabi_atexit aeabi_memclr aeabi_memcpy \
- aeabi_memmove aeabi_memset \
- aeabi_read_tp libc-aeabi_read_tp
-+ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
-+aeabi_routines += aeabi_localeconv
-+endif
+-tests := test_wctype test_wcfuncs bug-wctypeh
++routines := wctrans towctrans towctrans_l
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++ := wcfuncs wctype iswctype \
++ wcfuncs_l wctype_l iswctype_l wctrans_l
++
++tests :=
++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++ += test_wctype test_wcfuncs bug-wctypeh
- sysdep_routines += $(aeabi_constants) $(aeabi_routines)
- static-only-routines += $(aeabi_constants) aeabi_read_tp
+ include ../Rules
+--
+2.1.4
+