diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-11-17 17:50:14 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-11-17 17:50:14 +0000 |
commit | c27e56d74f3fb58f18e5381e49d30e1134b2005e (patch) | |
tree | 961e5061add44ed5f4bdded12ae6f2bb7d4c930a | |
parent | 976bc9d4ac64f30edc1e8fa8ec7552703f04a6de (diff) | |
download | eglibc2-c27e56d74f3fb58f18e5381e49d30e1134b2005e.tar.gz |
Merge changes between r21628 and r21775 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@21776 7b3dc134-2b1b-0410-93df-9e9f96275f8d
85 files changed, 2731 insertions, 984 deletions
diff --git a/libc/ChangeLog b/libc/ChangeLog index 011e854ad..82c48f8fd 100644 --- a/libc/ChangeLog +++ b/libc/ChangeLog @@ -1,5 +1,205 @@ +2012-11-17 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/fxstatat.c: Include <string.h>. + + * elf/dl-runtime.c [!ELF_MACHINE_NO_PLT]: Make code unconditional. + + * posix/getconf-speclist.c: New file. + * posix/posix-envs.def: Likewise. + * posix/confstr.c (START_ENV_GROUP): New macro. + (END_ENV_GROUP): Likewise. + (KNOWN_ABSENT_ENVIRONMENT): Likewise. + (KNOWN_PRESENT_ENV_STRING): Likewise. + (KNOWN_PRESENT_ENVIRONMENT): Likewise. + (UNKNOWN_ENVIRONMENT): Likewise. + (confstr): Include posix-envs.def instead of handling + _CS_V7_WIDTH_RESTRICTED_ENVS, _CS_V6_WIDTH_RESTRICTED_ENVS and + _CS_V5_WIDTH_RESTRICTED_ENVS directly here. + * sysdeps/posix/sysconf.c (START_ENV_GROUP): New macro. + (END_ENV_GROUP): Likewise. + (KNOWN_ABSENT_ENVIRONMENT): Likewise. + (KNOWN_PRESENT_ENVIRONMENT): Likewise. + (UNKNOWN_ENVIRONMENT): Likewise. + (__sysconf): Include posix-envs.def instead of handling associated + cases directly here. + * posix/Makefile ($(objpfx)getconf.speclist): Generate by + preprocessing getconf-speclist.c rather than running getconf or + generating empty file. + +2012-11-16 Pino Toscano <toscano.pino@tiscali.it> + + * scripts/check-local-headers.sh: Ignore 'mach' headers. + +2012-11-16 Andrej Lajovic <natrij@gmail.com> + + [BZ #14672] + * iconv/iconv_prog.c (main): Fix -c handling of '/'. + +2012-11-16 David S. Miller <davem@davemloft.net> + + * sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl): If xm1 is + smaller than LDBL_EPSILON/2.0L, just return xm1. + +2012-11-16 H.J. Lu <hongjiu.lu@intel.com> + + * elf/tst-array1.c (init): Set constructor priority to 1000. + (fini): Set destructor priority to 1000. + * elf/tst-array2dep.c: Likewise. + +2012-11-16 Siddhesh Poyarekar <siddhesh@redhat.com> + + [BZ #11741] + * libio/fileops.c (_IO_new_file_write): Correctly return error. + (_IO_new_file_xsputn): Also return EOF if none of the input + data was written when overflow failed. + * libio/iopadn.c (_IO_padn): Likewise. + * libio/iowpadn.c (_IO_wpadn): Likewise. + * stdio-common/tst-put-error.c: Add copyright notice. + (do_test): Add case for printing padded string. + * stdio-common/vfprintf [!COMPILE_WPRINTF] (PAD): Flag error if + _IO_padn returned error. + [COMPILE_WPRINTF] (PAD): Flag error if _IO_wpadn returned error. + * libio/libioP.h (_IO_xsputn_t): Note in comment that xsputn can + return EOF. + +2012-11-16 Siddhesh Poyarekar <siddhesh@redhat.com> + + * libio/libioP.h: Add comment note that the references to C++ + bits are now obsolete. + +2012-11-15 Marcus Shawcroft <marcus.shawcroft@linaro.org> + + * math/libm-test.inc (check_complex): Use asprintf. + +2012-11-14 Joseph Myers <joseph@codesourcery.com> + + * debug/pcprofiledump.c (print_version): Update copyright year. + * malloc/memusagestat.c (print_version): Likewise. + +2012-11-14 H.J. Lu <hongjiu.lu@intel.com> + + [BZ #14831] + * elf/Makefile (tests): Add tst-audit8. + ($(objpfx)tst-audit8): Also depend on $(common-objpfx)math/libm.so. + ($(objpfx)tst-audit8.out): New target. + (tst-audit8-ENV): New variable. + * elf/dl-runtime.c (_dl_profile_fixup): Call _dl_fixup to skip + audit if l_reloc_result is NULL. + (ELF_MACHINE_RUNTIME_FIXUP_PARAMS): Issue an error if it isn't + defined and ELF_MACHINE_RUNTIME_FIXUP_ARGS is defined. + * elf/tst-audit8.c: New file. + +2012-11-14 Marcus Shawcroft <marcus.shawcroft@linaro.org> + + * io/Makefile (CFLAGS-open.c, CFLAGS-open64.c): Define. + * misc/Makefile (CFLAGS-select.c): Define. + * posix/Makefile (CFLAGS-pause.c): Define. + +2012-11-13 David S. Miller <davem@davemloft.net> + + * crypt/Makefile: Move test targets after toplevel Rules + inclusion. Grab any necessary sysdep routines when linking. + * crypt/md5.c (md5_process_block): Remove define, we will always + name it __md5_process_block. + (md5_finish_ctx): Update md5_process_block call. + (md5_stream): Likewise. + (md5_process_bytes): Likewise. + (md5_process_block): Rename to __md5_process_block and move to ... + * crypt/md5-block.c: ... here. + * crypt/sha256.c (sha256_process_block): Move to ... + * crypt/sha256-block.c: ... here. + * crypt/sha512.c (sha512_process_block): Move to ... + * crypt/sha512-block.c: ... here. + * locale/Makefile (CFLAGS-md5.c): Define to add crypt/ to include + path. + * sysdeps/sparc/sparc-ifunc.c (sparc_libc_ifunc): Define. + * sysdeps/sparc/sparc64/multiarch/Makefile + (libcrypt-sysdep_routines): Add crypto assembler sysdeps when in + crypt subdir. + (localedef-aux): Add md5 crypto assembler when in locale subdir. + * sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile: Mirror sparc64 + multiarch changes. + * sysdeps/sparc/sparc64/multiarch/md5-block.c: New file. + * sysdeps/sparc/sparc64/multiarch/md5-crop.S: New file. + * sysdeps/sparc/sparc64/multiarch/sha256-block.c: New file. + * sysdeps/sparc/sparc64/multiarch/sha256-crop.S: New file. + * sysdeps/sparc/sparc64/multiarch/sha512-block.c: New file. + * sysdeps/sparc/sparc64/multiarch/sha512-crop.S: New file. + * sysdeps/sparc/sparc32/sparcv9/multiarch/md5-block.c: New file. + * sysdeps/sparc/sparc32/sparcv9/multiarch/md5-crop.S: New file. + * sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-block.c: New + file. + * sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-crop.S: New file. + * sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-block.c: New + file. + * sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-crop.S: New file. + +2012-11-13 Joseph Myers <joseph@codesourcery.com> + + * timezone/tzselect.ksh: Update from tzcode git revision + a435f9f0ecafa56d9e0263835836bd0c64cd7307. + * timezone/zdump.c: Likewise. + * timezone/zic.c: Likewise. + * timezone/Makefile ($(objpfx)version.h): Only include $(version) + in TZVERSION setting, not $(PKGVERSION). + ($(objpfx)tzselect): Likewise. Also substitute PKGVERSION and + REPORT_BUGS_TO settings. + + [BZ #14838] + * resolv/netdb.h [__USE_XOPEN_EXTENDED] (IPPORT_RESERVED): Define + macro. + +2012-11-13 Marcus Shawcroft <marcus.shawcroft@linaro.org> + + * soft-fp/op-common.h (_FP_PACK_SEMIRAW): Move underflow + detection to immediately after _FP_ROUND(). + * soft-fp/soft-fp.h (_FP_ROUND): Don't round if working + bits are 0. + +2012-11-11 David S. Miller <davem@davemloft.net> + + * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c: Include + inttypes.h + (__get_clockfreq_via_proc_openprom): Use __open, __read, and + __close rather than their public counterparts. + +2012-11-10 Joseph Myers <joseph@codesourcery.com> + + * conform/data/semaphore.h-data [XPG3 || XPG4]: Disable whole + file. + [UNIX98] (sem_timedwait): Do not expect. + * conform/data/sys/socket.h-data [XPG3]: Disable whole file. + [XPG4 || UNIX98] (sockatmark): Do not expect. + * conform/data/time.h-data [XPG3 || XPG4 || UNIX98] + (clock_getcpuclockid): Do not expect. + [XPG3 || XPG4 || UNIX98] (clock_nanosleep): Do not expect. + * conform/data/unistd.h-data [XPG3 || XPG4 || UNIX98] (setegid): + Do not expect. + [XPG3 || XPG4 || UNIX98] (seteuid): Likewise. + * conform/data/wchar.h-data [UNIX98] (vfwscanf): Do not expect. + [UNIX98] (vwscanf): Likewise. + [UNIX98] (vswscanf): Likewise. + 2012-11-09 Joseph Myers <joseph@codesourcery.com> + * timezone/version.h: Remove file. + * timezone/README: Do not refer to version.h. + * timezone/Makefile ($(objpfx)zic.o): New dependency on + $(objpfx)version.h. + ($(objpfx)zdump.o): Likewise. + ($(objpfx)version.h): New target. + + * timezone/tzselect.ksh: Change to verbatim copy from tzcode + 2012i. + * timezone/README: Don't mention modification to tzselect.ksh. + * timezone/Makefile ($(objpfx)tzselect): Update substitutions to + work on unmodified tzselect.ksh. Substitute version numbers in + tzselect.ksh. + + * Makefile (format-me): Remove. + (INSTALL): Adjust indentation. Use commands directly instead of + using $(format-me). + * aclocal.m4 (ACX_PKGVERSION): New macro. (ACX_BUGURL): Likewise. * configure.in: Use ACX_PKGVERSION and ACX_BUGURL. diff --git a/libc/Makefile b/libc/Makefile index 19380d29f..b39ee4802 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -417,15 +417,11 @@ dist: dist-prepare fi endif -define format-me -@rm -f $@ -makeinfo --no-validate --plaintext --no-number-sections \ - -I$(common-objpfx)manual $< -o $@ --chmod a-w $@ -endef INSTALL: manual/install.texi manual/macros.texi \ - $(common-objpfx)manual/pkgvers.texi - $(format-me) + $(common-objpfx)manual/pkgvers.texi + makeinfo --no-validate --plaintext --no-number-sections \ + -I$(common-objpfx)manual $< -o $@ + -chmod a-w $@ $(common-objpfx)manual/%: FORCE $(MAKE) $(PARALLELMFLAGS) -C manual $@ FORCE: @@ -10,16 +10,19 @@ Version 2.17 * The following bugs are resolved with this release: 1349, 3439, 3479, 3665, 5044, 5246, 5298, 5400, 6530, 6778, 6808, 9685, - 9914, 10014, 10038, 10631, 10873, 11438, 11607, 11638, 12140, 13412, - 13542, 13601, 13629, 13679, 13696, 13717, 13741, 13939, 13966, 14042, - 14047, 14090, 14150, 14151, 14152, 14154, 14157, 14166, 14173, 14195, - 14237, 14251, 14252, 14283, 14298, 14303, 14307, 14328, 14331, 14336, - 14337, 14347, 14349, 14376, 14417, 14459, 14476, 14477, 14505, 14510, - 14516, 14518, 14519, 14530, 14532, 14538, 14543, 14544, 14545, 14557, - 14562, 14568, 14576, 14579, 14583, 14587, 14595, 14602, 14610, 14621, - 14638, 14645, 14648, 14652, 14660, 14661, 14669, 14683, 14694, 14716, - 14743, 14767, 14783, 14784, 14785, 14793, 14796, 14797, 14801, 14805, - 14807, 14809, 14811, 14815, 14821, 14824. + 9914, 10014, 10038, 10631, 10873, 11438, 11607, 11638, 11741, 12140, + 13412, 13542, 13601, 13603, 13604, 13629, 13679, 13696, 13698, 13717, + 13741, 13939, 13950, 13952, 13966, 14042, 14047, 14090, 14150, 14151, + 14152, 14154, 14157, 14166, 14173, 14195, 14237, 14251, 14252, 14283, + 14298, 14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14368, + 14376, 14417, 14459, 14476, 14477, 14501, 14505, 14510, 14516, 14518, + 14519, 14530, 14532, 14538, 14543, 14544, 14545, 14557, 14562, 14568, + 14576, 14579, 14583, 14587, 14595, 14602, 14610, 14621, 14638, 14645, + 14648, 14652, 14660, 14661, 14669, 14672, 14683, 14694, 14716, 14743, + 14767, 14783, 14784, 14785, 14793, 14796, 14797, 14801, 14805, 14807, + 14809, 14811, 14815, 14821, 14824, 14828, 14831, 14838. + +* Port to ARM AArch64 contributed by Linaro. * Support for STT_GNU_IFUNC symbols added for s390 and s390x. Optimized versions of memcpy, memset, and memcmp added for System z10 and diff --git a/libc/conform/data/semaphore.h-data b/libc/conform/data/semaphore.h-data index 9bb3d44d9..41595135d 100644 --- a/libc/conform/data/semaphore.h-data +++ b/libc/conform/data/semaphore.h-data @@ -1,4 +1,4 @@ -#if !defined ISO && !defined ISO99 && !defined ISO11 +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG3 && !defined XPG4 type sem_t constant SEM_FAILED @@ -9,7 +9,7 @@ function int sem_getvalue (sem_t*, int*) function int sem_init (sem_t*, int, unsigned int) function {sem_t*} sem_open (const char*, int, ...) function int sem_post (sem_t*) -# if !defined POSIX +# if !defined POSIX && !defined UNIX98 function int sem_timedwait (sem_t*, const struct timespec*) # endif function int sem_trywait (sem_t*) diff --git a/libc/conform/data/sys/socket.h-data b/libc/conform/data/sys/socket.h-data index 60d8b00a7..3a6cf7c67 100644 --- a/libc/conform/data/sys/socket.h-data +++ b/libc/conform/data/sys/socket.h-data @@ -1,4 +1,4 @@ -#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX +#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG3 type socklen_t type sa_family_t @@ -111,7 +111,9 @@ function int setsockopt (int, int, int, const void*, socklen_t) function int shutdown (int, int) function int socket (int, int, int) function int socketpair (int, int, int, int[2]) +#if !defined XPG4 && !defined UNIX98 function int sockatmark (int) +#endif allow-header sys/uio.h diff --git a/libc/conform/data/time.h-data b/libc/conform/data/time.h-data index 31d5e7dd5..9b346c39e 100644 --- a/libc/conform/data/time.h-data +++ b/libc/conform/data/time.h-data @@ -71,12 +71,12 @@ variable int getdate_err # endif function {char*} asctime_r (const struct tm*, char*) -#if !defined POSIX +#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98 function int clock_getcpuclockid (pid_t, clockid_t*) #endif function int clock_getres (clockid_t, struct timespec*) function int clock_gettime (clockid_t, struct timespec*) -#if !defined POSIX +#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98 function int clock_nanosleep (clockid_t, int, const struct timespec*, struct timespec*) #endif function int clock_settime (clockid_t, const struct timespec*) diff --git a/libc/conform/data/unistd.h-data b/libc/conform/data/unistd.h-data index d23a68ff8..18bea5ee2 100644 --- a/libc/conform/data/unistd.h-data +++ b/libc/conform/data/unistd.h-data @@ -472,7 +472,7 @@ function int rmdir (const char*) #if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX && !defined POSIX2008 function {void*} sbrk (intptr_t) #endif -#ifndef POSIX +#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98 function int setegid (gid_t) function int seteuid (uid_t) #endif diff --git a/libc/conform/data/wchar.h-data b/libc/conform/data/wchar.h-data index 805cbe6e1..c65ec404c 100644 --- a/libc/conform/data/wchar.h-data +++ b/libc/conform/data/wchar.h-data @@ -60,11 +60,17 @@ function wint_t towupper (wint_t) # endif function wint_t ungetwc (wint_t, FILE*) function int vfwprintf (FILE*, const wchar_t*, __gnuc_va_list) +# ifndef UNIX98 function int vfwscanf (FILE*, const wchar_t*, __gnuc_va_list) +# endif function int vwprintf (const wchar_t*, __gnuc_va_list) +# ifndef UNIX98 function int vwscanf (const wchar_t*, __gnuc_va_list) +# endif function int vswprintf (wchar_t*, size_t, const wchar_t*, __gnuc_va_list) +# ifndef UNIX98 function int vswscanf (const wchar_t*, const wchar_t*, __gnuc_va_list) +# endif # if defined XOPEN2K8 || defined POSIX2008 function {wchar_t*} wcpcpy (wchar_t*, const wchar_t*) function {wchar_t*} wcpncpy (wchar_t*, const wchar_t*, size_t) diff --git a/libc/crypt/Makefile b/libc/crypt/Makefile index d42e683e4..db1bad639 100644 --- a/libc/crypt/Makefile +++ b/libc/crypt/Makefile @@ -53,15 +53,21 @@ 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. xtests = md5test-giant - -$(objpfx)md5test: $(objpfx)md5.o -$(objpfx)md5test-giant: $(objpfx)md5.o -$(objpfx)sha256test: $(objpfx)sha256.o -$(objpfx)sha512test: $(objpfx)sha512.o endif include ../Rules +ifneq ($(nss-crypt),yes) +md5-routines := md5 $(filter md5%,$(libcrypt-sysdep_routines)) +sha256-routines := sha256 $(filter sha256%,$(libcrypt-sysdep_routines)) +sha512-routines := sha512 $(filter sha512%,$(libcrypt-sysdep_routines)) + +$(objpfx)md5test: $(patsubst %, $(objpfx)%.o,$(md5-routines)) +$(objpfx)md5test-giant: $(patsubst %, $(objpfx)%.o,$(md5-routines)) +$(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 diff --git a/libc/crypt/md5-block.c b/libc/crypt/md5-block.c new file mode 100644 index 000000000..35e99adde --- /dev/null +++ b/libc/crypt/md5-block.c @@ -0,0 +1,166 @@ +/* These are the four functions used in the four steps of the MD5 algorithm + and defined in the RFC 1321. The first function is a little bit optimized + (as found in Colin Plumbs public domain implementation). */ +/* #define FF(b, c, d) ((b & c) | (~b & d)) */ +#define FF(b, c, d) (d ^ (b & (c ^ d))) +#define FG(b, c, d) FF (d, b, c) +#define FH(b, c, d) (b ^ c ^ d) +#define FI(b, c, d) (c ^ (b | ~d)) + +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 64 == 0. */ + +void +__md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) +{ + md5_uint32 correct_words[16]; + const md5_uint32 *words = buffer; + size_t nwords = len / sizeof (md5_uint32); + const md5_uint32 *endp = words + nwords; + md5_uint32 A = ctx->A; + md5_uint32 B = ctx->B; + md5_uint32 C = ctx->C; + md5_uint32 D = ctx->D; + md5_uint32 lolen = len; + + /* First increment the byte count. RFC 1321 specifies the possible + length of the file up to 2^64 bits. Here we only compute the + number of bytes. Do a double word increment. */ + ctx->total[0] += lolen; + ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen); + + /* Process all bytes in the buffer with 64 bytes in each round of + the loop. */ + while (words < endp) + { + md5_uint32 *cwp = correct_words; + md5_uint32 A_save = A; + md5_uint32 B_save = B; + md5_uint32 C_save = C; + md5_uint32 D_save = D; + + /* First round: using the given function, the context and a constant + the next context is computed. Because the algorithms processing + unit is a 32-bit word and it is determined to work on words in + little endian byte order we perhaps have to change the byte order + before the computation. To reduce the work for the next steps + we store the swapped words in the array CORRECT_WORDS. */ + +#define OP(a, b, c, d, s, T) \ + do \ + { \ + a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ + ++words; \ + CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + + /* It is unfortunate that C does not provide an operator for + cyclic rotation. Hope the C compiler is smart enough. */ +#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) + + /* Before we start, one word to the strange constants. + They are defined in RFC 1321 as + + T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 + */ + + /* Round 1. */ + OP (A, B, C, D, 7, 0xd76aa478); + OP (D, A, B, C, 12, 0xe8c7b756); + OP (C, D, A, B, 17, 0x242070db); + OP (B, C, D, A, 22, 0xc1bdceee); + OP (A, B, C, D, 7, 0xf57c0faf); + OP (D, A, B, C, 12, 0x4787c62a); + OP (C, D, A, B, 17, 0xa8304613); + OP (B, C, D, A, 22, 0xfd469501); + OP (A, B, C, D, 7, 0x698098d8); + OP (D, A, B, C, 12, 0x8b44f7af); + OP (C, D, A, B, 17, 0xffff5bb1); + OP (B, C, D, A, 22, 0x895cd7be); + OP (A, B, C, D, 7, 0x6b901122); + OP (D, A, B, C, 12, 0xfd987193); + OP (C, D, A, B, 17, 0xa679438e); + OP (B, C, D, A, 22, 0x49b40821); + + /* For the second to fourth round we have the possibly swapped words + in CORRECT_WORDS. Redefine the macro to take an additional first + argument specifying the function to use. */ +#undef OP +#define OP(f, a, b, c, d, k, s, T) \ + do \ + { \ + a += f (b, c, d) + correct_words[k] + T; \ + CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + + /* Round 2. */ + OP (FG, A, B, C, D, 1, 5, 0xf61e2562); + OP (FG, D, A, B, C, 6, 9, 0xc040b340); + OP (FG, C, D, A, B, 11, 14, 0x265e5a51); + OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); + OP (FG, A, B, C, D, 5, 5, 0xd62f105d); + OP (FG, D, A, B, C, 10, 9, 0x02441453); + OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); + OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); + OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); + OP (FG, D, A, B, C, 14, 9, 0xc33707d6); + OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); + OP (FG, B, C, D, A, 8, 20, 0x455a14ed); + OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); + OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); + OP (FG, C, D, A, B, 7, 14, 0x676f02d9); + OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); + + /* Round 3. */ + OP (FH, A, B, C, D, 5, 4, 0xfffa3942); + OP (FH, D, A, B, C, 8, 11, 0x8771f681); + OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); + OP (FH, B, C, D, A, 14, 23, 0xfde5380c); + OP (FH, A, B, C, D, 1, 4, 0xa4beea44); + OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); + OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); + OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); + OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); + OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); + OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); + OP (FH, B, C, D, A, 6, 23, 0x04881d05); + OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); + OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); + OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); + OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); + + /* Round 4. */ + OP (FI, A, B, C, D, 0, 6, 0xf4292244); + OP (FI, D, A, B, C, 7, 10, 0x432aff97); + OP (FI, C, D, A, B, 14, 15, 0xab9423a7); + OP (FI, B, C, D, A, 5, 21, 0xfc93a039); + OP (FI, A, B, C, D, 12, 6, 0x655b59c3); + OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); + OP (FI, C, D, A, B, 10, 15, 0xffeff47d); + OP (FI, B, C, D, A, 1, 21, 0x85845dd1); + OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); + OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); + OP (FI, C, D, A, B, 6, 15, 0xa3014314); + OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); + OP (FI, A, B, C, D, 4, 6, 0xf7537e82); + OP (FI, D, A, B, C, 11, 10, 0xbd3af235); + OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); + OP (FI, B, C, D, A, 9, 21, 0xeb86d391); + + /* Add the starting values of the context. */ + A += A_save; + B += B_save; + C += C_save; + D += D_save; + } + + /* Put checksum in context given as argument. */ + ctx->A = A; + ctx->B = B; + ctx->C = C; + ctx->D = D; +} diff --git a/libc/crypt/md5.c b/libc/crypt/md5.c index 3d2e79b90..16f3cda79 100644 --- a/libc/crypt/md5.c +++ b/libc/crypt/md5.c @@ -44,7 +44,6 @@ /* We need to keep the namespace clean so define the MD5 function protected using leading __ . */ # define md5_init_ctx __md5_init_ctx -# define md5_process_block __md5_process_block # define md5_process_bytes __md5_process_bytes # define md5_finish_ctx __md5_finish_ctx # define md5_read_ctx __md5_read_ctx @@ -126,7 +125,7 @@ md5_finish_ctx (ctx, resbuf) (ctx->total[0] >> 29)); /* Process last bytes. */ - md5_process_block (ctx->buffer, bytes + pad + 8, ctx); + __md5_process_block (ctx->buffer, bytes + pad + 8, ctx); return md5_read_ctx (ctx, resbuf); } @@ -175,7 +174,7 @@ md5_stream (stream, resblock) /* Process buffer with BLOCKSIZE bytes. Note that BLOCKSIZE % 64 == 0 */ - md5_process_block (buffer, BLOCKSIZE, &ctx); + __md5_process_block (buffer, BLOCKSIZE, &ctx); } /* Add the last bytes if necessary. */ @@ -228,7 +227,7 @@ md5_process_bytes (buffer, len, ctx) if (ctx->buflen > 64) { - md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx); + __md5_process_block (ctx->buffer, ctx->buflen & ~63, ctx); ctx->buflen &= 63; /* The regions in the following copy operation cannot overlap. */ @@ -254,14 +253,14 @@ md5_process_bytes (buffer, len, ctx) if (UNALIGNED_P (buffer)) while (len > 64) { - md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); + __md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); buffer = (const char *) buffer + 64; len -= 64; } else #endif { - md5_process_block (buffer, len & ~63, ctx); + __md5_process_block (buffer, len & ~63, ctx); buffer = (const char *) buffer + (len & ~63); len &= 63; } @@ -276,7 +275,7 @@ md5_process_bytes (buffer, len, ctx) left_over += len; if (left_over >= 64) { - md5_process_block (ctx->buffer, 64, ctx); + __md5_process_block (ctx->buffer, 64, ctx); left_over -= 64; memcpy (ctx->buffer, &ctx->buffer[64], left_over); } @@ -284,173 +283,4 @@ md5_process_bytes (buffer, len, ctx) } } - -/* These are the four functions used in the four steps of the MD5 algorithm - and defined in the RFC 1321. The first function is a little bit optimized - (as found in Colin Plumbs public domain implementation). */ -/* #define FF(b, c, d) ((b & c) | (~b & d)) */ -#define FF(b, c, d) (d ^ (b & (c ^ d))) -#define FG(b, c, d) FF (d, b, c) -#define FH(b, c, d) (b ^ c ^ d) -#define FI(b, c, d) (c ^ (b | ~d)) - -/* Process LEN bytes of BUFFER, accumulating context into CTX. - It is assumed that LEN % 64 == 0. */ - -void -md5_process_block (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; -{ - md5_uint32 correct_words[16]; - const md5_uint32 *words = buffer; - size_t nwords = len / sizeof (md5_uint32); - const md5_uint32 *endp = words + nwords; - md5_uint32 A = ctx->A; - md5_uint32 B = ctx->B; - md5_uint32 C = ctx->C; - md5_uint32 D = ctx->D; - md5_uint32 lolen = len; - - /* First increment the byte count. RFC 1321 specifies the possible - length of the file up to 2^64 bits. Here we only compute the - number of bytes. Do a double word increment. */ - ctx->total[0] += lolen; - ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen); - - /* Process all bytes in the buffer with 64 bytes in each round of - the loop. */ - while (words < endp) - { - md5_uint32 *cwp = correct_words; - md5_uint32 A_save = A; - md5_uint32 B_save = B; - md5_uint32 C_save = C; - md5_uint32 D_save = D; - - /* First round: using the given function, the context and a constant - the next context is computed. Because the algorithms processing - unit is a 32-bit word and it is determined to work on words in - little endian byte order we perhaps have to change the byte order - before the computation. To reduce the work for the next steps - we store the swapped words in the array CORRECT_WORDS. */ - -#define OP(a, b, c, d, s, T) \ - do \ - { \ - a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ - ++words; \ - CYCLIC (a, s); \ - a += b; \ - } \ - while (0) - - /* It is unfortunate that C does not provide an operator for - cyclic rotation. Hope the C compiler is smart enough. */ -#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) - - /* Before we start, one word to the strange constants. - They are defined in RFC 1321 as - - T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 - */ - - /* Round 1. */ - OP (A, B, C, D, 7, 0xd76aa478); - OP (D, A, B, C, 12, 0xe8c7b756); - OP (C, D, A, B, 17, 0x242070db); - OP (B, C, D, A, 22, 0xc1bdceee); - OP (A, B, C, D, 7, 0xf57c0faf); - OP (D, A, B, C, 12, 0x4787c62a); - OP (C, D, A, B, 17, 0xa8304613); - OP (B, C, D, A, 22, 0xfd469501); - OP (A, B, C, D, 7, 0x698098d8); - OP (D, A, B, C, 12, 0x8b44f7af); - OP (C, D, A, B, 17, 0xffff5bb1); - OP (B, C, D, A, 22, 0x895cd7be); - OP (A, B, C, D, 7, 0x6b901122); - OP (D, A, B, C, 12, 0xfd987193); - OP (C, D, A, B, 17, 0xa679438e); - OP (B, C, D, A, 22, 0x49b40821); - - /* For the second to fourth round we have the possibly swapped words - in CORRECT_WORDS. Redefine the macro to take an additional first - argument specifying the function to use. */ -#undef OP -#define OP(f, a, b, c, d, k, s, T) \ - do \ - { \ - a += f (b, c, d) + correct_words[k] + T; \ - CYCLIC (a, s); \ - a += b; \ - } \ - while (0) - - /* Round 2. */ - OP (FG, A, B, C, D, 1, 5, 0xf61e2562); - OP (FG, D, A, B, C, 6, 9, 0xc040b340); - OP (FG, C, D, A, B, 11, 14, 0x265e5a51); - OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); - OP (FG, A, B, C, D, 5, 5, 0xd62f105d); - OP (FG, D, A, B, C, 10, 9, 0x02441453); - OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); - OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); - OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); - OP (FG, D, A, B, C, 14, 9, 0xc33707d6); - OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); - OP (FG, B, C, D, A, 8, 20, 0x455a14ed); - OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); - OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); - OP (FG, C, D, A, B, 7, 14, 0x676f02d9); - OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); - - /* Round 3. */ - OP (FH, A, B, C, D, 5, 4, 0xfffa3942); - OP (FH, D, A, B, C, 8, 11, 0x8771f681); - OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); - OP (FH, B, C, D, A, 14, 23, 0xfde5380c); - OP (FH, A, B, C, D, 1, 4, 0xa4beea44); - OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); - OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); - OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); - OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); - OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); - OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); - OP (FH, B, C, D, A, 6, 23, 0x04881d05); - OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); - OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); - OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); - OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); - - /* Round 4. */ - OP (FI, A, B, C, D, 0, 6, 0xf4292244); - OP (FI, D, A, B, C, 7, 10, 0x432aff97); - OP (FI, C, D, A, B, 14, 15, 0xab9423a7); - OP (FI, B, C, D, A, 5, 21, 0xfc93a039); - OP (FI, A, B, C, D, 12, 6, 0x655b59c3); - OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); - OP (FI, C, D, A, B, 10, 15, 0xffeff47d); - OP (FI, B, C, D, A, 1, 21, 0x85845dd1); - OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); - OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); - OP (FI, C, D, A, B, 6, 15, 0xa3014314); - OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); - OP (FI, A, B, C, D, 4, 6, 0xf7537e82); - OP (FI, D, A, B, C, 11, 10, 0xbd3af235); - OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); - OP (FI, B, C, D, A, 9, 21, 0xeb86d391); - - /* Add the starting values of the context. */ - A += A_save; - B += B_save; - C += C_save; - D += D_save; - } - - /* Put checksum in context given as argument. */ - ctx->A = A; - ctx->B = B; - ctx->C = C; - ctx->D = D; -} +#include <md5-block.c> diff --git a/libc/crypt/sha256-block.c b/libc/crypt/sha256-block.c new file mode 100644 index 000000000..a163e2586 --- /dev/null +++ b/libc/crypt/sha256-block.c @@ -0,0 +1,96 @@ +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 64 == 0. */ +void +sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) +{ + const uint32_t *words = buffer; + size_t nwords = len / sizeof (uint32_t); + uint32_t a = ctx->H[0]; + uint32_t b = ctx->H[1]; + uint32_t c = ctx->H[2]; + uint32_t d = ctx->H[3]; + uint32_t e = ctx->H[4]; + uint32_t f = ctx->H[5]; + uint32_t g = ctx->H[6]; + uint32_t h = ctx->H[7]; + + /* First increment the byte count. FIPS 180-2 specifies the possible + length of the file up to 2^64 bits. Here we only compute the + number of bytes. */ + ctx->total64 += len; + + /* Process all bytes in the buffer with 64 bytes in each round of + the loop. */ + while (nwords > 0) + { + uint32_t W[64]; + uint32_t a_save = a; + uint32_t b_save = b; + uint32_t c_save = c; + uint32_t d_save = d; + uint32_t e_save = e; + uint32_t f_save = f; + uint32_t g_save = g; + uint32_t h_save = h; + + /* Operators defined in FIPS 180-2:4.1.2. */ +#define Ch(x, y, z) ((x & y) ^ (~x & z)) +#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) +#define S0(x) (CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22)) +#define S1(x) (CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25)) +#define R0(x) (CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3)) +#define R1(x) (CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10)) + + /* It is unfortunate that C does not provide an operator for + cyclic rotation. Hope the C compiler is smart enough. */ +#define CYCLIC(w, s) ((w >> s) | (w << (32 - s))) + + /* Compute the message schedule according to FIPS 180-2:6.2.2 step 2. */ + for (unsigned int t = 0; t < 16; ++t) + { + W[t] = SWAP (*words); + ++words; + } + for (unsigned int t = 16; t < 64; ++t) + W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16]; + + /* The actual computation according to FIPS 180-2:6.2.2 step 3. */ + for (unsigned int t = 0; t < 64; ++t) + { + uint32_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t]; + uint32_t T2 = S0 (a) + Maj (a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + } + + /* Add the starting values of the context according to FIPS 180-2:6.2.2 + step 4. */ + a += a_save; + b += b_save; + c += c_save; + d += d_save; + e += e_save; + f += f_save; + g += g_save; + h += h_save; + + /* Prepare for the next round. */ + nwords -= 16; + } + + /* Put checksum in context given as argument. */ + ctx->H[0] = a; + ctx->H[1] = b; + ctx->H[2] = c; + ctx->H[3] = d; + ctx->H[4] = e; + ctx->H[5] = f; + ctx->H[6] = g; + ctx->H[7] = h; +} diff --git a/libc/crypt/sha256.c b/libc/crypt/sha256.c index 61be6bce2..aea946513 100644 --- a/libc/crypt/sha256.c +++ b/libc/crypt/sha256.c @@ -80,104 +80,8 @@ static const uint32_t K[64] = 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; - -/* Process LEN bytes of BUFFER, accumulating context into CTX. - It is assumed that LEN % 64 == 0. */ -static void -sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) -{ - const uint32_t *words = buffer; - size_t nwords = len / sizeof (uint32_t); - uint32_t a = ctx->H[0]; - uint32_t b = ctx->H[1]; - uint32_t c = ctx->H[2]; - uint32_t d = ctx->H[3]; - uint32_t e = ctx->H[4]; - uint32_t f = ctx->H[5]; - uint32_t g = ctx->H[6]; - uint32_t h = ctx->H[7]; - - /* First increment the byte count. FIPS 180-2 specifies the possible - length of the file up to 2^64 bits. Here we only compute the - number of bytes. */ - ctx->total64 += len; - - /* Process all bytes in the buffer with 64 bytes in each round of - the loop. */ - while (nwords > 0) - { - uint32_t W[64]; - uint32_t a_save = a; - uint32_t b_save = b; - uint32_t c_save = c; - uint32_t d_save = d; - uint32_t e_save = e; - uint32_t f_save = f; - uint32_t g_save = g; - uint32_t h_save = h; - - /* Operators defined in FIPS 180-2:4.1.2. */ -#define Ch(x, y, z) ((x & y) ^ (~x & z)) -#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) -#define S0(x) (CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22)) -#define S1(x) (CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25)) -#define R0(x) (CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3)) -#define R1(x) (CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10)) - - /* It is unfortunate that C does not provide an operator for - cyclic rotation. Hope the C compiler is smart enough. */ -#define CYCLIC(w, s) ((w >> s) | (w << (32 - s))) - - /* Compute the message schedule according to FIPS 180-2:6.2.2 step 2. */ - for (unsigned int t = 0; t < 16; ++t) - { - W[t] = SWAP (*words); - ++words; - } - for (unsigned int t = 16; t < 64; ++t) - W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16]; - - /* The actual computation according to FIPS 180-2:6.2.2 step 3. */ - for (unsigned int t = 0; t < 64; ++t) - { - uint32_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t]; - uint32_t T2 = S0 (a) + Maj (a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - } - - /* Add the starting values of the context according to FIPS 180-2:6.2.2 - step 4. */ - a += a_save; - b += b_save; - c += c_save; - d += d_save; - e += e_save; - f += f_save; - g += g_save; - h += h_save; - - /* Prepare for the next round. */ - nwords -= 16; - } - - /* Put checksum in context given as argument. */ - ctx->H[0] = a; - ctx->H[1] = b; - ctx->H[2] = c; - ctx->H[3] = d; - ctx->H[4] = e; - ctx->H[5] = f; - ctx->H[6] = g; - ctx->H[7] = h; -} - +void +sha256_process_block (const void *, size_t, struct sha256_ctx *); /* Initialize structure containing state of computation. (FIPS 180-2:5.3.2) */ @@ -312,3 +216,5 @@ __sha256_process_bytes (buffer, len, ctx) ctx->buflen = left_over; } } + +#include <sha256-block.c> diff --git a/libc/crypt/sha512-block.c b/libc/crypt/sha512-block.c new file mode 100644 index 000000000..e7c5cfd7f --- /dev/null +++ b/libc/crypt/sha512-block.c @@ -0,0 +1,103 @@ +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 128 == 0. */ +void +sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx) +{ + const uint64_t *words = buffer; + size_t nwords = len / sizeof (uint64_t); + uint64_t a = ctx->H[0]; + uint64_t b = ctx->H[1]; + uint64_t c = ctx->H[2]; + uint64_t d = ctx->H[3]; + uint64_t e = ctx->H[4]; + uint64_t f = ctx->H[5]; + uint64_t g = ctx->H[6]; + uint64_t h = ctx->H[7]; + + /* First increment the byte count. FIPS 180-2 specifies the possible + length of the file up to 2^128 bits. Here we only compute the + number of bytes. Do a double word increment. */ +#ifdef USE_TOTAL128 + ctx->total128 += len; +#else + uint64_t lolen = len; + ctx->total[TOTAL128_low] += lolen; + ctx->total[TOTAL128_high] += ((len >> 31 >> 31 >> 2) + + (ctx->total[TOTAL128_low] < lolen)); +#endif + + /* Process all bytes in the buffer with 128 bytes in each round of + the loop. */ + while (nwords > 0) + { + uint64_t W[80]; + uint64_t a_save = a; + uint64_t b_save = b; + uint64_t c_save = c; + uint64_t d_save = d; + uint64_t e_save = e; + uint64_t f_save = f; + uint64_t g_save = g; + uint64_t h_save = h; + + /* Operators defined in FIPS 180-2:4.1.2. */ +#define Ch(x, y, z) ((x & y) ^ (~x & z)) +#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) +#define S0(x) (CYCLIC (x, 28) ^ CYCLIC (x, 34) ^ CYCLIC (x, 39)) +#define S1(x) (CYCLIC (x, 14) ^ CYCLIC (x, 18) ^ CYCLIC (x, 41)) +#define R0(x) (CYCLIC (x, 1) ^ CYCLIC (x, 8) ^ (x >> 7)) +#define R1(x) (CYCLIC (x, 19) ^ CYCLIC (x, 61) ^ (x >> 6)) + + /* It is unfortunate that C does not provide an operator for + cyclic rotation. Hope the C compiler is smart enough. */ +#define CYCLIC(w, s) ((w >> s) | (w << (64 - s))) + + /* Compute the message schedule according to FIPS 180-2:6.3.2 step 2. */ + for (unsigned int t = 0; t < 16; ++t) + { + W[t] = SWAP (*words); + ++words; + } + for (unsigned int t = 16; t < 80; ++t) + W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16]; + + /* The actual computation according to FIPS 180-2:6.3.2 step 3. */ + for (unsigned int t = 0; t < 80; ++t) + { + uint64_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t]; + uint64_t T2 = S0 (a) + Maj (a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + } + + /* Add the starting values of the context according to FIPS 180-2:6.3.2 + step 4. */ + a += a_save; + b += b_save; + c += c_save; + d += d_save; + e += e_save; + f += f_save; + g += g_save; + h += h_save; + + /* Prepare for the next round. */ + nwords -= 16; + } + + /* Put checksum in context given as argument. */ + ctx->H[0] = a; + ctx->H[1] = b; + ctx->H[2] = c; + ctx->H[3] = d; + ctx->H[4] = e; + ctx->H[5] = f; + ctx->H[6] = g; + ctx->H[7] = h; +} diff --git a/libc/crypt/sha512.c b/libc/crypt/sha512.c index 0675c948c..c0df12e6f 100644 --- a/libc/crypt/sha512.c +++ b/libc/crypt/sha512.c @@ -100,111 +100,8 @@ static const uint64_t K[80] = UINT64_C (0x5fcb6fab3ad6faec), UINT64_C (0x6c44198c4a475817) }; - -/* Process LEN bytes of BUFFER, accumulating context into CTX. - It is assumed that LEN % 128 == 0. */ -static void -sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx) -{ - const uint64_t *words = buffer; - size_t nwords = len / sizeof (uint64_t); - uint64_t a = ctx->H[0]; - uint64_t b = ctx->H[1]; - uint64_t c = ctx->H[2]; - uint64_t d = ctx->H[3]; - uint64_t e = ctx->H[4]; - uint64_t f = ctx->H[5]; - uint64_t g = ctx->H[6]; - uint64_t h = ctx->H[7]; - - /* First increment the byte count. FIPS 180-2 specifies the possible - length of the file up to 2^128 bits. Here we only compute the - number of bytes. Do a double word increment. */ -#ifdef USE_TOTAL128 - ctx->total128 += len; -#else - uint64_t lolen = len; - ctx->total[TOTAL128_low] += lolen; - ctx->total[TOTAL128_high] += ((len >> 31 >> 31 >> 2) - + (ctx->total[TOTAL128_low] < lolen)); -#endif - - /* Process all bytes in the buffer with 128 bytes in each round of - the loop. */ - while (nwords > 0) - { - uint64_t W[80]; - uint64_t a_save = a; - uint64_t b_save = b; - uint64_t c_save = c; - uint64_t d_save = d; - uint64_t e_save = e; - uint64_t f_save = f; - uint64_t g_save = g; - uint64_t h_save = h; - - /* Operators defined in FIPS 180-2:4.1.2. */ -#define Ch(x, y, z) ((x & y) ^ (~x & z)) -#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) -#define S0(x) (CYCLIC (x, 28) ^ CYCLIC (x, 34) ^ CYCLIC (x, 39)) -#define S1(x) (CYCLIC (x, 14) ^ CYCLIC (x, 18) ^ CYCLIC (x, 41)) -#define R0(x) (CYCLIC (x, 1) ^ CYCLIC (x, 8) ^ (x >> 7)) -#define R1(x) (CYCLIC (x, 19) ^ CYCLIC (x, 61) ^ (x >> 6)) - - /* It is unfortunate that C does not provide an operator for - cyclic rotation. Hope the C compiler is smart enough. */ -#define CYCLIC(w, s) ((w >> s) | (w << (64 - s))) - - /* Compute the message schedule according to FIPS 180-2:6.3.2 step 2. */ - for (unsigned int t = 0; t < 16; ++t) - { - W[t] = SWAP (*words); - ++words; - } - for (unsigned int t = 16; t < 80; ++t) - W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16]; - - /* The actual computation according to FIPS 180-2:6.3.2 step 3. */ - for (unsigned int t = 0; t < 80; ++t) - { - uint64_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t]; - uint64_t T2 = S0 (a) + Maj (a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - } - - /* Add the starting values of the context according to FIPS 180-2:6.3.2 - step 4. */ - a += a_save; - b += b_save; - c += c_save; - d += d_save; - e += e_save; - f += f_save; - g += g_save; - h += h_save; - - /* Prepare for the next round. */ - nwords -= 16; - } - - /* Put checksum in context given as argument. */ - ctx->H[0] = a; - ctx->H[1] = b; - ctx->H[2] = c; - ctx->H[3] = d; - ctx->H[4] = e; - ctx->H[5] = f; - ctx->H[6] = g; - ctx->H[7] = h; -} - +void +sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx); /* Initialize structure containing state of computation. (FIPS 180-2:5.3.3) */ @@ -342,3 +239,5 @@ __sha512_process_bytes (buffer, len, ctx) ctx->buflen = left_over; } } + +#include <sha512-block.c> diff --git a/libc/debug/pcprofiledump.c b/libc/debug/pcprofiledump.c index fd5ab519d..9a479142f 100644 --- a/libc/debug/pcprofiledump.c +++ b/libc/debug/pcprofiledump.c @@ -225,6 +225,6 @@ print_version (FILE *stream, struct argp_state *state) Copyright (C) %s Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2009"); +"), "2012"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } diff --git a/libc/elf/Makefile b/libc/elf/Makefile index 5155d0910..be9456bf7 100644 --- a/libc/elf/Makefile +++ b/libc/elf/Makefile @@ -142,7 +142,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ tst-dlmodcount tst-dlopenrpath tst-deep1 \ tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \ unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \ - tst-audit1 tst-audit2 \ + tst-audit1 tst-audit2 tst-audit8 \ tst-stackguard1 tst-addr1 tst-thrlock \ tst-unique1 tst-unique2 tst-unique3 tst-unique4 \ tst-initorder tst-initorder2 tst-relsort1 @@ -1020,6 +1020,10 @@ $(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so $(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so +$(objpfx)tst-audit8: $(common-objpfx)math/libm.so +$(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so +tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so + $(objpfx)tst-global1: $(libdl) $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so diff --git a/libc/elf/dl-runtime.c b/libc/elf/dl-runtime.c index 2e02a218e..19543aa44 100644 --- a/libc/elf/dl-runtime.c +++ b/libc/elf/dl-runtime.c @@ -1,5 +1,5 @@ /* On-demand PLT fixup for shared objects. - Copyright (C) 1995-2009, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 1995-2012 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 @@ -56,7 +56,6 @@ to that address. Future calls will bounce directly from the PLT to the function. */ -#ifndef ELF_MACHINE_NO_PLT DL_FIXUP_VALUE_TYPE __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE _dl_fixup ( @@ -150,9 +149,8 @@ _dl_fixup ( return elf_machine_fixup_plt (l, result, reloc, rel_addr, value); } -#endif -#if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__ +#if !defined PROF && !__BOUNDED_POINTERS__ DL_FIXUP_VALUE_TYPE __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE _dl_profile_fixup ( @@ -164,6 +162,26 @@ _dl_profile_fixup ( { void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = INTUSE(_dl_mcount); + if (l->l_reloc_result == NULL) + { + /* BZ #14843: ELF_DYNAMIC_RELOCATE is called before l_reloc_result + is allocated. We will get here if ELF_DYNAMIC_RELOCATE calls a + resolver function to resolve an IRELATIVE relocation and that + resolver calls a function that is not yet resolved (lazy). For + example, the resolver in x86-64 libm.so calls __get_cpu_features + defined in libc.so. Skip audit and resolve the external function + in this case. */ + *framesizep = -1; + return _dl_fixup ( +# ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS +# ifndef ELF_MACHINE_RUNTIME_FIXUP_PARAMS +# error Please define ELF_MACHINE_RUNTIME_FIXUP_PARAMS. +# endif + ELF_MACHINE_RUNTIME_FIXUP_PARAMS, +# endif + l, reloc_arg); + } + /* This is the address in the array where we store the result of previous relocations. */ struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index]; @@ -417,7 +435,7 @@ _dl_profile_fixup ( return value; } -#endif /* PROF && ELF_MACHINE_NO_PLT */ +#endif /* PROF */ #include <stdio.h> diff --git a/libc/elf/tst-array1.c b/libc/elf/tst-array1.c index ca9bdf407..e998932b3 100644 --- a/libc/elf/tst-array1.c +++ b/libc/elf/tst-array1.c @@ -1,6 +1,7 @@ #include <unistd.h> -static void init (void) __attribute__ ((constructor)); +/* Give init non-default priority so that it runs before init_array. */ +static void init (void) __attribute__ ((constructor (1000))); static void init (void) @@ -8,7 +9,8 @@ init (void) write (STDOUT_FILENO, "init\n", 5); } -static void fini (void) __attribute__ ((destructor)); +/* Give fini the same priority as init. */ +static void fini (void) __attribute__ ((destructor (1000))); static void fini (void) diff --git a/libc/elf/tst-array2dep.c b/libc/elf/tst-array2dep.c index 2812761a0..2f920cdc8 100644 --- a/libc/elf/tst-array2dep.c +++ b/libc/elf/tst-array2dep.c @@ -1,6 +1,7 @@ #include <unistd.h> -static void init (void) __attribute__ ((constructor)); +/* Give init non-default priority so that it runs before init_array. */ +static void init (void) __attribute__ ((constructor (1000))); static void init (void) @@ -8,7 +9,8 @@ init (void) write (STDOUT_FILENO, "DSO init\n", 9); } -static void fini (void) __attribute__ ((destructor)); +/* Give fini the same priority as init. */ +static void fini (void) __attribute__ ((destructor (1000))); static void fini (void) diff --git a/libc/elf/tst-audit8.c b/libc/elf/tst-audit8.c new file mode 100644 index 000000000..63656b4ee --- /dev/null +++ b/libc/elf/tst-audit8.c @@ -0,0 +1 @@ +#include "../io/pwd.c" diff --git a/libc/iconv/iconv_prog.c b/libc/iconv/iconv_prog.c index db917c5a3..b99d35367 100644 --- a/libc/iconv/iconv_prog.c +++ b/libc/iconv/iconv_prog.c @@ -1,5 +1,5 @@ /* Convert text in given files from the specified from-set to the to-set. - Copyright (C) 1998-2011, 2012 Free Software Foundation, Inc. + Copyright (C) 1998-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -156,7 +156,7 @@ main (int argc, char *argv[]) if (*errhand == '/') { --nslash; - errhand = strchrnul (errhand, '/'); + errhand = strchrnul (errhand + 1, '/'); if (*errhand == '/') { diff --git a/libc/io/Makefile b/libc/io/Makefile index b43ae9f5c..afc4c69c2 100644 --- a/libc/io/Makefile +++ b/libc/io/Makefile @@ -79,6 +79,8 @@ tests-$(OPTION_EGLIBC_FTRAVERSE) += bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 \ include ../Rules +CFLAGS-open.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-open64.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-fcntl.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-poll.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-ppoll.c = -fexceptions -fasynchronous-unwind-tables diff --git a/libc/libio/fileops.c b/libc/libio/fileops.c index 3bc95a336..dd8b4c170 100644 --- a/libc/libio/fileops.c +++ b/libc/libio/fileops.c @@ -1261,12 +1261,13 @@ _IO_new_file_write (f, data, n) _IO_ssize_t n; { _IO_ssize_t to_do = n; + _IO_ssize_t count = 0; while (to_do > 0) { - _IO_ssize_t count = (__builtin_expect (f->_flags2 - & _IO_FLAGS2_NOTCANCEL, 0) - ? write_not_cancel (f->_fileno, data, to_do) - : write (f->_fileno, data, to_do)); + count = (__builtin_expect (f->_flags2 + & _IO_FLAGS2_NOTCANCEL, 0) + ? write_not_cancel (f->_fileno, data, to_do) + : write (f->_fileno, data, to_do)); if (count < 0) { f->_flags |= _IO_ERR_SEEN; @@ -1278,7 +1279,7 @@ _IO_new_file_write (f, data, n) n -= to_do; if (f->_offset >= 0) f->_offset += n; - return n; + return count < 0 ? count : n; } _IO_size_t @@ -1338,9 +1339,10 @@ _IO_new_file_xsputn (f, data, n) _IO_size_t block_size, do_write; /* Next flush the (full) buffer. */ if (_IO_OVERFLOW (f, EOF) == EOF) - /* If nothing else has to be written we must not signal the - caller that everything has been written. */ - return to_do == 0 ? EOF : n - to_do; + /* If nothing else has to be written or nothing has been written, we + must not signal the caller that the call was even partially + successful. */ + return (to_do == 0 || to_do == n) ? EOF : n - to_do; /* Try to maintain alignment: write a whole number of blocks. dont_write is what gets left over. */ diff --git a/libc/libio/iopadn.c b/libc/libio/iopadn.c index 7e374508f..b7a4c5a73 100644 --- a/libc/libio/iopadn.c +++ b/libc/libio/iopadn.c @@ -59,7 +59,7 @@ _IO_padn (fp, pad, count) w = _IO_sputn (fp, padptr, PADSIZE); written += w; if (w != PADSIZE) - return written; + return w == EOF ? w : written; } if (i > 0) diff --git a/libc/libio/iowpadn.c b/libc/libio/iowpadn.c index 05632d5bf..56e4b8ccb 100644 --- a/libc/libio/iowpadn.c +++ b/libc/libio/iowpadn.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 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 @@ -65,7 +65,7 @@ _IO_wpadn (fp, pad, count) w = _IO_sputn (fp, (char *) padptr, PADSIZE); written += w; if (w != PADSIZE) - return written; + return w == EOF ? w : written; } if (i > 0) diff --git a/libc/libio/libioP.h b/libc/libio/libioP.h index 9bbf2a741..e9fe02f5d 100644 --- a/libc/libio/libioP.h +++ b/libc/libio/libioP.h @@ -1,5 +1,4 @@ -/* Copyright (C) 1993, 1997-2003,2004,2005,2006,2007,2012 - Free Software Foundation, Inc. +/* Copyright (C) 1993-2012 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 @@ -25,6 +24,14 @@ This exception applies to code released by its copyright holders in files containing the exception. */ +/* NOTE: libio is now exclusively used only by glibc since libstdc++ has its + own implementation. As a result, functions that were implemented for C++ + (like *sputn) may no longer have C++ semantics. This is of course only + relevant for internal callers of these functions since these functions are + not intended for external use otherwise. + + FIXME: All of the C++ cruft eventually needs to go away. */ + #include <errno.h> #ifndef __set_errno # define __set_errno(Val) errno = (Val) @@ -163,7 +170,7 @@ typedef int (*_IO_pbackfail_t) (_IO_FILE *, int); #define _IO_WPBACKFAIL(FP, CH) WJUMP1 (__pbackfail, FP, CH) /* The 'xsputn' hook writes upto N characters from buffer DATA. - Returns the number of character actually written. + Returns EOF or the number of character actually written. It matches the streambuf::xsputn virtual function. */ typedef _IO_size_t (*_IO_xsputn_t) (_IO_FILE *FP, const void *DATA, _IO_size_t N); diff --git a/libc/locale/Makefile b/libc/locale/Makefile index 31cf1beb9..f16336bc2 100644 --- a/libc/locale/Makefile +++ b/libc/locale/Makefile @@ -75,6 +75,8 @@ GPERFFLAGS = -acCgopt -k1,2,5,9,$$ -L ANSI-C include ../Rules +CFLAGS-md5.c = -I../crypt + programs/%-kw.h: programs/%-kw.gperf cd programs \ && $(GPERF) $(GPERFFLAGS) -N $(@F:-kw.h=_hash) $(<F) > $(@F).new diff --git a/libc/localedata/ChangeLog b/libc/localedata/ChangeLog index 23ceb1df1..c25554d71 100644 --- a/libc/localedata/ChangeLog +++ b/libc/localedata/ChangeLog @@ -1,3 +1,46 @@ +2012-11-16 Andreas Jaeger <aj@suse.de> + + [BZ #14368] + * locales/szl_PL: New Silesian Language Locale for Poland. + Contributed by Przemyslaw Buczkowski <przemub@yahoo.pl>. + * localedata/SUPPORTED (SUPPORTED-LOCALES): Add szl_PL. + + [BZ # 14828] + * locales/ayc_PE: Add Aymara locale for Peru + contributed by Chris Leonard <cjl@sugarlabs.org> and + Amos Batto <amosbatto@yahoo.com>. + * SUPPORTED (SUPPORTED-LOCALES): Add ayc_PE. + + [BZ # 14501] + * locales/nhn_MX: Add Central Nahuatl locale for Mexico, + contributed by Jorge Becerril <jrbecster@gmail.com>. + * SUPPORTED (SUPPORTED-LOCALES): Add nhn_MX. + +2012-11-15 Chris Leonard <cjlhomeaddress@gmail.com> + + [BZ #13952] + * locales/km_KH: Correct country-name and lang-name. + +2012-11-15 Andreas Jaeger <aj@suse.de> + + [BZ #13603] + [BZ #13604] + [BZ #13698] + * locales/doi_IN: New file, contributed by Pravin Satpute + <psatpute@redhat.com> and Sushil Badyal <badyalsk@gmail.com>. + * locales/mni_IN: New file, contributed by Pravin Satpute + <psatpute@redhat.com> and Rebika Devi <rebika_srd@rediffmail.com>. + * locales/sat_IN: New file, contributed by Pravin Satpute + <psatpute@redhat.com> and Thakur Prasad Murmu <tp_murmu@yahoo.com>. + * SUPPORTED (SUPPORTED-LOCALES): Add doi_IN, mni_IN, sat_IN. + +2012-11-15 Chris Leonard <cjlhomeaddress@gmail.com> + + [BZ #13950] + * locales/bo_CN (LC_NAME, LC_ADDRESS): Remove some FIXMEs with + proper content, disable others. + * locales/bo_IN (LC_NAME, LC_ADDRESS): Likewise. + 2012-11-07 Dmitry V. Levin <ldv@altlinux.org> [BZ#14807] diff --git a/libc/localedata/SUPPORTED b/libc/localedata/SUPPORTED index 9a1699fdb..240fbccc5 100644 --- a/libc/localedata/SUPPORTED +++ b/libc/localedata/SUPPORTED @@ -46,6 +46,7 @@ ar_TN.UTF-8/UTF-8 \ ar_TN/ISO-8859-6 \ ar_YE.UTF-8/UTF-8 \ ar_YE/ISO-8859-6 \ +ayc_PE/UFT-8 \ az_AZ/UTF-8 \ as_IN/UTF-8 \ ast_ES.UTF-8/UTF-8 \ @@ -102,6 +103,7 @@ de_DE@euro/ISO-8859-15 \ de_LU.UTF-8/UTF-8 \ de_LU/ISO-8859-1 \ de_LU@euro/ISO-8859-15 \ +doi_IN/UTF-8 \ dv_MV/UTF-8 \ dz_BT/UTF-8 \ el_GR.UTF-8/UTF-8 \ @@ -296,6 +298,7 @@ mk_MK.UTF-8/UTF-8 \ mk_MK/ISO-8859-5 \ ml_IN/UTF-8 \ mn_MN/UTF-8 \ +mni_IN/UTF-8 \ mr_IN/UTF-8 \ ms_MY.UTF-8/UTF-8 \ ms_MY/ISO-8859-1 \ @@ -308,6 +311,7 @@ nb_NO/ISO-8859-1 \ nds_DE/UTF-8 \ nds_NL/UTF-8 \ ne_NP/UTF-8 \ +nhn_MX/UTF-8 \ nl_AW/UTF-8 \ nl_BE.UTF-8/UTF-8 \ nl_BE/ISO-8859-1 \ @@ -346,6 +350,7 @@ ru_UA.UTF-8/UTF-8 \ ru_UA/KOI8-U \ rw_RW/UTF-8 \ sa_IN/UTF-8 \ +sat_IN/UTF-8 \ sc_IT/UTF-8 \ sd_IN/UTF-8 \ sd_IN@devanagari/UTF-8 \ @@ -380,6 +385,7 @@ sv_SE.UTF-8/UTF-8 \ sv_SE/ISO-8859-1 \ sw_KE/UTF-8 \ sw_TZ/UTF-8 \ +szl_PL/UTF-8 \ ta_IN/UTF-8 \ ta_LK/UTF-8 \ te_IN/UTF-8 \ diff --git a/libc/localedata/locales/ayc_PE b/libc/localedata/locales/ayc_PE new file mode 100644 index 000000000..edf8a145d --- /dev/null +++ b/libc/localedata/locales/ayc_PE @@ -0,0 +1,194 @@ +comment_char % +escape_char / +% Charset: UTF-8 +% WARNING: This file has been autogenerated by the Locale Helper application +% Check it carefully before using it in production. +LC_IDENTIFICATION +title "Aymara (ayc) locale for Peru" +source "runasimipi.org" +address "" +contact "" +email "libc-alpha@sourceware.org" +tel "" +fax "" +language "Aymara" +territory "Peru" +revision "1.0" +date "2011-11-13" +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Aymara, Southern (ayc) language locale for Peru +% +% Charset: ISO-8859-1 +% +% Aymara terms provided by Edgar Quispe Chambi <equispe7@gmail.com> and +% Amos Batto <amosbatto@yahoo.com> +% +% Prepared and contributed to glibc by Chris Leonard <cjl@sugarlabs.org> and +% Amos Batto <amosbatto@yahoo.com> +% +% This locale data has been developed in collaboration between: +% Sugar Labs, http://www.sugarlabs.org/ +% One Laptop Per Child, http://one.laptop.org/ +% Runasimipi Quespiqa Software, http://runasimipi.org/ +% Somos Azúcar. http://somosazucar.org/ +% +% Los autores desean agradecer a los desafíos de la clasificación de las lenguas andinas +% con los códigos ISO-639 disponibles en la actualidad y su disposición a trabajar con +% todos los interesados en mejorar la representación de todas las lenguas andinas. +% +% +% build with: localedef -f ISO-8859-1 -i ayc_PE ayc_PE +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% +category "ayc_PE:2011";LC_IDENTIFICATION +category "ayc_PE:2011";LC_CTYPE +category "ayc_PE:2011";LC_COLLATE +category "ayc_PE:2011";LC_TIME +category "ayc_PE:2011";LC_NUMERIC +category "ayc_PE:2011";LC_MONETARY +category "ayc_PE:2011";LC_PAPER +category "ayc_PE:2011";LC_MEASUREMENT +category "ayc_PE:2011";LC_MESSAGES +category "ayc_PE:2011";LC_NAME +category "ayc_PE:2011";LC_ADDRESS +category "ayc_PE:2011";LC_TELEPHONE +END LC_IDENTIFICATION + +LC_CTYPE +copy "es_ES" +END LC_CTYPE + +LC_COLLATE +copy "iso14651_t1" +END LC_COLLATE + +% LC_TIME: Use Aymara transliteration of Spanish day and month names + +LC_TIME +% inïru, phiwriru, marsu, awrila, mayu, junyu, julyu, awustu, sitimri, uktuwri, nuwimri, risimri +mon "<U0069><U006E><U00EF><U0072><U0075>";/ + "<U0070><U0068><U0069><U0077><U0072><U0069><U0072><U0075>";/ + "<U006D><U0061><U0072><U0073><U0075>";/ + "<U0061><U0077><U0072><U0069><U006C><U0061>";/ + "<U006D><U0061><U0079><U0075>";/ + "<U006A><U0075><U006E><U0079><U0075>";/ + "<U006A><U0075><U006C><U0079><U0075>";/ + "<U0061><U0077><U0075><U0073><U0074><U0075>";/ + "<U0073><U0069><U0074><U0069><U006D><U0072><U0069>";/ + "<U0075><U006B><U0074><U0075><U0077><U0072><U0069>";/ + "<U006E><U0075><U0077><U0069><U006D><U0072><U0069>";/ + "<U0072><U0069><U0073><U0069><U006D><U0072><U0069>" +% ini, phi, mar, awr ,may, jun, jul, awu, sit, ukt, nuw, ris +abmon "<U0069><U006E><U0069>";/ + "<U0070><U0068><U0069>";/ + "<U006D><U0061><U0072>";/ + "<U0061><U0077><U0072>";/ + "<U006D><U0061><U0079>";/ + "<U006A><U0075><U006E>";/ + "<U006A><U0075><U006C>";/ + "<U0061><U0077><U0075>";/ + "<U0073><U0069><U0074>";/ + "<U0075><U006B><U0074>";/ + "<U006E><U0075><U0077>";/ + "<U0072><U0069><U0073>" +% tuminku, lunisa, martisa, mirkulisa, juywisa, wirnisa, sawäru +day "<U0074><U0075><U006D><U0069><U006E><U006B><U0075>";/ + "<U006C><U0075><U006E><U0069><U0073><U0061>";/ + "<U006D><U0061><U0072><U0074><U0069><U0073><U0061>";/ + "<U006D><U0069><U0072><U006B><U0075><U006C><U0069><U0073><U0061>";/ + "<U006A><U0075><U0079><U0077><U0069><U0073><U0061>";/ + "<U0077><U0069><U0072><U006E><U0069><U0073><U0061>";/ + "<U0073><U0061><U0077><U00E4><U0072><U0075>" +% tum, lun, mar, mir, juy, wir, saw +abday "<U0074><U0075><U006D>";/ + "<U006C><U0075><U006E>";/ + "<U006D><U0061><U0072>";/ + "<U006D><U0069><U0072>";/ + "<U006A><U0075><U0079>";/ + "<U0077><U0069><U0072>";/ + "<U0073><U0061><U0077>" +% Abbreviated date and time representation to be referenced by the "%c" field descriptor - +% +% "%a" (short weekday name), +% "%d" (day of month as a decimal number), +% "%b" (short month name), +% "%Y" (year with century as a decimal number), +% "%T" (24-hour clock time in format HH:MM:SS), +% "%Z" (Time zone name) +% %a %d %b %Y %T %Z +d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>" + +% Date representation to be referenced by the "%x" field descriptor - +% "%d/%m/%Y", day/month/year as decimal numbers (01/01/2000). +d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>" + +% Time representation to be referenced by the "%X" field descriptor - +% "%T" (24-hour clock time in format HH:MM:SS) +t_fmt "<U0025><U0054>" + +% Define representation of ante meridian and post maritime strings - +% The "" mean 'default to "AM" and "PM". +am_pm "<U0056><U004D>";"<U004E><U004D>" + +% %I:%M:%S %p +t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>" + +% Date representation not described in ISO/IEC 14652. Comes out as - +% "%a %b %e %H:%M:%S %Z %Y" which is default "date" command output +% +% %a - abbreviated weekday name, +% %b - abbreviated month name, +% %e - day of month as a decimal number with leading space (1 to 31), +% %H - hour (24-hour clock) as a decimal number (00 to 23), +% %M - minute as a decimal number (00 to 59), +% %S - seconds as a decimal number (00 to 59), +% %Z - time-zone name, +% %Y - year with century as a decimal number,e.g. 2001. +date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/ +<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/ +<U0025><U005A><U0020><U0025><U0059>" +END LC_TIME + +LC_NUMERIC +copy "es_PE" +END LC_NUMERIC + +LC_MONETARY +copy "es_PE" +END LC_MONETARY + +LC_PAPER +copy "es_PE" +END LC_PAPER + +LC_MEASUREMENT +measurement 1 +END LC_MEASUREMENT + +LC_MESSAGES +% ^[uUsSyY].* +yesexpr "<U005E><U005B><U0075><U0055><U0073><U0053><U0079><U0059><U005D><U002E><U002A>" +% ^[jJnN].* +noexpr "<U005E><U005B><U006A><U004A><U006E><U004E><U005D><U002E><U002A>" +% Ukhamawa +yesstr "<U0055><U006B><U0068><U0061><U006D><U0061><U0077><U0061>" +% Janiwa +nostr "<U004A><U0061><U006E><U0069><U0077><U0061>" +END LC_MESSAGES + +LC_NAME +copy "es_PE" +END LC_NAME + +LC_ADDRESS +copy "es_PE" +END LC_ADDRESS + +LC_TELEPHONE +copy "es_PE" +END LC_TELEPHONE diff --git a/libc/localedata/locales/bo_CN b/libc/localedata/locales/bo_CN index 8440506f2..aa8ff0771 100644 --- a/libc/localedata/locales/bo_CN +++ b/libc/localedata/locales/bo_CN @@ -144,19 +144,21 @@ END LC_MEASUREMENT LC_NAME % FIXME -name_fmt "FIXME" -name_gen "FIXME" -name_miss "FIXME" -name_mr "FIXME" -name_mrs "FIXME" -name_ms "FIXME" + +name_fmt "" +% name_gen "FIXME" +% name_miss "FIXME" +% name_mr "FIXME" +% name_mrs "FIXME" +% name_ms "FIXME" END LC_NAME LC_ADDRESS % FIXME -postal_fmt "FIXME" -country_name "FIXME" +% %c%N%T%N%s %h %e %r%N%b%N%d%N%f%N%a%N +postal_fmt "<U0025><U0063><U0025><U004E><U0025><U0054><U0025><U004E><U0025><U0073><U0020><U0025><U0068><U0020><U0025><U0065><U0020><U0025><U0072><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0064><U0025><U004E><U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>" +country_name "<U0F40><U0FB2><U0F74><U0F44><U0F0B><U0F67><U0FAD><U0F0B><U0F58><U0F72><U0F0B><U0F51><U0F58><U0F44><U0F66><U0F0B><U0F66><U0FA4><U0FB1><U0F72><U0F0B><U0F58><U0F50><U0F74><U0F53><U0F0B><U0F62><U0F92><U0FB1><U0F63><U0F0B><U0F41><U0F56><U0F0D>" country_ab2 "<U0043><U004E>" country_ab3 "<U0043><U0048><U004E>" country_num 156 diff --git a/libc/localedata/locales/bo_IN b/libc/localedata/locales/bo_IN index 724e286cf..9e9c4ff4f 100644 --- a/libc/localedata/locales/bo_IN +++ b/libc/localedata/locales/bo_IN @@ -70,23 +70,23 @@ END LC_MEASUREMENT LC_NAME % FIXME -name_fmt "FIXME" -name_gen "FIXME" -name_miss "FIXME" -name_mr "FIXME" -name_mrs "FIXME" -name_ms "FIXME" +name_fmt "" +% name_gen "FIXME" +% name_miss "FIXME" +% name_mr "FIXME" +% name_mrs "FIXME" +% name_ms "FIXME" END LC_NAME LC_ADDRESS % FIXME -postal_fmt "FIXME" -country_name "FIXME" +% %z%c%T%s%b%e%r +postal_fmt "<U0025><U007A><U0025><U0063><U0025><U0054><U0025><U0073><U0025><U0062><U0025><U0065><U0025><U0072>" +country_name "<U0F62><U0F92><U0FB1><U0F0B><U0F42><U0F62>" country_ab2 "<U0049><U004E>" country_ab3 "<U0049><U004E><U0044>" country_num 356 - lang_name "<U0F54><U0F7C><U0F51><U0F0B><U0F66><U0F90><U0F51><U0F0B>" lang_ab "<U0062><U006F>" lang_term "<U0062><U006F><U0064>" diff --git a/libc/localedata/locales/doi_IN b/libc/localedata/locales/doi_IN new file mode 100644 index 000000000..50ef73501 --- /dev/null +++ b/libc/localedata/locales/doi_IN @@ -0,0 +1,176 @@ +comment_char % +escape_char / +% Dogri language locale for India. +% Contributed by Pravin Satpute <psatpute@redhat.com> and Sushil Badyal <badyalsk@gmail.com> + +LC_IDENTIFICATION +title "Dogri language locale for India" +source "Red Hat Pune" +address "Level 1, Tower X, Cybercity, Magarpatta City, Hadapsar, Pune-411013 " +contact "" +email "libc-alpha@sourceware.org" +tel "" +fax "" +language "Dogri" +territory "India" +revision "1.0" +date "2012-02-16" +% +category "doi_IN:2012";LC_IDENTIFICATION +category "doi_IN:2012";LC_CTYPE +category "doi_IN:2012";LC_COLLATE +category "doi_IN:2012";LC_TIME +category "doi_IN:2012";LC_NUMERIC +category "doi_IN:2012";LC_MONETARY +category "doi_IN:2012";LC_MESSAGES +category "doi_IN:2012";LC_PAPER +category "doi_IN:2012";LC_NAME +category "doi_IN:2012";LC_ADDRESS +category "doi_IN:2012";LC_TELEPHONE + +END LC_IDENTIFICATION + +LC_CTYPE +copy "hi_IN" +END LC_CTYPE + +LC_COLLATE + +% Copy the template from ISO/IEC 14651 +copy "iso14651_t1" + +END LC_COLLATE + +LC_MONETARY +copy "hi_IN" +END LC_MONETARY + + +LC_NUMERIC +copy "hi_IN" +END LC_NUMERIC + + +LC_TIME +% This is the POSIX Locale definition for the LC_TIME category. +% These are generated based on XML base Locale definition file +% for IBM Class for Unicode/Java +% +% Abbreviated weekday names (%a) +abday "<U0910><U0924><U0020>";/ + "<U0938><U094B><U092E><U0020>";/ + "<U092E><U0902><U0917><U0932><U0020>";/ + "<U092C><U0941><U0927><U0020>";/ + "<U092C><U0940><U0930><U0020>";/ + "<U0936><U0941><U0915><U094D><U0915><U0930><U0020>";/ + "<U0936><U094D><U0928><U0940><U091A><U0930><U0020>" +% +% Full weekday names (%A) +day "<U0910><U0924><U092C><U093E><U0930><U0020>";/ + "<U0938><U094B><U092E><U092C><U093E><U0930><U0020>";/ + "<U092E><U0902><U0917><U0932><U092C><U0930><U0020>";/ + "<U092C><U0941><U0927><U092C><U093E><U0930><U0020>";/ + "<U092C><U0940><U0930><U092C><U093E><U0930><U0020>";/ + "<U0936><U0941><U0915><U094D><U0915><U0930><U092C><U093E><U0930><U0020>";/ + "<U0936><U094D><U0928><U0940><U091A><U0930><U092C><U093E><U0930><U0020>" +% +% Abbreviated month names (%b) +abmon "<U091C><U0928><U0935><U0930><U0940>";/ + "<U092B><U0930><U0935><U0930><U0940>";/ + "<U092E><U093E><U0930><U094D><U091A>";/ + "<U090F><U092A><U094D><U0930><U0948><U0932>";/ + "<U092E><U0947><U0908>";"<U091C><U0942><U0928>";/ + "<U091C><U0942><U0932><U0948>";/ + "<U0905><U0917><U0938><U094D><U0924>";/ + "<U0938><U093F><U0924><U0902><U092C><U0930>";/ + "<U0905><U0915><U094D><U0924><U0942><U092C><U0930>";/ + "<U0928><U0935><U0902><U092C><U0930>";/ + "<U0926><U093F><U0938><U0902><U092C><U0930>" +% +% Full month names (%B) +mon "<U091C><U0928><U0935><U0930><U0940>";/ + "<U092B><U0930><U0935><U0930><U0940>";/ + "<U092E><U093E><U0930><U094D><U091A>";/ + "<U090F><U092A><U094D><U0930><U0948><U0932>";/ + "<U092E><U0947><U0908>";"<U091C><U0942><U0928>";/ + "<U091C><U0942><U0932><U0948>";/ + "<U0905><U0917><U0938><U094D><U0924>";/ + "<U0938><U093F><U0924><U0902><U092C><U0930>";/ + "<U0905><U0915><U094D><U0924><U0942><U092C><U0930>";/ + "<U0928><U0935><U0902><U092C><U0930>";/ + "<U0926><U093F><U0938><U0902><U092C><U0930>" +% +% Equivalent of AM PM +am_pm "<U0938><U091E><U0902>";/ + "<U0938><U092C><U0947><U0930>" +% +% Appropriate date and time representation +% %A %d %b %Y%I:%M:%S %Z +d_t_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/ +<U0020><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A>/ +<U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>" +% +% Appropriate date representation +% %A %d %b %Y +d_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/ +<U0020><U0025><U0059>" +% +% Appropriate time representation +% %I:%M:%S %Z +t_fmt "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/ +<U0020><U0020><U0025><U005A>" +% +% Appropriate 12 h time representation (%r) +t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/ +<U0020><U0025><U0070><U0020><U0025><U005A>" +% +date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/ +<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/ +<U0025><U005A><U0020><U0025><U0059>" +END LC_TIME + + +LC_MESSAGES +% ^(Yes|[yY]) +yesexpr "<U005E><U0028><U0911><U0939><U007C><U005B><U0079>/ +<U0059><U005D><U0029>" +% +% ^(No|[nN]) +noexpr "<U005E><U0028><U0928><U093E><U007C><U005B><U006E><U004E>/ +<U005D><U0029>" +% +END LC_MESSAGES + +LC_PAPER +copy "hi_IN" +END LC_PAPER + + +LC_NAME +% This is the ISO_IEC TR14652 Locale definition for the +% LC_NAME category. +% +name_fmt "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/ +<U0025><U0067>" +name_gen "" +name_mr "<U004D><U0072><U002E>" +name_mrs "<U004D><U0072><U0073><U002E>" +name_miss "<U004D><U0069><U0073><U0073><U002E>" +name_ms "<U004D><U0073><U002E>" + +END LC_NAME + + + +LC_ADDRESS +copy "hi_IN" +END LC_ADDRESS + + +LC_TELEPHONE +copy "hi_IN" +END LC_TELEPHONE + +LC_MEASUREMENT +copy "hi_IN" +END LC_MEASUREMENT diff --git a/libc/localedata/locales/km_KH b/libc/localedata/locales/km_KH index 488e53a40..c314cb563 100644 --- a/libc/localedata/locales/km_KH +++ b/libc/localedata/locales/km_KH @@ -1888,7 +1888,8 @@ postal_fmt "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/ <U0025><U0074><U0025><U0062><U0025><U004E><U0025><U0068><U0025><U0074>/ <U0025><U0073><U0025><U004E><U0025><U0054><U0025><U004E><U0025><U0053>/ <U0025><U004E><U0025><U007A><U0025><U0063><U0025><U004E>" -country_name "<U0EA5><U0EB2><U0EA7>" +% កម្ពុជា (Kampuchea) +country_name "<U1780><U1798><U17D2><U1796><U17BB><U1787><U17B6>" %FIXME %country_post "" country_ab2 "<U004C><U0041>" @@ -1897,7 +1898,8 @@ country_num 418 country_car "<U004C><U0041><U004F>" %FIXME %country_isbn "" -lang_name "<U0EA5><U0EB2><U0EA7>" +% ភាសាខ្មែរ (Khmer) +lang_name "<U1797><U17B6><U179F><U17B6><U1781><U17D2><U1798><U17C2><U179A>" lang_ab "<U006C><U006F>" lang_term "<U006c><U0061><U006F>" lang_lib "<U006C><U0061><U006F>" diff --git a/libc/localedata/locales/mni_IN b/libc/localedata/locales/mni_IN new file mode 100644 index 000000000..ff1ca4f89 --- /dev/null +++ b/libc/localedata/locales/mni_IN @@ -0,0 +1,172 @@ +comment_char % +escape_char / +% Manipuri language locale for India. +% Contributed by Mr. Pravin Satpute <psatpute AT redhat DOT com> and Ms. Rebika Devi < rebika_srd AT rediffmail DOT com> + +LC_IDENTIFICATION +title "Manipuri language locale for India" +source "Red Hat Pune" +address "Level 1, Tower X, Cybercity, Magarpatta City, Hadapsar, Pune-411013 " +contact "" +email "libc-alpha@sourceware.org" +tel "" +fax "" +language "Manipuri" +territory "India" +revision "1.0" +date "2012-01-17" +% +category "mni_IN:2012";LC_IDENTIFICATION +category "mni_IN:2012";LC_CTYPE +category "mni_IN:2012";LC_COLLATE +category "mni_IN:2012";LC_TIME +category "mni_IN:2012";LC_NUMERIC +category "mni_IN:2012";LC_MONETARY +category "mni_IN:2012";LC_MESSAGES +category "mni_IN:2012";LC_PAPER +category "mni_IN:2012";LC_NAME +category "mni_IN:2012";LC_ADDRESS +category "mni_IN:2012";LC_TELEPHONE + +END LC_IDENTIFICATION + +LC_CTYPE +copy "bn_IN" +END LC_CTYPE + +LC_COLLATE +copy "bn_IN" +END LC_COLLATE + +LC_MONETARY +copy "bn_IN" +END LC_MONETARY + + +LC_NUMERIC +copy "bn_IN" +END LC_NUMERIC + + +LC_TIME +% This is the POSIX Locale definition for the LC_TIME category +% generated by IBM Basic CountryPack Transformer. +% These are generated based on XML base Locale definition file +% for IBM Class for Unicode. +% +% Abbreviated weekday names (%a) +abday "<U09A8><U09CB><U0982>";"<U09A8><U09BF><U0982>";/ + "<U09B2><U09C8><U09AC><U09BE><U0995>";"<U09DF><U09C1><U09AE>";/ + "<U09B6><U0997><U09CB><U09B2>";/ + "<U0987><U09B0><U09BE>";"<U09A5><U09BE><U0982>" +% + +% Full weekday names (%A) +day "<U09A8><U09CB><U0982><U09AE><U09BE><U0987><U099C><U09BF><U0982>";/ + "<U09A8><U09BF><U0982><U09A5><U09CC><U0995><U09BE><U09AC><U09BE>";/ + "<U09B2><U09C8><U09AC><U09BE><U0995><U09AA><U09CB><U0995><U09AA><U09BE>";/ + "<U09DF><U09C1><U09AE><U09B6><U0995><U09C8><U09B6><U09BE>";/ + "<U09B6><U0997><U09CB><U09B2><U09B6><U09C7><U09A8>";/ + "<U0987><U09B0><U09BE><U0987>";/ + "<U09A5><U09BE><U0982><U099C>" +% +% Abbreviated month names (%b) +abmon "<U099C><U09BE><U09A8>";/ + "<U09AB><U09C7><U09AC>";/ + "<U09AE><U09BE><U09B0>";/ + "<U098F><U09AA><U09CD><U09B0><U09BF>";/ + "<U09AE><U09C7>";/ + "<U099C><U09C1><U09A8>";/ + "<U099C><U09C1><U09B2>";/ + "<U0986><U0997>";/ + "<U09B8><U09C7><U09AA>";/ + "<U0993><U0995><U09CD><U09A4>";/ + "<U09A8><U09AC><U09C7>";/ + "<U09A1><U09BF><U09B8>" +% + +% Full month names (%B) +mon "<U099C><U09BE><U09A8><U09C1><U09F1><U09BE><U09B0><U09BF>";/ + "<U09AB><U09C7><U09AC><U09CD><U09B0><U09C1><U09F1><U09BE><U09B0><U09BF>";/ + "<U09AE><U09BE><U09B0><U09CD><U099A>";/ + "<U098F><U09AA><U09CD><U09B0><U09BF><U09B2>";/ + "<U09AE><U09C7>";/ + "<U099C><U09C1><U09A8>";/ + "<U099C><U09C1><U09B2><U09BE><U0987>";/ + "<U0986><U0997><U09B7><U09CD><U099F>";/ + "<U09B8><U09C7><U09AA><U09CD><U09A4><U09C7><U09AE><U09CD><U09AC><U09B0>";/ + "<U0993><U0995><U09CD><U09A4><U09CB><U09AC><U09B0>";/ + "<U09A8><U09AC><U09C7><U09AE><U09CD><U09AC><U09B0>";/ + "<U09A1><U09BF><U09B8><U09C7><U09AE><U09CD><U09AC><U09B0>" +% +% Equivalent of AM PM + +am_pm "<U098F><U002E><U09AE><U002E>";/ + "<U09AA><U002E><U09AE><U002E>" +% +% Appropriate date and time representation +% %A %d %b %Y%I:%M:%S %Z +d_t_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/ +<U0020><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A>/ +<U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>" +% +% Appropriate date representation +% %A %d %b %Y +d_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/ +<U0020><U0025><U0059>" +% +% Appropriate time representation +% %I:%M:%S %Z +t_fmt "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/ +<U0020><U0020><U0025><U005A>" +% +% Appropriate 12 h time representation (%r) +t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/ +<U0020><U0025><U0070><U0020><U0025><U005A>" +% +% Appropriate date representation (date(1)) "%a %b %e %H:%M:%S %Z %Y" +date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/ +<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/ +<U0025><U005A><U0020><U0025><U0059>" +END LC_TIME + + +LC_MESSAGES +copy "en_IN" +END LC_MESSAGES + + +LC_PAPER +copy "bn_IN" +END LC_PAPER + + +LC_NAME +% This is the ISO_IEC TR14652 Locale definition for the LC_NAME category +% generated by IBM Basic CountryPack Transformer. +% +% +name_fmt "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/ +<U0025><U0067>" +name_gen "" +name_mr "<U09B6><U09CD><U09B0><U09C0>" +name_mrs "<U09B6><U09CD><U09B0><U09C0><U09AE><U09A4><U09BF>" +name_miss "<U0995><U09C1><U09AE><U09BE><U09B0><U09C0>" +name_ms "<U0995><U09C1><U09AE><U09BE><U09B0>" + +END LC_NAME + + +LC_ADDRESS +copy "bn_IN" +END LC_ADDRESS + + +LC_TELEPHONE +copy "bn_IN" +END LC_TELEPHONE + + +LC_MEASUREMENT +copy "bn_IN" +END LC_MEASUREMENT diff --git a/libc/localedata/locales/nhn_MX b/libc/localedata/locales/nhn_MX new file mode 100644 index 000000000..f2af76b6b --- /dev/null +++ b/libc/localedata/locales/nhn_MX @@ -0,0 +1,144 @@ +comment_char % +escape_char / +% +% Central Nahuatl locale for Mexico +% Source: RAP +% Address: Texcoco/Estado de Mexico, Mexico +% Contact: Jorge Becerril +% Email: jrbecster@gmail.com +% Tel: +% Language: nhn +% Territory: MX +% Revision: 1.0 +% Date: 2012-08-19 +% Application: general +% Users: general +% Reportoiremap: mnemonics.ds +% Charset: UTF-8 +% This file is distributed under the same license as the glibc package. + +LC_IDENTIFICATION +title "Central Nahuatl for Mexico" +source "RAP" +address "" +contact "" +email "libc-alpha@sourceware.org" +tel "" +fax "" +language "Central Nahuatl" +territory "Mexico" +revision "1.0" +date "2012-08-19" +% +category "nhn_MX:2012";LC_IDENTIFICATION +category "nhn_MX:2012";LC_CTYPE +category "nhn_MX:2012";LC_COLLATE +category "nhn_MX:2012";LC_TIME +category "nhn_MX:2012";LC_NUMERIC +category "nhn_MX:2012";LC_MONETARY +category "nhn_MX:2012";LC_MEASUREMENT +category "nhn_MX:2012";LC_MESSAGES +category "nhn_MX:2012";LC_PAPER +category "nhn_MX:2012";LC_NAME +category "nhn_MX:2012";LC_ADDRESS +category "nhn_MX:2012";LC_TELEPHONE + +END LC_IDENTIFICATION + +LC_COLLATE +% Copy the template from ISO/IEC 14651 +copy "iso14651_t1" +END LC_COLLATE + +LC_CTYPE +copy "i18n" + +translit_start +include "translit_combining";"" +translit_end +END LC_CTYPE + +LC_MESSAGES +% ^[sSqQyY].* +yesexpr "<U005E><U005B><U0073><U0053><U0071><U0051><U0079><U0059><U005D><U002E><U002A>" +% ^[nNaA].* +noexpr "<U005E><U005B><U006E><U004E><U0061><U0041><U005D><U002E><U002A>" + +% quema +yesstr "<U0071><U0075><U0065><U006D><U0061>" +% ahmo +nostr "<U0061><U0068><U006D><U006F>" +END LC_MESSAGES + +LC_MONETARY +copy "es_MX" +END LC_MONETARY + +LC_NUMERIC +copy "es_MX" +END LC_NUMERIC + +LC_TIME +% teo; cei; ome; yei; nau; mac; chi +abday "<U0074><U0065><U006F>";"<U0063><U0065><U0069>";/ + "<U006F><U006D><U0065>";"<U0079><U0065><U0069>";/ + "<U006E><U0061><U0075>";"<U006D><U0061><U0063>";/ + "<U0063><U0068><U0069>" +% teoilhuitl; ceilhuitl; omeilhuitl; yeilhuitl; nahuilhuitl; macuililhuitl; chicuaceilhuitl +day "<U0074><U0065><U006F><U0069><U006C><U0068><U0075><U0069><U0074><U006C>";/ + "<U0063><U0065><U0069><U006C><U0068><U0075><U0069><U0074><U006C>";/ + "<U006F><U006D><U0065><U0069><U006C><U0068><U0075><U0069><U0074><U006C>";/ + "<U0079><U0065><U0069><U006C><U0068><U0075><U0069><U0074><U006C>";/ + "<U006E><U0061><U0068><U0075><U0069><U006C><U0068><U0075><U0069><U0074><U006C>";/ + "<U006D><U0061><U0063><U0075><U0069><U006C><U0069><U006C><U0068><U0075><U0069><U0074><U006C>";/ + "<U0063><U0068><U0069><U0063><U0075><U0061><U0063><U0065><U0069><U006C><U0068><U0075><U0069><U0074><U006C>" +% ene; feb; mar; abr; may; jun; jul; ago; sep; oct; nov; dic +abmon "<U0065><U006E><U0065>";"<U0066><U0065><U0062>";/ + "<U006D><U0061><U0072>";"<U0061><U0062><U0072>";/ + "<U006D><U0061><U0079>";"<U006A><U0075><U006E>";/ + "<U006A><U0075><U006C>";"<U0061><U0067><U006F>";/ + "<U0073><U0065><U0070>";"<U006F><U0063><U0074>";/ + "<U006E><U006F><U0076>";"<U0064><U0069><U0063>" +% enero; febrero; marzo; abril; mayo; junio; julio; agosto; septiembre; octubre; noviembre; diciembre +mon "<U0065><U006E><U0065><U0072><U006F>";/ + "<U0066><U0065><U0062><U0072><U0065><U0072><U006F>";/ + "<U006D><U0061><U0072><U007A><U006F>";/ + "<U0061><U0062><U0072><U0069><U006C>";/ + "<U006D><U0061><U0079><U006F>";/ + "<U006A><U0075><U006E><U0069><U006F>";/ + "<U006A><U0075><U006C><U0069><U006F>";/ + "<U0061><U0067><U006F><U0073><U0074><U006F>";/ + "<U0073><U0065><U0070><U0074><U0069><U0065><U006D><U0062><U0072><U0065>";/ + "<U006F><U0063><U0074><U0075><U0062><U0072><U0065>";/ + "<U006E><U006F><U0076><U0069><U0065><U006D><U0062><U0072><U0065>";/ + "<U0064><U0069><U0063><U0069><U0065><U006D><U0062><U0072><U0065>" +d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>" +d_fmt "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>" +t_fmt "<U0025><U0054>" +am_pm "";"" +t_fmt_ampm "" +date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/ +<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/ +<U0025><U005A><U0020><U0025><U0059>" +END LC_TIME + +LC_PAPER +height 279 +width 216 +END LC_PAPER + +LC_TELEPHONE +copy "es_MX" +END LC_TELEPHONE + +LC_MEASUREMENT +measurement 1 +END LC_MEASUREMENT + +LC_NAME +copy "es_MX" +END LC_NAME + +LC_ADDRESS +copy "es_MX" +END LC_ADDRESS diff --git a/libc/localedata/locales/sat_IN b/libc/localedata/locales/sat_IN new file mode 100644 index 000000000..a77de633b --- /dev/null +++ b/libc/localedata/locales/sat_IN @@ -0,0 +1,184 @@ +comment_char % +escape_char / +% Santali language locale for India. +% Contributed by Mr. Pravin Satpute <psatpute AT redhat DOT com> and Mr. Thakur Prasad Murmu <tp_murmu AT yahoo DOT com> + +LC_IDENTIFICATION +title "Santali language locale for India" +source "Red Hat Pune" +address "Level 1, Tower X, Cybercity, Magarpatta City, Hadapsar, Pune-411013 " +contact "" +email "libc-alpha@sourceware.org" +tel "" +fax "" +language "Santali" +territory "India" +revision "1.0" +date "2012-01-17" +% +category "sat_IN:2012";LC_IDENTIFICATION +category "sat_IN:2012";LC_CTYPE +category "sat_IN:2012";LC_COLLATE +category "sat_IN:2012";LC_TIME +category "sat_IN:2012";LC_NUMERIC +category "sat_IN:2012";LC_MONETARY +category "sat_IN:2012";LC_MESSAGES +category "sat_IN:2012";LC_PAPER +category "sat_IN:2012";LC_NAME +category "sat_IN:2012";LC_ADDRESS +category "sat_IN:2012";LC_TELEPHONE + +END LC_IDENTIFICATION + +LC_CTYPE +copy "hi_IN" +END LC_CTYPE + +LC_COLLATE +copy "hi_IN" +END LC_COLLATE + +LC_MONETARY +copy "hi_IN" +END LC_MONETARY + + +LC_NUMERIC +copy "hi_IN" +END LC_NUMERIC + + +LC_TIME +% This is the POSIX Locale definition for the LC_TIME category +% generated by IBM Basic CountryPack Transformer. +% These are generated based on XML base Locale definition file +% for IBM Class for Unicode. +% +% Abbreviated weekday names (%a) +abday "<U0938><U093F><U0902><U0917><U0947>";"<U0913><U0924><U0947>";/ + "<U092C><U093E><U0932><U0947>";"<U0938><U093E><U0917><U0941><U0928>";/ + "<U0938><U093E><U0930><U0926><U0940>";/ + "<U091C><U093E><U0930><U0941><U092E>";"<U091E><U0941><U0939><U0941><U092E>" +% + +% Full weekday names (%A) +day "<U0938><U093F><U0902><U0917><U0947><U092E><U093E><U0901><U0939><U093E><U0901>";/ + "<U0913><U0924><U0947><U092E><U093E><U0901><U0939><U093E><U0901>";/ + "<U092C><U093E><U0932><U0947><U092E><U093E><U0901><U0939><U093E><U0901>";/ + "<U0938><U093E><U0917><U0941><U0928><U092E><U093E><U0901><U0939><U093E><U0901>";/ + "<U0938><U093E><U0930><U0926><U0940><U092E><U093E><U0901><U0939><U093E><U0901>";/ + "<U091C><U093E><U0930><U0941><U092E><U092E><U093E><U0901><U0939><U093E><U0901>";/ + "<U091E><U0941><U0939><U0941><U092E><U092E><U093E><U0901><U0939><U093E><U0901>" +% +% Abbreviated month names (%b) +abmon "<U091C><U0928><U0935><U0930><U0940>";/ + "<U092B><U0930><U0935><U0930><U0940>";/ + "<U092E><U093E><U0930><U094D><U091A>";/ + "<U0905><U092A><U094D><U0930><U0947><U0932>";/ + "<U092E><U0908>";/ + "<U091C><U0941><U0928>";/ + "<U091C><U0941><U0932><U093E><U0908>";/ + "<U0905><U0917><U0938><U094D><U0924>";/ + "<U0938><U093F><U0924><U092E><U094D><U092C><U0930>";/ + "<U0905><U0916><U0925><U092C><U0930>";/ + "<U0928><U0935><U092E><U094D><U092C><U0930>";/ + "<U0926><U093F><U0938><U092E><U094D><U092C><U0930>" +% + +% Full month names (%B) +mon "<U091C><U0928><U0935><U0930><U0940>";/ + "<U092B><U0930><U0935><U0930><U0940>";/ + "<U092E><U093E><U0930><U094D><U091A>";/ + "<U0905><U092A><U094D><U0930><U0947><U0932>";/ + "<U092E><U0908>";/ + "<U091C><U0941><U0928>";/ + "<U091C><U0941><U0932><U093E><U0908>";/ + "<U0905><U0917><U0938><U094D><U0924>";/ + "<U0938><U093F><U0924><U092E><U094D><U092C><U0930>";/ + "<U0905><U0916><U0925><U092C><U0930>";/ + "<U0928><U0935><U092E><U094D><U092C><U0930>";/ + "<U0926><U093F><U0938><U092E><U094D><U092C><U0930>" +% +% Equivalent of AM PM + +am_pm "<U0041><U004D>";"<U0050><U004D>" + +% +% Appropriate date and time representation +% %A %d %b %Y%I:%M:%S %Z +d_t_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/ +<U0020><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A>/ +<U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>" +% +% Appropriate date representation +% %A %d %b %Y +d_fmt "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/ +<U0020><U0025><U0059>" +% +% Appropriate time representation +% %I:%M:%S %Z +t_fmt "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/ +<U0020><U0020><U0025><U005A>" +% +% Appropriate 12 h time representation (%r) +t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/ +<U0020><U0025><U0070><U0020><U0025><U005A>" +% +% Appropriate date representation (date(1)) "%a %b %e %H:%M:%S %Z %Y" +date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/ +<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/ +<U0025><U005A><U0020><U0025><U0059>" +END LC_TIME + + +LC_MESSAGES +% This is the POSIX Locale definition for the LC_MESSAGES category +% generated by IBM Basic CountryPack Transformer. +% These are generated based on XML base Locale definition file +% for IBM Class for Unicode. +% +% ^(Yes|[yY]) +yesexpr "<U005E><U0028><U0939><U094B><U092F><U007C><U005B><U0079>/ +<U0059><U005D><U0029>" +% +% ^(No|[nN]) +noexpr "<U005E><U0028><U092C><U093E><U0919><U007C><U005B><U006E><U004E>/ +<U005D><U0029>" +% +END LC_MESSAGES + + +LC_PAPER +copy "hi_IN" +END LC_PAPER + + +LC_NAME +% This is the ISO_IEC TR14652 Locale definition for the LC_NAME category +% generated by IBM Basic CountryPack Transformer. +% +% +name_fmt "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/ +<U0025><U0067>" +name_gen "" +name_mr "<U092E><U093E><U0928>" +name_mrs "<U092E><U093E><U0928><U0940>" +name_miss "<U092E><U093E><U0908>" +name_ms "" + +END LC_NAME + + +LC_ADDRESS +copy "hi_IN" +END LC_ADDRESS + + +LC_TELEPHONE +copy "hi_IN" +END LC_TELEPHONE + + +LC_MEASUREMENT +copy "hi_IN" +END LC_MEASUREMENT diff --git a/libc/localedata/locales/szl_PL b/libc/localedata/locales/szl_PL new file mode 100644 index 000000000..b77898d8f --- /dev/null +++ b/libc/localedata/locales/szl_PL @@ -0,0 +1,211 @@ +comment_char % +escape_char / +% +% Silesian Language Locale for Poland +% Source: szl_PL locale +% Contact: Przemyslaw Buczkowski +% Email: przemub@yahoo.pl +% Tel: +48669757937 +% Fax: none +% Language: szl +% Territory: PL +% Revision: 1.0 +% Date: 2012-07-22 +% Application: general +% Users: general +% Charset: UTF-8 +% Distribution and use is free, also +% for commercial purposes. + +LC_IDENTIFICATION +title "Silesian locale for Poland" +source "szl_PL locale" +address "" +contact "Przemyslaw Buczkowski" +email "libc-alpha@sourceware.org" +tel "" +fax "" +language "Silesian" +territory "Poland" +revision "1.0" +date "2012-07-17" +audience "general" +application "GNU locale" +abbreviation "" +% +category "szl_PL:2000";LC_IDENTIFICATION +category "szl_PL:2000";LC_CTYPE +category "szl_PL:2000";LC_COLLATE +category "szl_PL:2000";LC_TIME +category "szl_PL:2000";LC_NUMERIC +category "szl_PL:2000";LC_MONETARY +category "szl_PL:2000";LC_MEASUREMENT +category "szl_PL:2000";LC_MESSAGES +category "szl_PL:2000";LC_PAPER +category "szl_PL:2000";LC_NAME +category "szl_PL:2000";LC_ADDRESS +category "szl_PL:2000";LC_TELEPHONE + +END LC_IDENTIFICATION + +LC_CTYPE +copy "pl_PL" +END LC_CTYPE + +LC_COLLATE +copy "iso14651_t1" + +collating-symbol <atilde> +collating-symbol <cacute> +collating-symbol <lstroke> +collating-symbol <nacute> +collating-symbol <otilde> +collating-symbol <omacron> +collating-symbol <ocircumflex> +collating-symbol <U014F> +collating-symbol <zacute> +collating-symbol <zdot> + +reorder-after <a> +<atilde> + +reorder-after <c> +<cacute> + +reorder-after <l> +<lstroke> + +reorder-after <n> +<nacute> + +reorder-after <o> +<otilde> +<omacron> +<ocircumflex> +<U014F> + +reorder-after <s> +<sacute> + +reorder-after <z> +<zacute> +<zdot> + +reorder-after <U0061> +<U00E3> <atilde>;<BAS>;<MIN>;IGNORE +<U00C3> <atilde>;<BAS>;<CAP>;IGNORE + +reorder-after <U0063> +<U0107> <cacute>;<BAS>;<MIN>;IGNORE +<U0106> <cacute>;<BAS>;<CAP>;IGNORE + +reorder-after <U006C> +<U0142> <lstroke>;<BAS>;<MIN>;IGNORE +<U0141> <lstroke>;<BAS>;<CAP>;IGNORE + +reorder-after <U006E> +<U0144> <nacute>;<BAS>;<MIN>;IGNORE +<U0143> <nacute>;<BAS>;<CAP>;IGNORE + +reorder-after <U006F> +<U00F5> <otilde>;<BAS>;<MIN>;IGNORE +<U00D5> <otilde>;<BAS>;<CAP>;IGNORE +<U014D> <omacron>;<BAS>;<MIN>;IGNORE +<U013D> <omacron>;<BAS>;<CAP>;IGNORE +<U00F4> <ocircumflex>;<BAS>;<MIN>;IGNORE +<U00D4> <ocircumflex>;<BAS>;<CAP>;IGNORE +<U014F> <U014F>;<BAS>;<MIN>;IGNORE +<U014F> <U014F>;<BAS>;<CAP>;IGNORE + +reorder-after <U0073> +<U015B> <sacute>;<BAS>;<MIN>;IGNORE +<U015A> <sacute>;<BAS>;<CAP>;IGNORE + +reorder-after <U007A> +<U017A> <zacute>;<BAS>;<MIN>;IGNORE +<U0179> <zacute>;<BAS>;<CAP>;IGNORE +<U017C> <zdot>;<BAS>;<MIN>;IGNORE +<U017B> <zdot>;<BAS>;<CAP>;IGNORE + +reorder-end + +END LC_COLLATE + +LC_MESSAGES +yesexpr "<U005E><U005B><U004A><U006A><U0054><U0074><U0059><U0079><U005D><U002E><U002A>" +noexpr "<U005E><U005B><U006E><U004E><U005D><U002E><U002A>" + +END LC_MESSAGES + +LC_MONETARY +copy "pl_PL" +END LC_MONETARY + +LC_NUMERIC +copy "pl_PL" +END LC_NUMERIC + +LC_TIME +abday "<U006E><U0069><U0079>";"<U0070><U0079><U0144>";/ + "<U0077><U0074><U014F>";"<U0073><U0074><U0072>";/ + "<U0073><U007A><U0074>";"<U0070><U006A><U014D>";/ + "<U0073><U006F><U0062>" +day "<U006E><U0069><U0079><U0064><U007A><U0069><U0065><U006C><U0061>";/ + "<U0070><U0079><U0144><U0064><U007A><U0069><U014F><U0065><U006B>";/ + "<U0077><U0074><U014F><U0072><U0065><U006B>";/ + "<U0073><U0074><U0072><U007A><U014F><U0064><U0061>";/ + "<U0073><U007A><U0074><U0077><U006F><U0072><U0074><U0065><U006B>";/ + "<U0070><U006A><U014D><U006E><U0074><U0065><U006B>";/ + "<U0073><U006F><U0062><U014F><U0074><U0061>" +abmon "<U0073><U0074><U0079>";"<U006C><U0075><U0074>";/ + "<U006D><U0065><U0072>";"<U006B><U0077><U006A>";/ + "<U006D><U006F><U006A>";"<U0063><U007A><U0079>";/ + "<U006C><U0069><U0070>";"<U0073><U0069><U0079>";/ + "<U0077><U0072><U007A>";"<U0070><U0061><U017A>";/ + "<U006C><U0069><U0073>";"<U0067><U0072><U0075>" +mon "<U0073><U0074><U0079><U0063><U007A><U0079><U0144>";/ + "<U006C><U0075><U0074><U0079>";/ + "<U006D><U0065><U0072><U0063>";/ + "<U006B><U0077><U006A><U0065><U0063><U0069><U0079><U0144>";/ + "<U006D><U006F><U006A>";/ + "<U0063><U007A><U0079><U0072><U0077><U006A><U0079><U0144>";/ + "<U006C><U0069><U0070><U006A><U0079><U0144>";/ + "<U0073><U0069><U0079><U0072><U0070><U006A><U0079><U0144>";/ + "<U0077><U0072><U007A><U0065><U0073><U0069><U0079><U0144>";/ + "<U0070><U0061><U017A><U0064><U007A><U0069><U0065><U0072><U006E><U0069><U006B>";/ + "<U006C><U0069><U0073><U0074><U006F><U0070><U0061><U0064>";/ + "<U0067><U0072><U0075><U0064><U007A><U0069><U0079><U0144>" +d_t_fmt "<U0025><U0061><U002C><U0020>/ +<U0025><U002D><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U002C><U0020>/ +<U0025><U0054>" +d_fmt "<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>" +t_fmt "<U0025><U0054>" +am_pm "";"" +t_fmt_ampm "" +date_fmt "<U0025><U0061><U002C><U0020>/ +<U0025><U002D><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U002C><U0020>/ +<U0025><U0054><U0020><U0025><U005A>" +week 7;19971130;4 +first_weekday 2 +first_workday 2 +END LC_TIME + +LC_PAPER +copy "pl_PL" +END LC_PAPER + +LC_TELEPHONE +copy "pl_PL" +END LC_TELEPHONE + +LC_MEASUREMENT +copy "pl_PL" +END LC_MEASUREMENT + +LC_NAME +copy "pl_PL" +END LC_NAME + +LC_ADDRESS +copy "pl_PL" +END LC_ADDRESS diff --git a/libc/malloc/memusagestat.c b/libc/malloc/memusagestat.c index a609a9b7c..a25f06b84 100644 --- a/libc/malloc/memusagestat.c +++ b/libc/malloc/memusagestat.c @@ -1,6 +1,5 @@ /* Generate graphic from memory profiling data. - Copyright (C) 1998, 1999, 2000, 2005, 2006, - 2009 Free Software Foundation, Inc. + Copyright (C) 1998-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -554,6 +553,6 @@ print_version (FILE *stream, struct argp_state *state) Copyright (C) %s Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2009"); +"), "2012"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } diff --git a/libc/math/libm-test.inc b/libc/math/libm-test.inc index 9a98e1df8..f15223589 100644 --- a/libc/math/libm-test.inc +++ b/libc/math/libm-test.inc @@ -635,9 +635,11 @@ check_complex (const char *test_name, __complex__ FLOAT computed, { FLOAT part_comp, part_exp, part_max_ulp; int part_xfail; - char str[200]; + char *str; + + if (asprintf (&str, "Real part of: %s", test_name) == -1) + abort (); - sprintf (str, "Real part of: %s", test_name); part_comp = __real__ computed; part_exp = __real__ expected; part_max_ulp = __real__ max_ulp; @@ -645,8 +647,11 @@ check_complex (const char *test_name, __complex__ FLOAT computed, check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail, exception, &real_max_error); + free (str); + + if (asprintf (&str, "Imaginary part of: %s", test_name) == -1) + abort (); - sprintf (str, "Imaginary part of: %s", test_name); part_comp = __imag__ computed; part_exp = __imag__ expected; part_max_ulp = __imag__ max_ulp; @@ -657,6 +662,7 @@ check_complex (const char *test_name, __complex__ FLOAT computed, check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail, exception & IGNORE_ZERO_INF_SIGN, &imag_max_error); + free (str); } diff --git a/libc/misc/Makefile b/libc/misc/Makefile index 827c9003c..4b70f8185 100644 --- a/libc/misc/Makefile +++ b/libc/misc/Makefile @@ -92,6 +92,7 @@ tests: $(objpfx)tst-error1-mem endif endif +CFLAGS-select.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-tsearch.c = $(uses-callbacks) CFLAGS-lsearch.c = $(uses-callbacks) CFLAGS-pselect.c = -fexceptions diff --git a/libc/nptl/ChangeLog b/libc/nptl/ChangeLog index 93e994669..48aa6da1a 100644 --- a/libc/nptl/ChangeLog +++ b/libc/nptl/ChangeLog @@ -1,3 +1,8 @@ +2012-11-14 Marcus Shawcroft <marcus.shawcroft@linaro.org> + + * Makefile (CFLAGS-open.c, CFLAGS-open64.c, CFLAGS-pause.c) + (CFLAGS-recv.c, CFLAGS-send.c): Define. + 2012-11-06 Chris Metcalf <cmetcalf@tilera.com> * tst-sem14.c (TIMEOUT): Set timeout to 10 seconds. diff --git a/libc/nptl/Makefile b/libc/nptl/Makefile index 94928bc83..6cd72dbee 100644 --- a/libc/nptl/Makefile +++ b/libc/nptl/Makefile @@ -195,6 +195,11 @@ CFLAGS-sigwait.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-msgrcv.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-open.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-open64.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-pause.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-recv.c = -fexceptions -fasynchronous-unwind-tables +CFLAGS-send.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pt-system.c = -fexceptions diff --git a/libc/ports/ChangeLog.arm b/libc/ports/ChangeLog.arm index c5e5f367f..d06012131 100644 --- a/libc/ports/ChangeLog.arm +++ b/libc/ports/ChangeLog.arm @@ -1,3 +1,8 @@ +2012-11-14 Marcus Shawcroft <marcus.shawcroft@linaro.org> + + * sysdeps/unix/sysv/linux/arm/Makefile (libcrypt-sysdep_routines): Add + libc-do-syscall. + 2012-11-05 Joseph Myers <joseph@codesourcery.com> * sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h diff --git a/libc/ports/ChangeLog.mips b/libc/ports/ChangeLog.mips index cdf4ea3c5..f5e73f8b3 100644 --- a/libc/ports/ChangeLog.mips +++ b/libc/ports/ChangeLog.mips @@ -1,3 +1,12 @@ +2012-11-17 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/mips/bits/atomic.h + (__arch_compare_and_exchange_bool_8_int): Mark __PREV variable + with __attribute__ ((unused)). + (__arch_compare_and_exchange_bool_16_int): Likewise. + (__arch_compare_and_exchange_bool_32_int): Likewise. + (__arch_compare_and_exchange_bool_64_int): Likewise. + 2012-11-06 Maxim Kuvyrkov <maxim@codesourcery.com> * sysdeps/mips/memmove.c: New file. Use memcpy for forward memmove. diff --git a/libc/ports/sysdeps/mips/bits/atomic.h b/libc/ports/sysdeps/mips/bits/atomic.h index 749e16690..c5a26b927 100644 --- a/libc/ports/sysdeps/mips/bits/atomic.h +++ b/libc/ports/sysdeps/mips/bits/atomic.h @@ -261,22 +261,22 @@ typedef uintmax_t uatomic_max_t; /* For all "bool" routines, we return FALSE if exchange succesful. */ # define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \ __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ !__cmp; }) # define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \ __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ !__cmp; }) # define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \ __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ !__cmp; }) # define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \ -({ typeof (*mem) __prev; int __cmp; \ +({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp; \ __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ !__cmp; }) diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile b/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile index d9eb10c9a..bda3ea9f7 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/Makefile @@ -32,6 +32,10 @@ endif # Add a syscall function to each library that needs one. +ifeq ($(subdir),crypt) +libcrypt-sysdep_routines += libc-do-syscall +endif + ifeq ($(subdir),rt) librt-sysdep_routines += libc-do-syscall librt-shared-only-routines += libc-do-syscall diff --git a/libc/posix/Makefile b/libc/posix/Makefile index a9028ac62..7ec8485ee 100644 --- a/libc/posix/Makefile +++ b/libc/posix/Makefile @@ -165,6 +165,7 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make CFLAGS-regex.c = -Wno-strict-prototypes CFLAGS-getaddrinfo.c = -DRESOLVER -fexceptions +CFLAGS-pause.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pread.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pread64.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pwrite.c = -fexceptions -fasynchronous-unwind-tables @@ -335,36 +336,7 @@ $(inst_libexecdir)/getconf: $(inst_bindir)/getconf \ mv -f $@/$$spec.new $@/$$spec; \ done < $(objpfx)getconf.speclist -# eglibc: If we are cross-compiling, build cross-getconf utility and use it -# instead of getconf. - -# We moved a piece of confstr.c to confstr.inc to share the later with -# cross-getconf.c. -confstr.c: confstr.inc - -ifeq (no,$(cross-compiling)) -getconf-dep = $(objpfx)getconf -getconf-cmd = $(run-program-prefix) $(objpfx)getconf -else -getconf-dep = $(objpfx)cross-getconf -getconf-cmd = $(objpfx)cross-getconf - -# Get configuration defines for cross-getconf by preprocessing confstr.c. -$(objpfx)cross-getconf.h: confstr.c - $(compile.c) -E -dM -o - | grep "define _POSIX_V7_ILP32_OFF32\|define _POSIX_V7_ILP32_OFFBIG\|define _POSIX_V7_LP64_OFF64\|define _POSIX_V7_LPBIG_OFFBIG\|_POSIX_V6_ILP32_OFF32\|define _POSIX_V6_ILP32_OFFBIG\|define _POSIX_V6_LP64_OFF64\|define _POSIX_V6_LPBIG_OFFBIG\|_XBS5_ILP32_OFF32\|define _XBS5_ILP32_OFFBIG\|define _XBS5_LP64_OFF64\|define _XBS5_LPBIG_OFFBIG" > $(objpfx)cross-getconf.h - -cross-getconf-CFLAGS = -O -I$(objpfx) - -$(objpfx)cross-getconf: cross-getconf.c $(objpfx)cross-getconf.h - $(native-compile) -endif - -$(objpfx)getconf.speclist: $(getconf-dep) - LC_ALL=C GETCONF_DIR=/dev/null \ - $(getconf-cmd) _POSIX_V7_WIDTH_RESTRICTED_ENVS > $@.new - LC_ALL=C GETCONF_DIR=/dev/null \ - $(getconf-cmd) _POSIX_V6_WIDTH_RESTRICTED_ENVS >> $@.new - LC_ALL=C GETCONF_DIR=/dev/null \ - $(getconf-cmd) _XBS5_WIDTH_RESTRICTED_ENVS >> $@.new +$(objpfx)getconf.speclist: getconf-speclist.c posix-envs.def + $(compile.c) -E -o - \ + | sed -n -e '/@@@PRESENT_/s/@@@PRESENT_//p' > $@.new mv -f $@.new $@ -# eglibc: end. diff --git a/libc/posix/confstr.c b/libc/posix/confstr.c index 3f79d459a..7d86d60bc 100644 --- a/libc/posix/confstr.c +++ b/libc/posix/confstr.c @@ -48,9 +48,53 @@ confstr (name, buf, len) } break; - /* eglibc: We share code in confstr.inc with cross-getconf.c. */ -#include "confstr.inc" - /* eglibc: end. */ + /* For _CS_V7_WIDTH_RESTRICTED_ENVS, _CS_V6_WIDTH_RESTRICTED_ENVS + and _CS_V5_WIDTH_RESTRICTED_ENVS: + + We have to return a newline-separated list of names of + programming environments in which the widths of blksize_t, + cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t, + ssize_t, suseconds_t, tcflag_t, useconds_t, wchar_t, and + wint_t types are no greater than the width of type long. + + Currently this means all environments that the system allows. */ + +#define START_ENV_GROUP(VERSION) \ + case _CS_##VERSION##_WIDTH_RESTRICTED_ENVS: \ + string_len = 0; + +#define END_ENV_GROUP(VERSION) \ + restenvs[string_len++] = '\0'; \ + string = restenvs; \ + break; + +#define KNOWN_ABSENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + /* Empty. */ + +#define KNOWN_PRESENT_ENV_STRING(STR) \ + if (string_len > 0) \ + restenvs[string_len++] = '\n'; \ + memcpy (restenvs + string_len, STR, \ + sizeof STR - 1); \ + string_len += sizeof STR - 1; + +#define KNOWN_PRESENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + KNOWN_PRESENT_ENV_STRING (#ENV_PREFIX "_" #SUFFIX) + +#define UNKNOWN_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + if (__sysconf (_SC_##SC_PREFIX##_##SUFFIX) > 0) \ + { \ + KNOWN_PRESENT_ENVIRONMENT (SC_PREFIX, ENV_PREFIX, SUFFIX) \ + } + +#include "posix-envs.def" + +#undef START_ENV_GROUP +#undef END_ENV_GROUP +#undef KNOWN_ABSENT_ENVIRONMENT +#undef KNOWN_PRESENT_ENV_STRING +#undef KNOWN_PRESENT_ENVIRONMENT +#undef UNKNOWN_ENVIRONMENT case _CS_XBS5_ILP32_OFF32_CFLAGS: case _CS_POSIX_V6_ILP32_OFF32_CFLAGS: diff --git a/libc/posix/confstr.inc b/libc/posix/confstr.inc deleted file mode 100644 index 9f1a0711e..000000000 --- a/libc/posix/confstr.inc +++ /dev/null @@ -1,198 +0,0 @@ -/* Copyright (C) 2008, 2009, 2010 - 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. */ - -/* eglibc: The following piece of code was extracted from - confstr.c to share it with cross-getconf.c. */ - - case _CS_V7_WIDTH_RESTRICTED_ENVS: - /* We have to return a newline-separated list of named of - programming environements in which the widths of blksize_t, - cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t, - ssize_t, suseconds_t, tcflag_t, useconds_t, wchar_t, and - wint_t types are no greater than the width of type long. - - Currently this means all environment which the system allows. */ - string_len = 0; -#ifndef _POSIX_V7_ILP32_OFF32 - if (__sysconf (_SC_V7_ILP32_OFF32) > 0) -#endif -#if !defined _POSIX_V7_ILP32_OFF32 || _POSIX_V7_ILP32_OFF32 > 0 - { - memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFF32", - sizeof "POSIX_V7_ILP32_OFF32" - 1); - string_len += sizeof "POSIX_V7_ILP32_OFF32" - 1; - } -#endif -#ifndef _POSIX_V7_ILP32_OFFBIG - if (__sysconf (_SC_V7_ILP32_OFFBIG) > 0) -#endif -#if !defined _POSIX_V7_ILP32_OFFBIG || _POSIX_V7_ILP32_OFFBIG > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFFBIG", - sizeof "POSIX_V7_ILP32_OFFBIG" - 1); - string_len += sizeof "POSIX_V7_ILP32_OFFBIG" - 1; - } -#endif -#ifndef _POSIX_V7_LP64_OFF64 - if (__sysconf (_SC_V7_LP64_OFF64) > 0) -#endif -#if !defined _POSIX_V7_LP64_OFF64 || _POSIX_V7_LP64_OFF64 > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "POSIX_V7_LP64_OFF64", - sizeof "POSIX_V7_LP64_OFF64" - 1); - string_len += sizeof "POSIX_V7_LP64_OFF64" - 1; - } -#endif -#ifndef _POSIX_V7_LPBIG_OFFBIG - if (__sysconf (_SC_V7_LPBIG_OFFBIG) > 0) -#endif -#if !defined _POSIX_V7_LPBIG_OFFBIG || _POSIX_V7_LPBIG_OFFBIG > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "POSIX_V7_LPBIG_OFFBIG", - sizeof "POSIX_V7_LPBIG_OFFBIG" - 1); - string_len += sizeof "POSIX_V7_LPBIG_OFFBIG" - 1; - } -#endif - restenvs[string_len++] = '\0'; - string = restenvs; - break; - - case _CS_V6_WIDTH_RESTRICTED_ENVS: - /* We have to return a newline-separated list of named of - programming environements in which the widths of blksize_t, - cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t, - ssize_t, suseconds_t, tcflag_t, useconds_t, wchar_t, and - wint_t types are no greater than the width of type long. - - Currently this means all environment which the system allows. */ - string_len = 0; -#ifndef _POSIX_V6_ILP32_OFF32 - if (__sysconf (_SC_V6_ILP32_OFF32) > 0) -#endif -#if !defined _POSIX_V6_ILP32_OFF32 || _POSIX_V6_ILP32_OFF32 > 0 - { - memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFF32", - sizeof "POSIX_V6_ILP32_OFF32" - 1); - string_len += sizeof "POSIX_V6_ILP32_OFF32" - 1; - } -#endif -#ifndef _POSIX_V6_ILP32_OFFBIG - if (__sysconf (_SC_V6_ILP32_OFFBIG) > 0) -#endif -#if !defined _POSIX_V6_ILP32_OFFBIG || _POSIX_V6_ILP32_OFFBIG > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFFBIG", - sizeof "POSIX_V6_ILP32_OFFBIG" - 1); - string_len += sizeof "POSIX_V6_ILP32_OFFBIG" - 1; - } -#endif -#ifndef _POSIX_V6_LP64_OFF64 - if (__sysconf (_SC_V6_LP64_OFF64) > 0) -#endif -#if !defined _POSIX_V6_LP64_OFF64 || _POSIX_V6_LP64_OFF64 > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "POSIX_V6_LP64_OFF64", - sizeof "POSIX_V6_LP64_OFF64" - 1); - string_len += sizeof "POSIX_V6_LP64_OFF64" - 1; - } -#endif -#ifndef _POSIX_V6_LPBIG_OFFBIG - if (__sysconf (_SC_V6_LPBIG_OFFBIG) > 0) -#endif -#if !defined _POSIX_V6_LPBIG_OFFBIG || _POSIX_V6_LPBIG_OFFBIG > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "POSIX_V6_LPBIG_OFFBIG", - sizeof "POSIX_V6_LPBIG_OFFBIG" - 1); - string_len += sizeof "POSIX_V6_LPBIG_OFFBIG" - 1; - } -#endif - restenvs[string_len++] = '\0'; - string = restenvs; - break; - - case _CS_V5_WIDTH_RESTRICTED_ENVS: - /* We have to return a newline-separated list of named of - programming environements in which the widths of blksize_t, - cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t, - ssize_t, suseconds_t, tcflag_t, useconds_t, wchar_t, and - wint_t types are no greater than the width of type long. - - Currently this means all environment which the system allows. */ - string_len = 0; -#ifndef _XBS5_ILP32_OFF32 - if (__sysconf (_SC_XBS5_ILP32_OFF32) > 0) -#endif -#if !defined _XBS5_ILP32_OFF32 || _XBS5_ILP32_OFF32 > 0 - { - memcpy (restenvs + string_len, "XBS5_ILP32_OFF32", - sizeof "XBS5_ILP32_OFF32" - 1); - string_len += sizeof "XBS5_ILP32_OFF32" - 1; - } -#endif -#ifndef _XBS5_ILP32_OFFBIG - if (__sysconf (_SC_XBS5_ILP32_OFFBIG) > 0) -#endif -#if !defined _XBS5_ILP32_OFFBIG || _XBS5_ILP32_OFFBIG > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "XBS5_ILP32_OFFBIG", - sizeof "XBS5_ILP32_OFFBIG" - 1); - string_len += sizeof "XBS5_ILP32_OFFBIG" - 1; - } -#endif -#ifndef _XBS5_LP64_OFF64 - if (__sysconf (_SC_XBS5_LP64_OFF64) > 0) -#endif -#if !defined _XBS5_LP64_OFF64 || _XBS5_LP64_OFF64 > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "XBS5_LP64_OFF64", - sizeof "XBS5_LP64_OFF64" - 1); - string_len += sizeof "XBS5_LP64_OFF64" - 1; - } -#endif -#ifndef _XBS5_LPBIG_OFFBIG - if (__sysconf (_SC_XBS5_LPBIG_OFFBIG) > 0) -#endif -#if !defined _XBS5_LPBIG_OFFBIG || _XBS5_LPBIG_OFFBIG > 0 - { - if (string_len) - restenvs[string_len++] = '\n'; - memcpy (restenvs + string_len, "XBS5_LPBIG_OFFBIG", - sizeof "XBS5_LPBIG_OFFBIG" - 1); - string_len += sizeof "XBS5_LPBIG_OFFBIG" - 1; - } -#endif - restenvs[string_len++] = '\0'; - string = restenvs; - break; diff --git a/libc/posix/cross-getconf.c b/libc/posix/cross-getconf.c deleted file mode 100644 index 7cbd9c7bc..000000000 --- a/libc/posix/cross-getconf.c +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright (C) 2008 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -/* Undefine macros that should be defined in cross-getconf.h. */ -#undef _POSIX_V7_ILP32_OFF32 -#undef _POSIX_V7_ILP32_OFFBIG -#undef _POSIX_V7_LP64_OFF64 -#undef _POSIX_V7_LPBIG_OFFBIG -#undef _POSIX_V6_ILP32_OFF32 -#undef _POSIX_V6_ILP32_OFFBIG -#undef _POSIX_V6_LP64_OFF64 -#undef _POSIX_V6_LPBIG_OFFBIG -#undef _XBS5_ILP32_OFF32 -#undef _XBS5_ILP32_OFFBIG -#undef _XBS5_LP64_OFF64 -#undef _XBS5_LPBIG_OFFBIG - -#include "cross-getconf.h" - -/* Define macros cross-getconf.h doesn't define to (-1). - This will prevent using host's __sysconf in confstr.inc. */ -#ifndef _POSIX_V7_ILP32_OFF32 -# define _POSIX_V7_ILP32_OFF32 (-1) -#endif -#ifndef _POSIX_V7_ILP32_OFFBIG -# define _POSIX_V7_ILP32_OFFBIG (-1) -#endif -#ifndef _POSIX_V7_LP64_OFF64 -# define _POSIX_V7_LP64_OFF64 (-1) -#endif -#ifndef _POSIX_V7_LPBIG_OFFBIG -# define _POSIX_V7_LPBIG_OFFBIG (-1) -#endif -#ifndef _POSIX_V6_ILP32_OFF32 -# define _POSIX_V6_ILP32_OFF32 (-1) -#endif -#ifndef _POSIX_V6_ILP32_OFFBIG -# define _POSIX_V6_ILP32_OFFBIG (-1) -#endif -#ifndef _POSIX_V6_LP64_OFF64 -# define _POSIX_V6_LP64_OFF64 (-1) -#endif -#ifndef _POSIX_V6_LPBIG_OFFBIG -# define _POSIX_V6_LPBIG_OFFBIG (-1) -#endif -#ifndef _XBS5_ILP32_OFF32 -# define _XBS5_ILP32_OFF32 (-1) -#endif -#ifndef _XBS5_ILP32_OFFBIG -# define _XBS5_ILP32_OFFBIG (-1) -#endif -#ifndef _XBS5_LP64_OFF64 -# define _XBS5_LP64_OFF64 (-1) -#endif -#ifndef _XBS5_LPBIG_OFFBIG -# define _XBS5_LPBIG_OFFBIG (-1) -#endif - -#undef _CS_V5_WIDTH_RESTRICTED_ENVS -#define _CS_V5_WIDTH_RESTRICTED_ENVS 5 - -#undef _CS_V6_WIDTH_RESTRICTED_ENVS -#define _CS_V6_WIDTH_RESTRICTED_ENVS 6 - -#undef _CS_V7_WIDTH_RESTRICTED_ENVS -#define _CS_V7_WIDTH_RESTRICTED_ENVS 7 - -/* Cross-getconf is a very simple program that assumes fixed - input and produces fixed output. It handles only cases - that are necessary to cross-compile EGLIBC. */ - -void -cross_getconf (int name) -{ - const char *string = ""; - size_t string_len = 1; - - /* Note that this buffer must be large enough for the longest strings - used below. */ - char restenvs[4 * sizeof "POSIX_V7_LPBIG_OFFBIG"]; - - switch (name) - { -#include "confstr.inc" - } - - printf ("%.*s\n", (int) string_len, string); -} - -int -main (int argc, char *argv[]) -{ - const char *getconf_dir; - - if (argc != 2) - { - fprintf (stderr, - "%s: must be called with exactly one argument\n", argv[0]); - return 1; - } - - getconf_dir = getenv ("GETCONF_DIR"); - if (getconf_dir == NULL - || strcmp (getconf_dir, "/dev/null") != 0) - { - fprintf (stderr, "%s: GETCONF_DIR should be /dev/null\n", argv[0]); - return 1; - } - - if (strcmp (argv[1], "_POSIX_V7_WIDTH_RESTRICTED_ENVS") == 0) - cross_getconf (_CS_V7_WIDTH_RESTRICTED_ENVS); - else if (strcmp (argv[1], "_POSIX_V6_WIDTH_RESTRICTED_ENVS") == 0) - cross_getconf (_CS_V6_WIDTH_RESTRICTED_ENVS); - else if (strcmp (argv[1], "_XBS5_WIDTH_RESTRICTED_ENVS") == 0) - cross_getconf (_CS_V5_WIDTH_RESTRICTED_ENVS); - else - { - fprintf (stderr, - "%s: the only supported arguments value are " - "_POSIX_V7_WIDTH_RESTRICTED_ENVS, " - "_POSIX_V6_WIDTH_RESTRICTED_ENVS, and " - "_XBS5_WIDTH_RESTRICTED_ENVS\n", argv[0]); - return 1; - } - return 0; -} diff --git a/libc/posix/getconf-speclist.c b/libc/posix/getconf-speclist.c new file mode 100644 index 000000000..72c5c3de8 --- /dev/null +++ b/libc/posix/getconf-speclist.c @@ -0,0 +1,42 @@ +/* List POSIX compilation environments for this libc. + Copyright (C) 2012 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, see + <http://www.gnu.org/licenses/>. */ + +#include <unistd.h> + +#define START_ENV_GROUP(VERSION) \ + /* Empty. */ + +#define END_ENV_GROUP(VERSION) \ + /* Empty. */ + +#define KNOWN_ABSENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + /* Empty. */ + +#define KNOWN_PRESENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + @@@PRESENT_##ENV_PREFIX##_##SUFFIX + +#define UNKNOWN_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + /* Empty. */ + +#include "posix-envs.def" + +#undef START_ENV_GROUP +#undef END_ENV_GROUP +#undef KNOWN_ABSENT_ENVIRONMENT +#undef KNOWN_PRESENT_ENVIRONMENT +#undef UNKNOWN_ENVIRONMENT diff --git a/libc/posix/posix-envs.def b/libc/posix/posix-envs.def new file mode 100644 index 000000000..c32ea8acf --- /dev/null +++ b/libc/posix/posix-envs.def @@ -0,0 +1,151 @@ +/* Handle POSIX compilation environments that may or may not be present. + Copyright (C) 2012 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, see + <http://www.gnu.org/licenses/>. */ + +/* Before including this file, the including file must have included + <bits/environments.h> (generally via <unistd.h>) and must have + defined the following macros, exactly one of which will be called + for each POSIX environment: + + KNOWN_PRESENT_ENVIRONMENT, for POSIX environments that are known to + be supported in this libc. + + KNOWN_ABSENT_ENVIRONMENT, for POSIX environments that are known not + to be supported on this system. + + UNKNOWN_ENVIRONMENT, for POSIX environments not supported in this + libc but possibly supported by another libc on the same system, + that can be selected using the same compiler but different + compilation options. + + Each macro has arguments (SC_PREFIX, ENV_PREFIX, SUFFIX). The + corresponding argument to sysconf is _SC_##SC_PREFIX##_##SUFFIX. + The environment name, as used with getconf, is + ENV_PREFIX##_##SUFFIX, and the corresponding macro is the same with + a leading "_". + + In addition, the macros START_ENV_GROUP and END_ENV_GROUP must be + defined. These are called with arguments V5, V6, V7 before and + after the relevant groups of environments. */ + +START_ENV_GROUP (V7) + +#if _POSIX_V7_ILP32_OFF32 > 0 +KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32) +#elif defined _POSIX_V7_ILP32_OFF32 +KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32) +#else +UNKNOWN_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32) +#endif + +#if _POSIX_V7_ILP32_OFFBIG > 0 +KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG) +#elif defined _POSIX_V7_ILP32_OFFBIG +KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG) +#else +UNKNOWN_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG) +#endif + +#if _POSIX_V7_LP64_OFF64 > 0 +KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64) +#elif defined _POSIX_V7_LP64_OFF64 +KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64) +#else +UNKNOWN_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64) +#endif + +#if _POSIX_V7_LPBIG_OFFBIG > 0 +KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG) +#elif defined _POSIX_V7_LPBIG_OFFBIG +KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG) +#else +UNKNOWN_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG) +#endif + +END_ENV_GROUP (V7) + +START_ENV_GROUP (V6) + +#if _POSIX_V6_ILP32_OFF32 > 0 +KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32) +#elif defined _POSIX_V6_ILP32_OFF32 +KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32) +#else +UNKNOWN_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32) +#endif + +#if _POSIX_V6_ILP32_OFFBIG > 0 +KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG) +#elif defined _POSIX_V6_ILP32_OFFBIG +KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG) +#else +UNKNOWN_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG) +#endif + +#if _POSIX_V6_LP64_OFF64 > 0 +KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64) +#elif defined _POSIX_V6_LP64_OFF64 +KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64) +#else +UNKNOWN_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64) +#endif + +#if _POSIX_V6_LPBIG_OFFBIG > 0 +KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG) +#elif defined _POSIX_V6_LPBIG_OFFBIG +KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG) +#else +UNKNOWN_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG) +#endif + +END_ENV_GROUP (V6) + +START_ENV_GROUP (V5) + +#if _XBS5_ILP32_OFF32 > 0 +KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32) +#elif defined _XBS5_ILP32_OFF32 +KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32) +#else +UNKNOWN_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32) +#endif + +#if _XBS5_ILP32_OFFBIG > 0 +KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG) +#elif defined _XBS5_ILP32_OFFBIG +KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG) +#else +UNKNOWN_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG) +#endif + +#if _XBS5_LP64_OFF64 > 0 +KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, LP64_OFF64) +#elif defined _XBS5_LP64_OFF64 +KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, LP64_OFF64) +#else +UNKNOWN_ENVIRONMENT (XBS5, XBS5, LP64_OFF64) +#endif + +#if _XBS5_LPBIG_OFFBIG > 0 +KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG) +#elif defined _XBS5_LPBIG_OFFBIG +KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG) +#else +UNKNOWN_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG) +#endif + +END_ENV_GROUP (V5) diff --git a/libc/resolv/netdb.h b/libc/resolv/netdb.h index 19bcc87fd..41cf06f07 100644 --- a/libc/resolv/netdb.h +++ b/libc/resolv/netdb.h @@ -76,7 +76,7 @@ extern int *__h_errno_location (void) __THROW __attribute__ ((__const__)); # define NO_ADDRESS NO_DATA /* No address, look for MX record. */ #endif -#ifdef __USE_XOPEN2K +#if defined __USE_XOPEN2K || defined __USE_XOPEN_EXTENDED /* Highest reserved Internet port number. */ # define IPPORT_RESERVED 1024 #endif diff --git a/libc/scripts/check-local-headers.sh b/libc/scripts/check-local-headers.sh index 5cc8def3e..e744f8c74 100755 --- a/libc/scripts/check-local-headers.sh +++ b/libc/scripts/check-local-headers.sh @@ -27,12 +27,13 @@ shopt -s nullglob # Search all dependency files for file names in the include directory. # There are a few system headers we are known to use. -# These include Linux kernel headers (asm*, arch, and linux). +# These include Linux kernel headers (asm*, arch, and linux), +# and Mach kernel headers (mach). exec ${AWK} -v includedir="$includedir" ' BEGIN { status = 0 exclude = "^" includedir \ - "/(.*-.*-.*/|)(asm[-/]|arch|linux/|selinux/|gd|nss3/|c\\+\\+/|sys/(capability|sdt(|-config))\\.h|libaudit\\.h)" + "/(.*-.*-.*/|)(asm[-/]|arch|linux/|selinux/|mach/|gd|nss3/|c\\+\\+/|sys/(capability|sdt(|-config))\\.h|libaudit\\.h)" } /^[^ ]/ && $1 ~ /.*:/ { obj = $1 } { diff --git a/libc/soft-fp/op-common.h b/libc/soft-fp/op-common.h index db75af53e..12fb16e5e 100644 --- a/libc/soft-fp/op-common.h +++ b/libc/soft-fp/op-common.h @@ -134,6 +134,12 @@ do { \ #define _FP_PACK_SEMIRAW(fs, wc, X) \ do { \ _FP_ROUND(wc, X); \ + if (X##_e == 0 && !_FP_FRAC_ZEROP_##wc(X)) \ + { \ + if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) \ + || (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \ + FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \ + } \ if (_FP_FRAC_HIGH_##fs(X) \ & (_FP_OVERFLOW_##fs >> 1)) \ { \ @@ -143,24 +149,15 @@ do { \ _FP_OVERFLOW_SEMIRAW(fs, wc, X); \ } \ _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ - if (!_FP_EXP_NORMAL(fs, wc, X) && !_FP_FRAC_ZEROP_##wc(X)) \ + if (X##_e == _FP_EXPMAX_##fs && !_FP_FRAC_ZEROP_##wc(X)) \ { \ - if (X##_e == 0) \ + if (!_FP_KEEPNANFRACP) \ { \ - if ((FP_CUR_EXCEPTIONS & FP_EX_INEXACT) \ - || (FP_TRAPPING_EXCEPTIONS & FP_EX_UNDERFLOW)) \ - FP_SET_EXCEPTION(FP_EX_UNDERFLOW); \ + _FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs); \ + X##_s = _FP_NANSIGN_##fs; \ } \ else \ - { \ - if (!_FP_KEEPNANFRACP) \ - { \ - _FP_FRAC_SET_##wc(X, _FP_NANFRAC_##fs); \ - X##_s = _FP_NANSIGN_##fs; \ - } \ - else \ - _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs; \ - } \ + _FP_FRAC_HIGH_RAW_##fs(X) |= _FP_QNANBIT_##fs; \ } \ } while (0) diff --git a/libc/soft-fp/soft-fp.h b/libc/soft-fp/soft-fp.h index 750c7fea2..49a87706c 100644 --- a/libc/soft-fp/soft-fp.h +++ b/libc/soft-fp/soft-fp.h @@ -158,22 +158,24 @@ do { \ #define _FP_ROUND(wc, X) \ do { \ if (_FP_FRAC_LOW_##wc(X) & 7) \ - FP_SET_EXCEPTION(FP_EX_INEXACT); \ - switch (FP_ROUNDMODE) \ - { \ - case FP_RND_NEAREST: \ - _FP_ROUND_NEAREST(wc,X); \ - break; \ - case FP_RND_ZERO: \ - _FP_ROUND_ZERO(wc,X); \ - break; \ - case FP_RND_PINF: \ - _FP_ROUND_PINF(wc,X); \ - break; \ - case FP_RND_MINF: \ - _FP_ROUND_MINF(wc,X); \ - break; \ - } \ + { \ + FP_SET_EXCEPTION(FP_EX_INEXACT); \ + switch (FP_ROUNDMODE) \ + { \ + case FP_RND_NEAREST: \ + _FP_ROUND_NEAREST(wc,X); \ + break; \ + case FP_RND_ZERO: \ + _FP_ROUND_ZERO(wc,X); \ + break; \ + case FP_RND_PINF: \ + _FP_ROUND_PINF(wc,X); \ + break; \ + case FP_RND_MINF: \ + _FP_ROUND_MINF(wc,X); \ + break; \ + } \ + } \ } while (0) #define FP_CLS_NORMAL 0 diff --git a/libc/stdio-common/tst-put-error.c b/libc/stdio-common/tst-put-error.c index 115dbd509..7b9549172 100644 --- a/libc/stdio-common/tst-put-error.c +++ b/libc/stdio-common/tst-put-error.c @@ -1,3 +1,22 @@ +/* Verify that print functions return error when there is an I/O error. + + Copyright (C) 2005-2012 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, see + <http://www.gnu.org/licenses/>. */ + #include <errno.h> #include <error.h> #include <stdio.h> @@ -26,6 +45,13 @@ do_test (void) printf ("fprintf = %d\n", n); if (n >= 0) error (EXIT_FAILURE, 0, "second fprintf succeeded"); + + /* Padded printing takes a different code path. */ + n = fprintf (fp, "%10000s", "foo"); + printf ("fprintf = %d\n", n); + if (n >= 0) + error (EXIT_FAILURE, 0, "padded fprintf succeeded"); + return 0; } diff --git a/libc/stdio-common/vfprintf.c b/libc/stdio-common/vfprintf.c index 0a48ce2b5..209824e32 100644 --- a/libc/stdio-common/vfprintf.c +++ b/libc/stdio-common/vfprintf.c @@ -88,8 +88,18 @@ # define PUT(F, S, N) _IO_sputn ((F), (S), (N)) # define PAD(Padchar) \ - if (width > 0) \ - done_add (_IO_padn (s, (Padchar), width)) + do { \ + if (width > 0) \ + { \ + unsigned int d = _IO_padn (s, (Padchar), width); \ + if (__builtin_expect (d == EOF, 0)) \ + { \ + done = -1; \ + goto all_done; \ + } \ + done_add (d); \ + } \ + } while (0) # define PUTC(C, F) _IO_putc_unlocked (C, F) # define ORIENT if (_IO_vtable_offset (s) == 0 && _IO_fwide (s, -1) != -1)\ return -1 @@ -107,8 +117,18 @@ # define PUT(F, S, N) _IO_sputn ((F), (S), (N)) # define PAD(Padchar) \ - if (width > 0) \ - done_add (_IO_wpadn (s, (Padchar), width)) + do { \ + if (width > 0) \ + { \ + unsigned int d = _IO_wpadn (s, (Padchar), width); \ + if (__builtin_expect (d == EOF, 0)) \ + { \ + done = -1; \ + goto all_done; \ + } \ + done_add (d); \ + } \ + } while (0) # define PUTC(C, F) _IO_putwc_unlocked (C, F) # define ORIENT if (_IO_fwide (s, 1) != 1) return -1 diff --git a/libc/sysdeps/ieee754/ldbl-128/s_log1pl.c b/libc/sysdeps/ieee754/ldbl-128/s_log1pl.c index a96853e2d..3b9c7573f 100644 --- a/libc/sysdeps/ieee754/ldbl-128/s_log1pl.c +++ b/libc/sysdeps/ieee754/ldbl-128/s_log1pl.c @@ -141,6 +141,12 @@ __log1pl (long double xm1) && (u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0) return xm1; + if ((hx & 0x7fffffff) < 0x3f8e0000) + { + if ((int) xm1 == 0) + return xm1; + } + x = xm1 + 1.0L; /* log1p(-1) = -inf */ diff --git a/libc/sysdeps/posix/sysconf.c b/libc/sysdeps/posix/sysconf.c index bfe28b47e..99043b755 100644 --- a/libc/sysdeps/posix/sysconf.c +++ b/libc/sysdeps/posix/sysconf.c @@ -790,80 +790,31 @@ __sysconf (name) return -1; #endif - case _SC_XBS5_ILP32_OFF32: -#ifdef _XBS5_ILP32_OFF32 - return _XBS5_ILP32_OFF32; -#else - return __sysconf_check_spec ("ILP32_OFF32"); -#endif - case _SC_XBS5_ILP32_OFFBIG: -#ifdef _XBS5_ILP32_OFFBIG - return _XBS5_ILP32_OFFBIG; -#else - return __sysconf_check_spec ("ILP32_OFFBIG"); -#endif - case _SC_XBS5_LP64_OFF64: -#ifdef _XBS5_LP64_OFF64 - return _XBS5_LP64_OFF64; -#else - return __sysconf_check_spec ("LP64_OFF64"); -#endif - case _SC_XBS5_LPBIG_OFFBIG: -#ifdef _XBS5_LPBIG_OFFBIG - return _XBS5_LPBIG_OFFBIG; -#else - return __sysconf_check_spec ("LPBIG_OFFBIG"); -#endif +#define START_ENV_GROUP(VERSION) \ + /* Empty. */ - case _SC_V6_ILP32_OFF32: -#ifdef _POSIX_V6_ILP32_OFF32 - return _POSIX_V6_ILP32_OFF32; -#else - return __sysconf_check_spec ("ILP32_OFF32"); -#endif - case _SC_V6_ILP32_OFFBIG: -#ifdef _POSIX_V6_ILP32_OFFBIG - return _POSIX_V6_ILP32_OFFBIG; -#else - return __sysconf_check_spec ("ILP32_OFFBIG"); -#endif - case _SC_V6_LP64_OFF64: -#ifdef _POSIX_V6_LP64_OFF64 - return _POSIX_V6_LP64_OFF64; -#else - return __sysconf_check_spec ("LP64_OFF64"); -#endif - case _SC_V6_LPBIG_OFFBIG: -#ifdef _POSIX_V6_LPBIG_OFFBIG - return _POSIX_V6_LPBIG_OFFBIG; -#else - return __sysconf_check_spec ("LPBIG_OFFBIG"); -#endif +#define END_ENV_GROUP(VERSION) \ + /* Empty. */ - case _SC_V7_ILP32_OFF32: -#ifdef _POSIX_V7_ILP32_OFF32 - return _POSIX_V7_ILP32_OFF32; -#else - return __sysconf_check_spec ("ILP32_OFF32"); -#endif - case _SC_V7_ILP32_OFFBIG: -#ifdef _POSIX_V7_ILP32_OFFBIG - return _POSIX_V7_ILP32_OFFBIG; -#else - return __sysconf_check_spec ("ILP32_OFFBIG"); -#endif - case _SC_V7_LP64_OFF64: -#ifdef _POSIX_V7_LP64_OFF64 - return _POSIX_V7_LP64_OFF64; -#else - return __sysconf_check_spec ("LP64_OFF64"); -#endif - case _SC_V7_LPBIG_OFFBIG: -#ifdef _POSIX_V7_LPBIG_OFFBIG - return _POSIX_V7_LPBIG_OFFBIG; -#else - return __sysconf_check_spec ("LPBIG_OFFBIG"); -#endif +#define KNOWN_ABSENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + case _SC_##SC_PREFIX##_##SUFFIX: \ + return _##ENV_PREFIX##_##SUFFIX; + +#define KNOWN_PRESENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + case _SC_##SC_PREFIX##_##SUFFIX: \ + return _##ENV_PREFIX##_##SUFFIX; + +#define UNKNOWN_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX) \ + case _SC_##SC_PREFIX##_##SUFFIX: \ + return __sysconf_check_spec (#SUFFIX); + +#include <posix/posix-envs.def> + +#undef START_ENV_GROUP +#undef END_ENV_GROUP +#undef KNOWN_ABSENT_ENVIRONMENT +#undef KNOWN_PRESENT_ENVIRONMENT +#undef UNKNOWN_ENVIRONMENT case _SC_XOPEN_LEGACY: return _XOPEN_LEGACY; diff --git a/libc/sysdeps/sparc/sparc-ifunc.h b/libc/sysdeps/sparc/sparc-ifunc.h index db53a7126..7de7e5153 100644 --- a/libc/sysdeps/sparc/sparc-ifunc.h +++ b/libc/sysdeps/sparc/sparc-ifunc.h @@ -109,4 +109,6 @@ END (__##name) } \ __asm__ (".type " #name ", %gnu_indirect_function"); +# define sparc_libc_ifunc(name, expr) sparc_libm_ifunc (name, expr) + #endif /* __ASSEMBLER__ */ diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile index 7358bdb16..4ad7aff91 100644 --- a/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile +++ b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile @@ -1,3 +1,11 @@ +ifeq ($(subdir),crypt) +libcrypt-sysdep_routines += md5-crop sha256-crop sha512-crop +endif + +ifeq ($(subdir),locale) +localedef-aux += md5-crop +endif + ifeq ($(subdir),string) sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \ memset-niagara1 memcpy-niagara4 memset-niagara4 diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/md5-block.c b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/md5-block.c new file mode 100644 index 000000000..3765cabae --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/md5-block.c @@ -0,0 +1 @@ +#include <sparc64/multiarch/md5-block.c> diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/md5-crop.S b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/md5-crop.S new file mode 100644 index 000000000..11a3a8148 --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/md5-crop.S @@ -0,0 +1 @@ +#include <sparc64/multiarch/md5-crop.S> diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-block.c b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-block.c new file mode 100644 index 000000000..600c602b6 --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-block.c @@ -0,0 +1 @@ +#include <sparc64/multiarch/sha256-block.c> diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-crop.S b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-crop.S new file mode 100644 index 000000000..489540585 --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha256-crop.S @@ -0,0 +1 @@ +#include <sparc64/multiarch/sha256-crop.S> diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-block.c b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-block.c new file mode 100644 index 000000000..7c7c54e5a --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-block.c @@ -0,0 +1 @@ +#include <sparc64/multiarch/sha512-block.c> diff --git a/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-crop.S b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-crop.S new file mode 100644 index 000000000..cc74a99d3 --- /dev/null +++ b/libc/sysdeps/sparc/sparc32/sparcv9/multiarch/sha512-crop.S @@ -0,0 +1 @@ +#include <sparc64/multiarch/sha512-crop.S> diff --git a/libc/sysdeps/sparc/sparc64/multiarch/Makefile b/libc/sysdeps/sparc/sparc64/multiarch/Makefile index 7358bdb16..4ad7aff91 100644 --- a/libc/sysdeps/sparc/sparc64/multiarch/Makefile +++ b/libc/sysdeps/sparc/sparc64/multiarch/Makefile @@ -1,3 +1,11 @@ +ifeq ($(subdir),crypt) +libcrypt-sysdep_routines += md5-crop sha256-crop sha512-crop +endif + +ifeq ($(subdir),locale) +localedef-aux += md5-crop +endif + ifeq ($(subdir),string) sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \ memset-niagara1 memcpy-niagara4 memset-niagara4 diff --git a/libc/sysdeps/sparc/sparc64/multiarch/md5-block.c b/libc/sysdeps/sparc/sparc64/multiarch/md5-block.c new file mode 100644 index 000000000..7c1a3a368 --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/multiarch/md5-block.c @@ -0,0 +1,29 @@ +#include <sparc-ifunc.h> + +#define __md5_process_block __md5_process_block_generic +extern void __md5_process_block_generic (const void *buffer, size_t len, + struct md5_ctx *ctx); + +#include <crypt/md5-block.c> + +#undef __md5_process_block + +extern void __md5_process_block_crop (const void *buffer, size_t len, + struct md5_ctx *ctx); +static bool cpu_supports_md5(int hwcap) +{ + unsigned long cfr; + + if (!(hwcap & HWCAP_SPARC_CRYPTO)) + return false; + + __asm__ ("rd %%asr26, %0" : "=r" (cfr)); + if (cfr & (1 << 4)) + return true; + + return false; +} + +extern void __md5_process_block (const void *buffer, size_t len, + struct md5_ctx *ctx); +sparc_libc_ifunc(__md5_process_block, cpu_supports_md5(hwcap) ? __md5_process_block_crop : __md5_process_block_generic); diff --git a/libc/sysdeps/sparc/sparc64/multiarch/md5-crop.S b/libc/sysdeps/sparc/sparc64/multiarch/md5-crop.S new file mode 100644 index 000000000..702dda4c2 --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/multiarch/md5-crop.S @@ -0,0 +1,110 @@ +/* MD5 using sparc crypto opcodes. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller (davem@davemloft.net) + + 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, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#define ASI_PL 0x88 + +#define MD5 \ + .word 0x81b02800; + + .text + .align 32 +ENTRY(__md5_process_block_crop) + /* %o0=buffer, %o1=len, %o2=CTX */ + ld [%o2 + 0x10], %g1 + add %g1, %o1, %o4 + st %o4, [%o2 + 0x10] + clr %o5 + cmp %o4, %g1 + movlu %icc, 1, %o5 +#ifdef __arch64__ + srlx %o1, 32, %o4 + add %o5, %o4, %o5 +#endif + ld [%o2 + 0x14], %o4 + add %o4, %o5, %o4 + st %o4, [%o2 + 0x14] + lda [%o2] ASI_PL, %f0 + add %o2, 0x4, %g1 + lda [%g1] ASI_PL, %f1 + add %o2, 0x8, %g1 + andcc %o0, 0x7, %g0 + lda [%g1] ASI_PL, %f2 + add %o2, 0xc, %g1 + bne,pn %xcc, 10f + lda [%g1] ASI_PL, %f3 + +1: + ldd [%o0 + 0x00], %f8 + ldd [%o0 + 0x08], %f10 + ldd [%o0 + 0x10], %f12 + ldd [%o0 + 0x18], %f14 + ldd [%o0 + 0x20], %f16 + ldd [%o0 + 0x28], %f18 + ldd [%o0 + 0x30], %f20 + ldd [%o0 + 0x38], %f22 + + MD5 + + subcc %o1, 64, %o1 + bne,pt %xcc, 1b + add %o0, 0x40, %o0 + +5: + sta %f0, [%o2] ASI_PL + add %o2, 0x4, %g1 + sta %f1, [%g1] ASI_PL + add %o2, 0x8, %g1 + sta %f2, [%g1] ASI_PL + add %o2, 0xc, %g1 + retl + sta %f3, [%g1] ASI_PL +10: + alignaddr %o0, %g0, %o0 + + ldd [%o0 + 0x00], %f10 +1: + ldd [%o0 + 0x08], %f12 + ldd [%o0 + 0x10], %f14 + ldd [%o0 + 0x18], %f16 + ldd [%o0 + 0x20], %f18 + ldd [%o0 + 0x28], %f20 + ldd [%o0 + 0x30], %f22 + ldd [%o0 + 0x38], %f24 + ldd [%o0 + 0x40], %f26 + + faligndata %f10, %f12, %f8 + faligndata %f12, %f14, %f10 + faligndata %f14, %f16, %f12 + faligndata %f16, %f18, %f14 + faligndata %f18, %f20, %f16 + faligndata %f20, %f22, %f18 + faligndata %f22, %f24, %f20 + faligndata %f24, %f26, %f22 + + MD5 + + subcc %o1, 64, %o1 + fsrc2 %f26, %f10 + bne,pt %xcc, 1b + add %o0, 0x40, %o0 + + ba,a,pt %xcc, 5b +END(__md5_process_block_crop) diff --git a/libc/sysdeps/sparc/sparc64/multiarch/sha256-block.c b/libc/sysdeps/sparc/sparc64/multiarch/sha256-block.c new file mode 100644 index 000000000..79966b93d --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/multiarch/sha256-block.c @@ -0,0 +1,30 @@ +#include <sparc-ifunc.h> + +#define sha256_process_block sha256_process_block_generic +extern void sha256_process_block_generic (const void *buffer, size_t len, + struct sha256_ctx *ctx); + +#include <crypt/sha256-block.c> + +#undef sha256_process_block + +extern void __sha256_process_block_crop (const void *buffer, size_t len, + struct sha256_ctx *ctx); + +static bool cpu_supports_sha256(int hwcap) +{ + unsigned long cfr; + + if (!(hwcap & HWCAP_SPARC_CRYPTO)) + return false; + + __asm__ ("rd %%asr26, %0" : "=r" (cfr)); + if (cfr & (1 << 6)) + return true; + + return false; +} + +extern void sha256_process_block (const void *buffer, size_t len, + struct sha256_ctx *ctx); +sparc_libc_ifunc(sha256_process_block, cpu_supports_sha256(hwcap) ? __sha256_process_block_crop : sha256_process_block_generic); diff --git a/libc/sysdeps/sparc/sparc64/multiarch/sha256-crop.S b/libc/sysdeps/sparc/sparc64/multiarch/sha256-crop.S new file mode 100644 index 000000000..b79f536c4 --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/multiarch/sha256-crop.S @@ -0,0 +1,101 @@ +/* SHA256 using sparc crypto opcodes. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller (davem@davemloft.net) + + 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, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#define SHA256 \ + .word 0x81b02840; + + .text + .align 32 +ENTRY(__sha256_process_block_crop) + /* %o0=buffer, %o1=len, %o2=CTX */ + ldx [%o2 + 0x20], %g1 + add %g1, %o1, %g1 + stx %g1, [%o2 + 0x20] + + ld [%o2 + 0x00], %f0 + ld [%o2 + 0x04], %f1 + ld [%o2 + 0x08], %f2 + ld [%o2 + 0x0c], %f3 + ld [%o2 + 0x10], %f4 + ld [%o2 + 0x14], %f5 + andcc %o1, 0x7, %g0 + ld [%o2 + 0x18], %f6 + bne,pn %xcc, 10f + ld [%o2 + 0x1c], %f7 + +1: + ldd [%o0 + 0x00], %f8 + ldd [%o0 + 0x08], %f10 + ldd [%o0 + 0x10], %f12 + ldd [%o0 + 0x18], %f14 + ldd [%o0 + 0x20], %f16 + ldd [%o0 + 0x28], %f18 + ldd [%o0 + 0x30], %f20 + ldd [%o0 + 0x38], %f22 + + SHA256 + + subcc %o1, 0x40, %o1 + bne,pt %xcc, 1b + add %o0, 0x40, %o0 + +5: + st %f0, [%o2 + 0x00] + st %f1, [%o2 + 0x04] + st %f2, [%o2 + 0x08] + st %f3, [%o2 + 0x0c] + st %f4, [%o2 + 0x10] + st %f5, [%o2 + 0x14] + st %f6, [%o2 + 0x18] + retl + st %f7, [%o2 + 0x1c] +10: + alignaddr %o0, %g0, %o0 + + ldd [%o0 + 0x00], %f10 +1: + ldd [%o0 + 0x08], %f12 + ldd [%o0 + 0x10], %f14 + ldd [%o0 + 0x18], %f16 + ldd [%o0 + 0x20], %f18 + ldd [%o0 + 0x28], %f20 + ldd [%o0 + 0x30], %f22 + ldd [%o0 + 0x38], %f24 + ldd [%o0 + 0x40], %f26 + + faligndata %f10, %f12, %f8 + faligndata %f12, %f14, %f10 + faligndata %f14, %f16, %f12 + faligndata %f16, %f18, %f14 + faligndata %f18, %f20, %f16 + faligndata %f20, %f22, %f18 + faligndata %f22, %f24, %f20 + faligndata %f24, %f26, %f22 + + SHA256 + + subcc %o1, 0x40, %o1 + fsrc2 %f26, %f10 + bne,pt %xcc, 1b + add %o0, 0x40, %o0 + + ba,a,pt %xcc, 5b +END(__sha256_process_block_crop) diff --git a/libc/sysdeps/sparc/sparc64/multiarch/sha512-block.c b/libc/sysdeps/sparc/sparc64/multiarch/sha512-block.c new file mode 100644 index 000000000..0d1c3dd6d --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/multiarch/sha512-block.c @@ -0,0 +1,30 @@ +#include <sparc-ifunc.h> + +#define sha512_process_block sha512_process_block_generic +extern void sha512_process_block_generic (const void *buffer, size_t len, + struct sha512_ctx *ctx); + +#include <crypt/sha512-block.c> + +#undef sha512_process_block + +extern void __sha512_process_block_crop (const void *buffer, size_t len, + struct sha512_ctx *ctx); + +static bool cpu_supports_sha512(int hwcap) +{ + unsigned long cfr; + + if (!(hwcap & HWCAP_SPARC_CRYPTO)) + return false; + + __asm__ ("rd %%asr26, %0" : "=r" (cfr)); + if (cfr & (1 << 6)) + return true; + + return false; +} + +extern void sha512_process_block (const void *buffer, size_t len, + struct sha512_ctx *ctx); +sparc_libc_ifunc(sha512_process_block, cpu_supports_sha512(hwcap) ? __sha512_process_block_crop : sha512_process_block_generic); diff --git a/libc/sysdeps/sparc/sparc64/multiarch/sha512-crop.S b/libc/sysdeps/sparc/sparc64/multiarch/sha512-crop.S new file mode 100644 index 000000000..efd8ae3cd --- /dev/null +++ b/libc/sysdeps/sparc/sparc64/multiarch/sha512-crop.S @@ -0,0 +1,131 @@ +/* SHA512 using sparc crypto opcodes. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by David S. Miller (davem@davemloft.net) + + 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, see + <http://www.gnu.org/licenses/>. */ + +#include <sysdep.h> + +#define SHA512 \ + .word 0x81b02860; + + .text + .align 32 +ENTRY(__sha512_process_block_crop) + /* %o0=buffer, %o1=len, %o2=CTX */ + ldx [%o2 + 0x48], %g1 + add %g1, %o1, %o4 + stx %o4, [%o2 + 0x48] + cmp %o4, %g1 + bgeu,pt %xcc, 1f + nop + ldx [%o2 + 0x40], %g1 + add %g1, 1, %g1 + stx %g1, [%o2 + 0x40] + +1: ldd [%o2 + 0x00], %f0 + ldd [%o2 + 0x08], %f2 + ldd [%o2 + 0x10], %f4 + ldd [%o2 + 0x18], %f6 + ldd [%o2 + 0x20], %f8 + ldd [%o2 + 0x28], %f10 + andcc %o1, 0x7, %g0 + ldd [%o2 + 0x30], %f12 + bne,pn %xcc, 10f + ldd [%o2 + 0x38], %f14 + +1: + ldd [%o0 + 0x00], %f16 + ldd [%o0 + 0x08], %f18 + ldd [%o0 + 0x10], %f20 + ldd [%o0 + 0x18], %f22 + ldd [%o0 + 0x20], %f24 + ldd [%o0 + 0x28], %f26 + ldd [%o0 + 0x30], %f28 + ldd [%o0 + 0x38], %f30 + ldd [%o0 + 0x40], %f32 + ldd [%o0 + 0x48], %f34 + ldd [%o0 + 0x50], %f36 + ldd [%o0 + 0x58], %f38 + ldd [%o0 + 0x60], %f40 + ldd [%o0 + 0x68], %f42 + ldd [%o0 + 0x70], %f44 + ldd [%o0 + 0x78], %f46 + + SHA512 + + subcc %o1, 0x80, %o1 + bne,pt %xcc, 1b + add %o0, 0x80, %o0 + +5: + std %f0, [%o2 + 0x00] + std %f2, [%o2 + 0x08] + std %f4, [%o2 + 0x10] + std %f6, [%o2 + 0x18] + std %f8, [%o2 + 0x20] + std %f10, [%o2 + 0x28] + std %f12, [%o2 + 0x30] + retl + std %f14, [%o2 + 0x38] +10: + alignaddr %o0, %g0, %o0 + + ldd [%o0 + 0x00], %f18 +1: + ldd [%o0 + 0x08], %f20 + ldd [%o0 + 0x10], %f22 + ldd [%o0 + 0x18], %f24 + ldd [%o0 + 0x20], %f26 + ldd [%o0 + 0x28], %f28 + ldd [%o0 + 0x30], %f30 + ldd [%o0 + 0x38], %f32 + ldd [%o0 + 0x40], %f34 + ldd [%o0 + 0x48], %f36 + ldd [%o0 + 0x50], %f38 + ldd [%o0 + 0x58], %f40 + ldd [%o0 + 0x60], %f42 + ldd [%o0 + 0x68], %f44 + ldd [%o0 + 0x70], %f46 + ldd [%o0 + 0x78], %f48 + ldd [%o0 + 0x80], %f50 + + faligndata %f18, %f20, %f16 + faligndata %f20, %f22, %f18 + faligndata %f22, %f24, %f20 + faligndata %f24, %f26, %f22 + faligndata %f26, %f28, %f24 + faligndata %f28, %f30, %f26 + faligndata %f30, %f32, %f28 + faligndata %f32, %f34, %f30 + faligndata %f34, %f36, %f32 + faligndata %f36, %f38, %f34 + faligndata %f38, %f40, %f36 + faligndata %f40, %f42, %f38 + faligndata %f42, %f44, %f40 + faligndata %f44, %f46, %f42 + faligndata %f46, %f48, %f44 + faligndata %f48, %f50, %f46 + + SHA512 + + subcc %o1, 0x80, %o1 + fsrc2 %f50, %f18 + bne,pt %xcc, 1b + add %o0, 0x80, %o0 + + ba,a,pt %xcc, 5b +END(__sha512_process_block_crop) diff --git a/libc/sysdeps/unix/sysv/linux/fxstatat.c b/libc/sysdeps/unix/sysv/linux/fxstatat.c index 89638ba80..9bb608957 100644 --- a/libc/sysdeps/unix/sysv/linux/fxstatat.c +++ b/libc/sysdeps/unix/sysv/linux/fxstatat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2005-2012 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 @@ -23,6 +23,7 @@ #include <fcntl.h> #include <stddef.h> #include <stdio.h> +#include <string.h> #include <sys/stat.h> #include <kernel_stat.h> diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c index cb31e5ca2..2c9812e4b 100644 --- a/libc/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c +++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c @@ -22,6 +22,7 @@ #include <unistd.h> #include <dirent.h> #include <stdlib.h> +#include <inttypes.h> #include <sys/ioctl.h> #include <libc-internal.h> #include <asm/openpromio.h> @@ -123,14 +124,14 @@ __get_clockfreq_via_proc_openprom (void) int clkfreq_fd; __stpcpy (prop, "/clock-frequency"); - clkfreq_fd = open (node, O_RDONLY); + clkfreq_fd = __open (node, O_RDONLY); if (clkfreq_fd != -1) { - if (read (clkfreq_fd, type_string, - sizeof (type_string)) > 0) + if (__read (clkfreq_fd, type_string, + sizeof (type_string)) > 0) result = (hp_timing_t) strtoumax (type_string, NULL, 16); - close (clkfreq_fd); + __close (clkfreq_fd); } } __close (fd); diff --git a/libc/timezone/Makefile b/libc/timezone/Makefile index bb35b4ced..a1da8fa56 100644 --- a/libc/timezone/Makefile +++ b/libc/timezone/Makefile @@ -54,6 +54,13 @@ include ../Rules $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o +$(objpfx)zic.o $(objpfx)zdump.o: $(objpfx)version.h + +$(objpfx)version.h: $(common-objpfx)config.make + echo 'static char const TZVERSION[]="$(version)";' \ + > $@.new + mv -f $@.new $@ + tz-cflags = -DTZDIR='"$(zonedir)"' \ -DTZDEFAULT='"$(localtime-file)"' \ -DTZDEFRULES='"$(posixrules-file)"' \ @@ -106,9 +113,11 @@ $(testdata)/Asia/Tokyo: asia $(zic-deps) $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make - sed -e 's%@KSH@%$(KSH)%g' \ - -e 's%@TZDIR@%$(zonedir)%g' \ - -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ - -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' < $< > $@.new + sed -e 's|/bin/bash|$(KSH)|g' \ + -e '/TZDIR=/s|\$$(pwd)|$(zonedir)|' \ + -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ + -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ + -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \ + < $< > $@.new chmod 555 $@.new mv -f $@.new $@ diff --git a/libc/timezone/README b/libc/timezone/README index cb3d2cdb6..7a5e31ce4 100644 --- a/libc/timezone/README +++ b/libc/timezone/README @@ -1,10 +1,7 @@ The files zic.c zdump.c ialloc.c scheck.c tzfile.h private.h tzselect.ksh checktab.awk -come from the tzcode package by Arthur David Olson et.al.; the file - version.h -has the contents that would be generated by that package's Makefile, -and tzselect.ksh has been modified for use in glibc. +come from the tzcode package by Arthur David Olson et.al. The files africa antarctica asia australasia europe diff --git a/libc/timezone/tzselect.ksh b/libc/timezone/tzselect.ksh index b11c01ad8..8e66b4427 100644 --- a/libc/timezone/tzselect.ksh +++ b/libc/timezone/tzselect.ksh @@ -1,9 +1,8 @@ -#! @KSH@ - -TZVERSION=tz2012i -PKGVERSION='@PKGVERSION@' -REPORT_BUGS_TO='@REPORT_BUGS_TO@' +#!/bin/bash +PKGVERSION='(tzcode) ' +TZVERSION=see_Makefile +REPORT_BUGS_TO=tz@iana.org # Ask the user about the time zone, and output the resulting TZ value to stdout. # Interact with the user via stderr and stdin. @@ -32,7 +31,7 @@ REPORT_BUGS_TO='@REPORT_BUGS_TO@' # Specify default values for environment variables if they are unset. : ${AWK=awk} -: ${TZDIR=@TZDIR@} +: ${TZDIR=$(pwd)} # Check for awk Posix compliance. ($AWK -v x=y 'BEGIN { exit 123 }') </dev/null >/dev/null 2>&1 @@ -46,15 +45,14 @@ if [ "$1" = "--help" ]; then Usage: tzselect Select a time zone interactively. -For bug reporting instructions, please see: -$REPORT_BUGS_TO. +Report bugs to $REPORT_BUGS_TO. EOF - exit 0 + exit elif [ "$1" = "--version" ]; then cat <<EOF tzselect $PKGVERSION$TZVERSION EOF - exit 0 + exit fi # Make sure the tables are readable. diff --git a/libc/timezone/version.h b/libc/timezone/version.h deleted file mode 100644 index 0873ea134..000000000 --- a/libc/timezone/version.h +++ /dev/null @@ -1 +0,0 @@ -static char const TZVERSION[]="tz2012i"; diff --git a/libc/timezone/zdump.c b/libc/timezone/zdump.c index 4d3f938cc..9255affc1 100644 --- a/libc/timezone/zdump.c +++ b/libc/timezone/zdump.c @@ -11,7 +11,6 @@ ** You can use this code to help in verifying other implementations. */ -#include "config.h" #include "stdio.h" /* for stdout, stderr, perror */ #include "string.h" /* for strcpy */ #include "sys/types.h" /* for time_t */ @@ -273,8 +272,7 @@ usage(FILE * const stream, const int status) (void) fprintf(stream, _("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\ \n\ -For bug reporting instructions, please see:\n\ -%s.\n"), +Report bugs to %s.\n"), progname, progname, REPORT_BUGS_TO); exit(status); } @@ -311,7 +309,7 @@ main(int argc, char *argv[]) progname = argv[0]; for (i = 1; i < argc; ++i) if (strcmp(argv[i], "--version") == 0) { - (void) printf("zdump %s%s\n", PKGVERSION, TZVERSION); + (void) printf("zdump %s%s\n", PKGVERSION, TZVERSION); exit(EXIT_SUCCESS); } else if (strcmp(argv[i], "--help") == 0) { usage(stdout, EXIT_SUCCESS); diff --git a/libc/timezone/zic.c b/libc/timezone/zic.c index eab1d592c..a5202a1ac 100644 --- a/libc/timezone/zic.c +++ b/libc/timezone/zic.c @@ -3,7 +3,6 @@ ** 2006-07-17 by Arthur David Olson. */ -#include "config.h" #include "version.h" #include "private.h" #include "locale.h" @@ -427,8 +426,7 @@ usage(FILE *stream, int status) [ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\ \t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\ \n\ -For bug reporting instructions, please see:\n\ -%s.\n"), +Report bugs to %s.\n"), progname, progname, REPORT_BUGS_TO); exit(status); } @@ -2536,8 +2534,8 @@ newabbr(const char *const string) ++cp; if (cp - string == 0) mp = _("time zone abbreviation lacks alphabetic at start"); - if (noise && cp - string > 3) -mp = _("time zone abbreviation has more than 3 alphabetics"); + if (noise && cp - string < 3) +mp = _("time zone abbreviation has fewer than 3 alphabetics"); if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN) mp = _("time zone abbreviation has too many alphabetics"); if (mp == NULL && (*cp == '+' || *cp == '-')) { |