From d2f37bcdab0d46ae1f82d5dbf2743ed34e51f2bf155274a125aebbe9a8266279 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 15 Sep 2014 10:37:45 +0000 Subject: [PATCH] Accepting request 249235 from home:Andreas_Schwab:glibc - Update to glibc 2.20 release. * Reverted change of ABI data structures for s390 and s390x * Support for file description locks is added to systems running the Linux kernel * Optimized strchr implementation for AArch64 * The minimum Linux kernel version that this version of the GNU C Library can be used with is 2.6.32 * Running the testsuite no longer terminates as soon as a test fails * The am33 port, which had not worked for several years, has been removed from ports. * The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer supported; they now act the same as _DEFAULT_SOURCE (but generate a warning) * Optimized strcmp implementation for ARMv7 * Added support for TX lock elision of pthread mutexes on s390 and s390x * All supported architectures now use the main glibc sysdeps directory instead of some being in a separate "ports" directory * The NPTL implementation of POSIX pthreads is no longer an "add-on" * Locale names, including those obtained from environment variables (LANG and the LC_* variables), are more tightly checked for proper syntax * On x86-64, the dynamic linker's lazy-binding support is now compatible with application code using Intel MPX instructions - Patches from upstream removed * nss-dns-memleak.patch * sin-sign.patch * pldd-wait-ptrace-stop.patch * nscd-track-startup-failures.patch * powerpc-opt-power8.patch * check-pf-alloca.patch * getaddrinfo-uninit-result.patch OBS-URL: https://build.opensuse.org/request/show/249235 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=387 --- aarch64-setcontext.patch | 225 -- check-pf-alloca.patch | 163 -- crypt_blowfish-gensalt.patch | 10 +- disable-gconv-translit-modules.patch | 196 -- dt-ppc64-num.patch | 19 - getaddrinfo-uninit-result.patch | 26 - glibc-2.14-crypt.diff | 364 ++-- glibc-2.19.tar.xz | 3 - glibc-2.20.tar.xz | 3 + glibc-2.3.90-langpackdir.diff | 12 +- glibc-2.3.90-noversion.diff | 39 +- glibc-nodate.patch | 15 - glibc-testsuite.changes | 50 + glibc-testsuite.spec | 122 +- glibc-utils.changes | 50 + glibc-utils.spec | 122 +- glibc.changes | 50 + glibc.spec | 122 +- ibm-long-double-frexpl.patch | 194 -- ibm-long-double-math.patch | 462 ---- ibm93x-redundant-shift-si.patch | 10 +- iconv-ibm-sentinel-check.patch | 162 -- manpages.tar.bz2 | 4 +- nextafterl-ibm-ldouble.patch | 116 - noversion.tar.bz2 | 4 +- nscd-track-startup-failures.patch | 496 ----- nss-dns-memleak.patch | 461 ---- nss-files-long-lines.patch | 24 - nss-nis-stack-use.patch | 111 - pldd-wait-ptrace-stop.patch | 63 - powerpc-opt-power8.patch | 2696 ------------------------ ppc64-copysign.patch | 23 - ppc64le-profiling.patch | 23 - psfaa.patch | 139 -- pthread-mutex-trylock-elision.patch | 18 +- resolv-dont-ignore-second-answer.patch | 33 - s390-revert-abi-change.patch | 2292 -------------------- setlocale-directory-traversal.patch | 648 ------ sin-sign.patch | 54 - 39 files changed, 489 insertions(+), 9135 deletions(-) delete mode 100644 aarch64-setcontext.patch delete mode 100644 check-pf-alloca.patch delete mode 100644 disable-gconv-translit-modules.patch delete mode 100644 dt-ppc64-num.patch delete mode 100644 getaddrinfo-uninit-result.patch delete mode 100644 glibc-2.19.tar.xz create mode 100644 glibc-2.20.tar.xz delete mode 100644 ibm-long-double-frexpl.patch delete mode 100644 ibm-long-double-math.patch delete mode 100644 iconv-ibm-sentinel-check.patch delete mode 100644 nextafterl-ibm-ldouble.patch delete mode 100644 nscd-track-startup-failures.patch delete mode 100644 nss-dns-memleak.patch delete mode 100644 nss-files-long-lines.patch delete mode 100644 nss-nis-stack-use.patch delete mode 100644 pldd-wait-ptrace-stop.patch delete mode 100644 powerpc-opt-power8.patch delete mode 100644 ppc64-copysign.patch delete mode 100644 ppc64le-profiling.patch delete mode 100644 psfaa.patch delete mode 100644 resolv-dont-ignore-second-answer.patch delete mode 100644 s390-revert-abi-change.patch delete mode 100644 setlocale-directory-traversal.patch delete mode 100644 sin-sign.patch diff --git a/aarch64-setcontext.patch b/aarch64-setcontext.patch deleted file mode 100644 index 9997ff5..0000000 --- a/aarch64-setcontext.patch +++ /dev/null @@ -1,225 +0,0 @@ -From 4dc40de1ed58a1de5d960e59f20a04191f6820c9 Mon Sep 17 00:00:00 2001 -From: Will Newton -Date: Wed, 12 Mar 2014 16:14:51 +0000 -Subject: [PATCH 1/3] aarch64: Re-implement setcontext without rt_sigreturn - syscall - -The current implementation of setcontext uses rt_sigreturn to restore -the contents of registers. This contrasts with the way most other -architectures implement setcontext: - - powerpc64, mips, tile: - - Call rt_sigreturn if context was created by a call to a signal handler, - otherwise restore in user code. - - powerpc32: - - Call swapcontext system call and don't call sigreturn or rt_sigreturn. - - x86_64, sparc, hppa, sh, ia64, m68k, s390, arm: - - Only support restoring "synchronous" contexts, that is contexts - created by getcontext, and restoring in user code and don't call - sigreturn or rt_sigreturn. - - alpha: - - Call sigreturn (but not rt_sigreturn) in all cases to do the restore. - -The text of the setcontext manpage suggests that the requirement to be -able to restore a signal handler created context has been dropped from -SUSv2: - - If the context was obtained by a call to a signal handler, then old - standard text says that "program execution continues with the program - instruction following the instruction interrupted by the signal". - However, this sentence was removed in SUSv2, and the present verdict - is "the result is unspecified". - -Implementing setcontext by calling rt_sigreturn unconditionally causes -problems when used with sigaltstack as in BZ #16629. On this basis it -seems that aarch64 is broken and that new ports should only support -restoring contexts created with getcontext and do not need to call -rt_sigreturn at all. - -This patch re-implements the aarch64 setcontext function to restore -the context in user code in a similar manner to x86_64 and other ports. - -ChangeLog: - -2014-03-13 Will Newton - - [BZ #16629] - * sysdeps/unix/sysv/linux/aarch64/setcontext.S (__setcontext): - Re-implement to restore registers in user code and avoid - rt_sigreturn system call. ---- - sysdeps/unix/sysv/linux/aarch64/setcontext.S | 147 +++++++++++++++++---------- - 1 file changed, 92 insertions(+), 55 deletions(-) - -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S -=================================================================== ---- glibc-2.19.orig/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S -@@ -22,68 +22,105 @@ - #include "ucontext_i.h" - #include "ucontext-internal.h" - --/* int setcontext (const ucontext_t *ucp) */ -+/* int __setcontext (const ucontext_t *ucp) - -- .text -- --ENTRY(__setcontext) -+ Restores the machine context in UCP and thereby resumes execution -+ in that context. - -- /* Create a signal frame on the stack: -+ This implementation is intended to be used for *synchronous* context -+ switches only. Therefore, it does not have to restore anything -+ other than the PRESERVED state. */ - -- fp -- lr -- ... -- sp-> rt_sigframe -- */ -- -- stp x29, x30, [sp, -16]! -- cfi_adjust_cfa_offset (16) -- cfi_rel_offset (x29, 0) -- cfi_rel_offset (x30, 8) -- -- mov x29, sp -- cfi_def_cfa_register (x29) -- -- /* Allocate space for the sigcontext. */ -- mov w3, #((RT_SIGFRAME_SIZE + SP_ALIGN_SIZE) & SP_ALIGN_MASK) -- sub sp, sp, x3 -- -- /* Compute the base address of the ucontext structure. */ -- add x1, sp, #RT_SIGFRAME_UCONTEXT -- -- /* Only ucontext is required in the frame, *copy* it in. */ -- --#if UCONTEXT_SIZE % 16 --#error The implementation of setcontext.S assumes sizeof(ucontext_t) % 16 == 0 --#endif -- -- mov x2, #UCONTEXT_SIZE / 16 --0: -- ldp x3, x4, [x0], #16 -- stp x3, x4, [x1], #16 -- sub x2, x2, 1 -- cbnz x2, 0b -+ .text - -- /* rt_sigreturn () -- no arguments, sp points to struct rt_sigframe. */ -- mov x8, SYS_ify (rt_sigreturn) -+ENTRY (__setcontext) -+ /* Save a copy of UCP. */ -+ mov x9, x0 -+ -+ /* Set the signal mask with -+ rt_sigprocmask (SIG_SETMASK, mask, NULL, _NSIG/8). */ -+ mov x0, #SIG_SETMASK -+ add x1, x9, #UCONTEXT_SIGMASK -+ mov x2, #0 -+ mov x3, #_NSIG8 -+ mov x8, SYS_ify (rt_sigprocmask) - svc 0 -- -- /* Ooops we failed. Recover the stack */ -- -- mov sp, x29 -- cfi_def_cfa_register (sp) -- -- ldp x29, x30, [sp], 16 -- cfi_adjust_cfa_offset (16) -- cfi_restore (x29) -- cfi_restore (x30) -- b C_SYMBOL_NAME(__syscall_error) -- -+ cbz x0, 1f -+ b C_SYMBOL_NAME (__syscall_error) -+1: -+ /* Restore the general purpose registers. */ -+ mov x0, x9 -+ cfi_def_cfa (x0, 0) -+ cfi_offset (x18, oX0 + 18 * SZREG) -+ cfi_offset (x19, oX0 + 19 * SZREG) -+ cfi_offset (x20, oX0 + 20 * SZREG) -+ cfi_offset (x21, oX0 + 21 * SZREG) -+ cfi_offset (x22, oX0 + 22 * SZREG) -+ cfi_offset (x23, oX0 + 23 * SZREG) -+ cfi_offset (x24, oX0 + 24 * SZREG) -+ cfi_offset (x25, oX0 + 25 * SZREG) -+ cfi_offset (x26, oX0 + 26 * SZREG) -+ cfi_offset (x27, oX0 + 27 * SZREG) -+ cfi_offset (x28, oX0 + 28 * SZREG) -+ cfi_offset (x29, oX0 + 29 * SZREG) -+ cfi_offset (x30, oX0 + 30 * SZREG) -+ -+ cfi_offset ( d8, oV0 + 8 * SZVREG) -+ cfi_offset ( d9, oV0 + 9 * SZVREG) -+ cfi_offset (d10, oV0 + 10 * SZVREG) -+ cfi_offset (d11, oV0 + 11 * SZVREG) -+ cfi_offset (d12, oV0 + 12 * SZVREG) -+ cfi_offset (d13, oV0 + 13 * SZVREG) -+ cfi_offset (d14, oV0 + 14 * SZVREG) -+ cfi_offset (d15, oV0 + 15 * SZVREG) -+ ldp x18, x19, [x0, oX0 + 18 * SZREG] -+ ldp x20, x21, [x0, oX0 + 20 * SZREG] -+ ldp x22, x23, [x0, oX0 + 22 * SZREG] -+ ldp x24, x25, [x0, oX0 + 24 * SZREG] -+ ldp x26, x27, [x0, oX0 + 26 * SZREG] -+ ldp x28, x29, [x0, oX0 + 28 * SZREG] -+ ldr x30, [x0, oX0 + 30 * SZREG] -+ ldr x2, [x0, oSP] -+ mov sp, x2 -+ -+ /* Check for FP SIMD context. */ -+ add x2, x0, #oEXTENSION -+ -+ mov w3, #(FPSIMD_MAGIC & 0xffff) -+ movk w3, #(FPSIMD_MAGIC >> 16), lsl #16 -+ ldr w1, [x2, #oHEAD + oMAGIC] -+ cmp w1, w3 -+ b.ne 2f -+ -+ /* Restore the FP SIMD context. */ -+ add x3, x2, #oV0 + 8 * SZVREG -+ ldp d8, d9, [x3], #2 * SZVREG -+ ldp d10, d11, [x3], #2 * SZVREG -+ ldp d12, d13, [x3], #2 * SZVREG -+ ldp d14, d15, [x3], #2 * SZVREG -+ -+ add x3, x2, oFPSR -+ -+ ldr w4, [x3] -+ msr fpsr, x4 -+ -+ ldr w4, [x3, oFPCR - oFPSR] -+ msr fpcr, x4 -+ -+2: -+ ldr x16, [x0, oPC] -+ /* Restore arg registers. */ -+ ldp x2, x3, [x0, oX0 + 2 * SZREG] -+ ldp x4, x5, [x0, oX0 + 4 * SZREG] -+ ldp x6, x7, [x0, oX0 + 6 * SZREG] -+ ldp x0, x1, [x0, oX0 + 0 * SZREG] -+ /* Jump to the new pc value. */ -+ br x16 - PSEUDO_END (__setcontext) - weak_alias (__setcontext, setcontext) - --ENTRY(__startcontext) -+ENTRY (__startcontext) - mov x0, x19 - cbnz x0, __setcontext --1: b HIDDEN_JUMPTARGET(_exit) --END(__startcontext) -+1: b HIDDEN_JUMPTARGET (_exit) -+END (__startcontext) diff --git a/check-pf-alloca.patch b/check-pf-alloca.patch deleted file mode 100644 index 83709a6..0000000 --- a/check-pf-alloca.patch +++ /dev/null @@ -1,163 +0,0 @@ - * sysdeps/unix/sysv/linux/check_pf.c (make_request): Add out_fail2 - label to be used after in6ailist is initialized. - - [BZ #16002] - * sysdeps/unix/sysv/linux/check_pf.c (make_request): Use - alloca_account and account alloca use for struct in6ailist. - -Index: glibc-2.19/sysdeps/unix/sysv/linux/check_pf.c -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/check_pf.c -+++ glibc-2.19/sysdeps/unix/sysv/linux/check_pf.c -@@ -106,6 +106,11 @@ cache_valid_p (void) - static struct cached_data * - make_request (int fd, pid_t pid) - { -+ struct cached_data *result = NULL; -+ -+ size_t result_len = 0; -+ size_t result_cap = 32; -+ - struct req - { - struct nlmsghdr nlh; -@@ -137,19 +142,9 @@ make_request (int fd, pid_t pid) - #else - const size_t buf_size = __getpagesize (); - #endif -- bool use_malloc = false; - char *buf; - -- if (__libc_use_alloca (buf_size)) -- buf = alloca (buf_size); -- else -- { -- buf = malloc (buf_size); -- if (buf != NULL) -- use_malloc = true; -- else -- goto out_fail; -- } -+ buf = alloca (buf_size); - - struct iovec iov = { buf, buf_size }; - -@@ -159,12 +154,7 @@ make_request (int fd, pid_t pid) - goto out_fail; - - bool done = false; -- struct in6ailist -- { -- struct in6addrinfo info; -- struct in6ailist *next; -- } *in6ailist = NULL; -- size_t in6ailistlen = 0; -+ - bool seen_ipv4 = false; - bool seen_ipv6 = false; - -@@ -239,28 +229,36 @@ make_request (int fd, pid_t pid) - } - } - -- struct in6ailist *newp = alloca (sizeof (*newp)); -- newp->info.flags = (((ifam->ifa_flags -- & (IFA_F_DEPRECATED -- | IFA_F_OPTIMISTIC)) -- ? in6ai_deprecated : 0) -- | ((ifam->ifa_flags -- & IFA_F_HOMEADDRESS) -- ? in6ai_homeaddress : 0)); -- newp->info.prefixlen = ifam->ifa_prefixlen; -- newp->info.index = ifam->ifa_index; -+ if (result_len == 0 || result_len == result_cap) -+ { -+ result_cap = 2 * result_cap; -+ result = realloc (result, sizeof (*result) -+ + result_cap * sizeof (struct in6addrinfo)); -+ } -+ -+ if (!result) -+ goto out_fail; -+ -+ struct in6addrinfo *info = &result->in6ai[result_len++]; -+ -+ info->flags = (((ifam->ifa_flags -+ & (IFA_F_DEPRECATED -+ | IFA_F_OPTIMISTIC)) -+ ? in6ai_deprecated : 0) -+ | ((ifam->ifa_flags -+ & IFA_F_HOMEADDRESS) -+ ? in6ai_homeaddress : 0)); -+ info->prefixlen = ifam->ifa_prefixlen; -+ info->index = ifam->ifa_index; - if (ifam->ifa_family == AF_INET) - { -- newp->info.addr[0] = 0; -- newp->info.addr[1] = 0; -- newp->info.addr[2] = htonl (0xffff); -- newp->info.addr[3] = *(const in_addr_t *) address; -+ info->addr[0] = 0; -+ info->addr[1] = 0; -+ info->addr[2] = htonl (0xffff); -+ info->addr[3] = *(const in_addr_t *) address; - } - else -- memcpy (newp->info.addr, address, sizeof (newp->info.addr)); -- newp->next = in6ailist; -- in6ailist = newp; -- ++in6ailistlen; -+ memcpy (info->addr, address, sizeof (info->addr)); - } - else if (nlmh->nlmsg_type == NLMSG_DONE) - /* We found the end, leave the loop. */ -@@ -269,42 +267,29 @@ make_request (int fd, pid_t pid) - } - while (! done); - -- struct cached_data *result; -- if (seen_ipv6 && in6ailist != NULL) -+ if (seen_ipv6 && result != NULL) - { -- result = malloc (sizeof (*result) -- + in6ailistlen * sizeof (struct in6addrinfo)); -- if (result == NULL) -- goto out_fail; -- - result->timestamp = get_nl_timestamp (); - result->usecnt = 2; - result->seen_ipv4 = seen_ipv4; - result->seen_ipv6 = true; -- result->in6ailen = in6ailistlen; -- -- do -- { -- result->in6ai[--in6ailistlen] = in6ailist->info; -- in6ailist = in6ailist->next; -- } -- while (in6ailist != NULL); -+ result->in6ailen = result_len; - } - else - { -+ free (result); -+ - atomic_add (&noai6ai_cached.usecnt, 2); - noai6ai_cached.seen_ipv4 = seen_ipv4; - noai6ai_cached.seen_ipv6 = seen_ipv6; - result = &noai6ai_cached; - } - -- if (use_malloc) -- free (buf); - return result; - --out_fail: -- if (use_malloc) -- free (buf); -+ out_fail: -+ -+ free (result); - return NULL; - } - diff --git a/crypt_blowfish-gensalt.patch b/crypt_blowfish-gensalt.patch index 14d0039..685fbec 100644 --- a/crypt_blowfish-gensalt.patch +++ b/crypt_blowfish-gensalt.patch @@ -51,7 +51,15 @@ Index: crypt_blowfish-1.2/crypt_gensalt.c =================================================================== --- crypt_blowfish-1.2.orig/crypt_gensalt.c +++ crypt_blowfish-1.2/crypt_gensalt.c -@@ -180,3 +180,69 @@ error: +@@ -20,6 +20,7 @@ + + #include + #include ++#include + + #include + #ifndef __set_errno +@@ -180,3 +181,69 @@ error: errno = ENOMEM; return NULL; } diff --git a/disable-gconv-translit-modules.patch b/disable-gconv-translit-modules.patch deleted file mode 100644 index 465a6b1..0000000 --- a/disable-gconv-translit-modules.patch +++ /dev/null @@ -1,196 +0,0 @@ -2014-08-21 Florian Weimer - - [BZ #17187] - * iconv/gconv_trans.c (struct known_trans, search_tree, lock, - trans_compare, open_translit, __gconv_translit_find): - Remove module loading code. - -Index: glibc-2.19/iconv/gconv_trans.c -=================================================================== ---- glibc-2.19.orig/iconv/gconv_trans.c -+++ glibc-2.19/iconv/gconv_trans.c -@@ -238,181 +238,11 @@ __gconv_transliterate (struct __gconv_st - return __GCONV_ILLEGAL_INPUT; - } - -- --/* Structure to represent results of found (or not) transliteration -- modules. */ --struct known_trans --{ -- /* This structure must remain the first member. */ -- struct trans_struct info; -- -- char *fname; -- void *handle; -- int open_count; --}; -- -- --/* Tree with results of previous calls to __gconv_translit_find. */ --static void *search_tree; -- --/* We modify global data. */ --__libc_lock_define_initialized (static, lock); -- -- --/* Compare two transliteration entries. */ --static int --trans_compare (const void *p1, const void *p2) --{ -- const struct known_trans *s1 = (const struct known_trans *) p1; -- const struct known_trans *s2 = (const struct known_trans *) p2; -- -- return strcmp (s1->info.name, s2->info.name); --} -- -- --/* Open (maybe reopen) the module named in the struct. Get the function -- and data structure pointers we need. */ --static int --open_translit (struct known_trans *trans) --{ -- __gconv_trans_query_fct queryfct; -- -- trans->handle = __libc_dlopen (trans->fname); -- if (trans->handle == NULL) -- /* Not available. */ -- return 1; -- -- /* Find the required symbol. */ -- queryfct = __libc_dlsym (trans->handle, "gconv_trans_context"); -- if (queryfct == NULL) -- { -- /* We cannot live with that. */ -- close_and_out: -- __libc_dlclose (trans->handle); -- trans->handle = NULL; -- return 1; -- } -- -- /* Get the context. */ -- if (queryfct (trans->info.name, &trans->info.csnames, &trans->info.ncsnames) -- != 0) -- goto close_and_out; -- -- /* Of course we also have to have the actual function. */ -- trans->info.trans_fct = __libc_dlsym (trans->handle, "gconv_trans"); -- if (trans->info.trans_fct == NULL) -- goto close_and_out; -- -- /* Now the optional functions. */ -- trans->info.trans_init_fct = -- __libc_dlsym (trans->handle, "gconv_trans_init"); -- trans->info.trans_context_fct = -- __libc_dlsym (trans->handle, "gconv_trans_context"); -- trans->info.trans_end_fct = -- __libc_dlsym (trans->handle, "gconv_trans_end"); -- -- trans->open_count = 1; -- -- return 0; --} -- -- - int - internal_function - __gconv_translit_find (struct trans_struct *trans) - { -- struct known_trans **found; -- const struct path_elem *runp; -- int res = 1; -- -- /* We have to have a name. */ -- assert (trans->name != NULL); -- -- /* Acquire the lock. */ -- __libc_lock_lock (lock); -- -- /* See whether we know this module already. */ -- found = __tfind (trans, &search_tree, trans_compare); -- if (found != NULL) -- { -- /* Is this module available? */ -- if ((*found)->handle != NULL) -- { -- /* Maybe we have to reopen the file. */ -- if ((*found)->handle != (void *) -1) -- /* The object is not unloaded. */ -- res = 0; -- else if (open_translit (*found) == 0) -- { -- /* Copy the data. */ -- *trans = (*found)->info; -- (*found)->open_count++; -- res = 0; -- } -- } -- } -- else -- { -- size_t name_len = strlen (trans->name) + 1; -- int need_so = 0; -- struct known_trans *newp; -- -- /* We have to continue looking for the module. */ -- if (__gconv_path_elem == NULL) -- __gconv_get_path (); -- -- /* See whether we have to append .so. */ -- if (name_len <= 4 || memcmp (&trans->name[name_len - 4], ".so", 3) != 0) -- need_so = 1; -- -- /* Create a new entry. */ -- newp = (struct known_trans *) malloc (sizeof (struct known_trans) -- + (__gconv_max_path_elem_len -- + name_len + 3) -- + name_len); -- if (newp != NULL) -- { -- char *cp; -- -- /* Clear the struct. */ -- memset (newp, '\0', sizeof (struct known_trans)); -- -- /* Store a copy of the module name. */ -- newp->info.name = cp = (char *) (newp + 1); -- cp = __mempcpy (cp, trans->name, name_len); -- -- newp->fname = cp; -- -- /* Search in all the directories. */ -- for (runp = __gconv_path_elem; runp->name != NULL; ++runp) -- { -- cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name), -- trans->name, name_len); -- if (need_so) -- memcpy (cp, ".so", sizeof (".so")); -- -- if (open_translit (newp) == 0) -- { -- /* We found a module. */ -- res = 0; -- break; -- } -- } -- -- if (res) -- newp->fname = NULL; -- -- /* In any case we'll add the entry to our search tree. */ -- if (__tsearch (newp, &search_tree, trans_compare) == NULL) -- { -- /* Yickes, this should not happen. Unload the object. */ -- res = 1; -- /* XXX unload here. */ -- } -- } -- } -- -- __libc_lock_unlock (lock); -- -- return res; -+ /* This function always fails. Transliteration module loading is -+ not implemented. */ -+ return 1; - } diff --git a/dt-ppc64-num.patch b/dt-ppc64-num.patch deleted file mode 100644 index e1193e8..0000000 --- a/dt-ppc64-num.patch +++ /dev/null @@ -1,19 +0,0 @@ -2014-07-14 Alan Modra - - [BZ #17153] - * elf/elf.h (DT_PPC64_NUM): Correct value. - * NEWS: Add to fixed bug list. - -Index: glibc-2.19/elf/elf.h -=================================================================== ---- glibc-2.19.orig/elf/elf.h -+++ glibc-2.19/elf/elf.h -@@ -2283,7 +2283,7 @@ typedef Elf32_Addr Elf32_Conflict; - #define DT_PPC64_OPD (DT_LOPROC + 1) - #define DT_PPC64_OPDSZ (DT_LOPROC + 2) - #define DT_PPC64_OPT (DT_LOPROC + 3) --#define DT_PPC64_NUM 3 -+#define DT_PPC64_NUM 4 - - /* PowerPC64 specific values for the DT_PPC64_OPT Dyn entry. */ - #define PPC64_OPT_TLS 1 diff --git a/getaddrinfo-uninit-result.patch b/getaddrinfo-uninit-result.patch deleted file mode 100644 index 06887a3..0000000 --- a/getaddrinfo-uninit-result.patch +++ /dev/null @@ -1,26 +0,0 @@ - * sysdeps/posix/getaddrinfo.c (gaih_inet): Properly skip over - non-matching result from nscd. - -Index: glibc-2.19/sysdeps/posix/getaddrinfo.c -=================================================================== ---- glibc-2.19.orig/sysdeps/posix/getaddrinfo.c -+++ glibc-2.19/sysdeps/posix/getaddrinfo.c -@@ -712,6 +712,18 @@ gaih_inet (const char *name, const struc - { - socklen_t size = (air->family[i] == AF_INET - ? INADDRSZ : IN6ADDRSZ); -+ -+ if (!((air->family[i] == AF_INET -+ && req->ai_family == AF_INET6 -+ && (req->ai_flags & AI_V4MAPPED) != 0) -+ || req->ai_family == AF_UNSPEC -+ || air->family[i] == req->ai_family)) -+ { -+ /* Skip over non-matching result. */ -+ addrs += size; -+ continue; -+ } -+ - if (*pat == NULL) - { - *pat = addrfree++; diff --git a/glibc-2.14-crypt.diff b/glibc-2.14-crypt.diff index ee1d657..09acac1 100644 --- a/glibc-2.14-crypt.diff +++ b/glibc-2.14-crypt.diff @@ -1,23 +1,9 @@ -Index: glibc-2.19/Versions.def +Index: glibc-2.19.90/crypt/Makefile =================================================================== ---- glibc-2.19.orig/Versions.def -+++ glibc-2.19/Versions.def -@@ -45,6 +45,9 @@ libc { - libcrypt { - GLIBC_2.0 - } -+libowcrypt { -+ OW_CRYPT_1.0 -+} - libdl { - GLIBC_2.0 - GLIBC_2.1 -Index: glibc-2.19/crypt/Makefile -=================================================================== ---- glibc-2.19.orig/crypt/Makefile -+++ glibc-2.19/crypt/Makefile -@@ -21,14 +21,18 @@ - subdir := crypt +--- glibc-2.19.90.orig/crypt/Makefile ++++ glibc-2.19.90/crypt/Makefile +@@ -23,14 +23,18 @@ subdir := crypt + include ../Makeconfig headers := crypt.h +headers += gnu-crypt.h ow-crypt.h @@ -35,12 +21,12 @@ Index: glibc-2.19/crypt/Makefile + +tests := cert md5c-test sha256c-test sha512c-test - include ../Makeconfig - -Index: glibc-2.19/crypt/Versions + ifeq ($(crypt-in-libc),yes) + routines += $(libcrypt-routines) +Index: glibc-2.19.90/crypt/Versions =================================================================== ---- glibc-2.19.orig/crypt/Versions -+++ glibc-2.19/crypt/Versions +--- glibc-2.19.90.orig/crypt/Versions ++++ glibc-2.19.90/crypt/Versions @@ -3,3 +3,8 @@ libcrypt { crypt; crypt_r; encrypt; encrypt_r; fcrypt; setkey; setkey_r; } @@ -50,10 +36,10 @@ Index: glibc-2.19/crypt/Versions + crypt_gensalt; crypt_gensalt_rn; crypt_gensalt_ra; + } +} -Index: glibc-2.19/crypt/crypt-entry.c +Index: glibc-2.19.90/crypt/crypt-entry.c =================================================================== ---- glibc-2.19.orig/crypt/crypt-entry.c -+++ glibc-2.19/crypt/crypt-entry.c +--- glibc-2.19.90.orig/crypt/crypt-entry.c ++++ glibc-2.19.90/crypt/crypt-entry.c @@ -81,7 +81,7 @@ extern struct crypt_data _ufc_foobar; */ @@ -76,130 +62,10 @@ Index: glibc-2.19/crypt/crypt-entry.c } #endif +#endif -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libowcrypt.abilist +Index: glibc-2.19.90/shlib-versions =================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/alpha/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/alpha/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/arm/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/arm/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/ia64/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/ia64/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libowcrypt.abilist -=================================================================== ---- /dev/null -+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libowcrypt.abilist -@@ -0,0 +1,5 @@ -+OW_CRYPT_1.0 -+ OW_CRYPT_1.0 A -+ crypt_gensalt F -+ crypt_gensalt_ra F -+ crypt_gensalt_rn F -Index: glibc-2.19/shlib-versions -=================================================================== ---- glibc-2.19.orig/shlib-versions -+++ glibc-2.19/shlib-versions +--- glibc-2.19.90.orig/shlib-versions ++++ glibc-2.19.90/shlib-versions @@ -93,6 +93,7 @@ sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_ # This defines the shared library version numbers we will install. @@ -208,120 +74,270 @@ Index: glibc-2.19/shlib-versions # The gross patch for programs assuming broken locale implementations. sh.*-.*-.* libBrokenLocale=1 GLIBC_2.2 -Index: glibc-2.19/sysdeps/unix/sysv/linux/i386/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/aarch64/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/i386/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/aarch64/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/alpha/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/alpha/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/arm/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/arm/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libowcrypt-le.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/hppa/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libowcrypt-le.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/hppa/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/i386/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/i386/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/ia64/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/ia64/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/m68k/coldfire/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/m68k/coldfire/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/sh/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/m68k/m680x0/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/sh/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/m68k/m680x0/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/microblaze/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/microblaze/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/mips/mips32/fpu/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/mips/mips32/fpu/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/x86_64/64/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/x86_64/64/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A + crypt_gensalt F + crypt_gensalt_ra F + crypt_gensalt_rn F -Index: glibc-2.19/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libowcrypt.abilist +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/mips/mips64/n32/libowcrypt.abilist =================================================================== --- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libowcrypt.abilist ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/mips/mips64/n32/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/mips/mips64/n64/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/mips/mips64/n64/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/powerpc/powerpc64/libowcrypt-le.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/powerpc/powerpc64/libowcrypt-le.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/powerpc/powerpc64/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/powerpc/powerpc64/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/s390/s390-32/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/s390/s390-32/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/s390/s390-64/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/s390/s390-64/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/sh/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/sh/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/sparc/sparc32/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/sparc/sparc32/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/sparc/sparc64/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/sparc/sparc64/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/tile/tilepro/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/tile/tilepro/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/x86_64/64/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/x86_64/64/libowcrypt.abilist +@@ -0,0 +1,5 @@ ++OW_CRYPT_1.0 ++ OW_CRYPT_1.0 A ++ crypt_gensalt F ++ crypt_gensalt_ra F ++ crypt_gensalt_rn F +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/x86_64/x32/libowcrypt.abilist +=================================================================== +--- /dev/null ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/x86_64/x32/libowcrypt.abilist @@ -0,0 +1,5 @@ +OW_CRYPT_1.0 + OW_CRYPT_1.0 A diff --git a/glibc-2.19.tar.xz b/glibc-2.19.tar.xz deleted file mode 100644 index f885fc4..0000000 --- a/glibc-2.19.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2d3997f588401ea095a0b27227b1d50cdfdd416236f6567b564549d3b46ea2a2 -size 12083312 diff --git a/glibc-2.20.tar.xz b/glibc-2.20.tar.xz new file mode 100644 index 0000000..797fc53 --- /dev/null +++ b/glibc-2.20.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f84b6d42aecc288d593c397b0a3d02260a33ee686bce0c634eb9b32798f36ba5 +size 12283992 diff --git a/glibc-2.3.90-langpackdir.diff b/glibc-2.3.90-langpackdir.diff index 8a34fca..73f35b7 100644 --- a/glibc-2.3.90-langpackdir.diff +++ b/glibc-2.3.90-langpackdir.diff @@ -7,7 +7,7 @@ Index: glibc-2.17.90/intl/loadmsgcat.c goto out; - /* Try to open the addressed file. */ -- fd = open (domain_file->filename, O_RDONLY); +- fd = open (domain_file->filename, O_RDONLY | O_BINARY); + /* Replace /locale/ with /usr/share/locale-langpack/ */ + const char *langpackdir = "/usr/share/locale-langpack/"; + char *filename_langpack = malloc (strlen (domain_file->filename) + @@ -20,18 +20,18 @@ Index: glibc-2.17.90/intl/loadmsgcat.c + strcpy (filename_langpack, langpackdir); + strcpy (&filename_langpack[strlen (langpackdir)], + (p+8)); -+ if ((fd = open (filename_langpack, O_RDONLY)) == -1) -+ fd = open (domain_file->filename, O_RDONLY); ++ if ((fd = open (filename_langpack, O_RDONLY | O_BINARY)) == -1) ++ fd = open (domain_file->filename, O_RDONLY | O_BINARY); + } + else + /* Try to open the addressed file. */ -+ fd = open (domain_file->filename, O_RDONLY); ++ fd = open (domain_file->filename, O_RDONLY | O_BINARY); + + free (filename_langpack); + } + else + /* Try to open the addressed file. */ -+ fd = open (domain_file->filename, O_RDONLY); ++ fd = open (domain_file->filename, O_RDONLY | O_BINARY); + + if (fd == -1) + { @@ -47,7 +47,7 @@ Index: glibc-2.17.90/intl/loadmsgcat.c + strcpy (filename_bundle, bundle_dir); + strcpy (&filename_bundle[strlen (bundle_dir)], + (p+8)); -+ fd = open (filename_bundle, O_RDONLY); ++ fd = open (filename_bundle, O_RDONLY | O_BINARY); + } + + free (filename_bundle); diff --git a/glibc-2.3.90-noversion.diff b/glibc-2.3.90-noversion.diff index 770b188..964fe99 100644 --- a/glibc-2.3.90-noversion.diff +++ b/glibc-2.3.90-noversion.diff @@ -1,8 +1,8 @@ -Index: glibc-2.17.90/elf/rtld.c +Index: glibc-2.19.90/elf/rtld.c =================================================================== ---- glibc-2.17.90.orig/elf/rtld.c -+++ glibc-2.17.90/elf/rtld.c -@@ -1717,6 +1717,53 @@ ERROR: ld.so: object '%s' cannot be load +--- glibc-2.19.90.orig/elf/rtld.c ++++ glibc-2.19.90/elf/rtld.c +@@ -1740,6 +1740,52 @@ ERROR: ld.so: object '%s' cannot be load } } @@ -18,32 +18,31 @@ Index: glibc-2.17.90/elf/rtld.c + */ +#define LIB_NOVERSION "/lib/obsolete/noversion/libNoVersion.so.1" + -+ if (__builtin_expect (main_map->l_info[DT_NUM + DT_THISPROCNUM ++ if (__glibc_unlikely (main_map->l_info[DT_NUM + DT_THISPROCNUM + + DT_VERSIONTAGIDX (DT_VERNEED)] -+ == NULL, 0) -+ && (main_map->l_info[DT_DEBUG] ++ == NULL) ++ && (main_map->l_info[DT_DEBUG] != 0 + || !(GLRO(dl_debug_mask) & DL_DEBUG_PRELINK))) + { + struct stat test_st; + int test_fd; -+ int can_load; ++ bool can_load; + + HP_TIMING_NOW (start); + -+ can_load = 1; ++ can_load = true; + test_fd = __open (LIB_NOVERSION, O_RDONLY); -+ if (test_fd < 0) { -+ can_load = 0; -+ } else { -+ if (__fxstat (_STAT_VER, test_fd, &test_st) < 0 || test_st.st_size == 0) { -+ can_load = 0; ++ if (test_fd < 0) ++ can_load = false; ++ else ++ { ++ if (__fxstat (_STAT_VER, test_fd, &test_st) < 0 ++ || test_st.st_size == 0) ++ can_load = false; ++ __close(test_fd); + } -+ } + -+ if (test_fd >= 0) /* open did no fail.. */ -+ __close(test_fd); /* avoid fd leaks */ -+ -+ if (can_load != 0) ++ if (can_load) + npreloads += do_preload (LIB_NOVERSION, main_map, + "nonversioned binary"); + @@ -53,6 +52,6 @@ Index: glibc-2.17.90/elf/rtld.c + } +#endif + - if (__builtin_expect (*first_preload != NULL, 0)) + if (__glibc_unlikely (*first_preload != NULL)) { /* Set up PRELOADS with a vector of the preloaded libraries. */ diff --git a/glibc-nodate.patch b/glibc-nodate.patch index 5ea4b75..a5b2f5d 100644 --- a/glibc-nodate.patch +++ b/glibc-nodate.patch @@ -1,18 +1,3 @@ -Index: glibc-2.17.90/csu/Makefile -=================================================================== ---- glibc-2.17.90.orig/csu/Makefile -+++ glibc-2.17.90/csu/Makefile -@@ -162,8 +162,8 @@ $(objpfx)version-info.h: $(common-objpfx - if [ -z "$$os" ]; then \ - os=Linux; \ - fi; \ -- printf '"Compiled on a %s %s system on %s.\\n"\n' \ -- "$$os" "$$version" "`date +%Y-%m-%d`";; \ -+ printf '"Compiled on a %s %s system.\\n"\n' \ -+ "$$os" "$$version";; \ - *) ;; \ - esac; \ - files="$(all-Banner-files)"; \ Index: glibc-2.17.90/nscd/nscd_stat.c =================================================================== --- glibc-2.17.90.orig/nscd/nscd_stat.c diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index 383ec79..2648c16 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,53 @@ +------------------------------------------------------------------- +Mon Sep 8 09:48:26 UTC 2014 - schwab@suse.de + +- Update to glibc 2.20 release. + * Reverted change of ABI data structures for s390 and s390x + * Support for file description locks is added to systems running the + Linux kernel + * Optimized strchr implementation for AArch64 + * The minimum Linux kernel version that this version of the GNU C Library + can be used with is 2.6.32 + * Running the testsuite no longer terminates as soon as a test fails + * The am33 port, which had not worked for several years, has been removed + from ports. + * The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer + supported; they now act the same as _DEFAULT_SOURCE (but generate a + warning) + * Optimized strcmp implementation for ARMv7 + * Added support for TX lock elision of pthread mutexes on s390 and s390x + * All supported architectures now use the main glibc sysdeps directory + instead of some being in a separate "ports" directory + * The NPTL implementation of POSIX pthreads is no longer an "add-on" + * Locale names, including those obtained from environment variables (LANG + and the LC_* variables), are more tightly checked for proper syntax + * On x86-64, the dynamic linker's lazy-binding support is now compatible + with application code using Intel MPX instructions +- Patches from upstream removed + * nss-dns-memleak.patch + * sin-sign.patch + * pldd-wait-ptrace-stop.patch + * nscd-track-startup-failures.patch + * powerpc-opt-power8.patch + * check-pf-alloca.patch + * getaddrinfo-uninit-result.patch + * ppc64-copysign.patch + * nextafterl-ibm-ldouble.patch + * ibm-long-double-math.patch + * ibm-long-double-frexpl.patch + * aarch64-setcontext.patch + * nss-nis-stack-use.patch + * psfaa.patch + * nss-files-long-lines.patch + * setlocale-directory-traversal.patch + * dt-ppc64-num.patch + * ppc64le-profiling.patch + * s390-revert-abi-change.patch + * disable-gconv-translit-modules.patch + * resolv-dont-ignore-second-answer.patch + * iconv-ibm-sentinel-check.patch +- Remove sprof.1, and mtrace.1, now included in the man-pages package + ------------------------------------------------------------------- Tue Sep 2 07:52:36 UTC 2014 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index 1a14e99..446406d 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -100,10 +100,10 @@ BuildRequires: gd-devel # 3.1 is the openSUSE 12.1 kernel %define enablekernel 3.0 -Version: 2.19 +Version: 2.20 Release: 0 -%define glibc_major_version 2.19 -%define git_id 9a869d822025 +%define glibc_major_version 2.20 +%define git_id b8079dd0d360 Url: http://www.gnu.org/software/libc/libc.html BuildRoot: %{_tmppath}/%{name}-%{version}-build #Source: glibc-%{version}-%{git_id}.tar.xz @@ -232,54 +232,12 @@ Patch306: glibc-fix-double-loopback.diff ### # Patches from upstream ### -# PATCH-FIX-UPSTREAM fix memory leak in nss_dns -Patch1000: nss-dns-memleak.patch -# PATCH-FIX-UPSTREAM Fix sign of input to bsloww1 (BZ #16623) -Patch1001: sin-sign.patch -# PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching -Patch1002: pldd-wait-ptrace-stop.patch -# PATCH-FIX-UPSTREAM Improved support for tracking startup failure in nscd service (BZ #16639) -Patch1003: nscd-track-startup-failures.patch -# PATCH-FIX-UPSTREAM GLIBC Optimizations For POWER8 Hardware -Patch1004: powerpc-opt-power8.patch -# PATCH-FIX-UPSTREAM Account for alloca use when collecting interface addresses -Patch1005: check-pf-alloca.patch -# PATCH-FIX-UPSTREAM Fix use of half-initialized result in getaddrinfo when using nscd -Patch1006: getaddrinfo-uninit-result.patch -# PATCH-FIX-UPSTREAM Fix ppc64le copysign overwriting parent stack frame (BZ #16786) -Patch1007: ppc64-copysign.patch -# PATCH-FIX-UPSTREAM Correct IBM long double nextafterl (BZ #16739) -Patch1008: nextafterl-ibm-ldouble.patch -# PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) -Patch1009: ibm-long-double-math.patch -# PATCH-FIX-UPSTREAM Correct IBM long double frexpl (BZ #16740, BZ #16619) -Patch1010: ibm-long-double-frexpl.patch -# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) -Patch1011: aarch64-setcontext.patch -# PATCH-FIX-UPSTREAM Fix unbound stack use in NIS NSS module (BZ #16932) -Patch1012: nss-nis-stack-use.patch -# PATCH-FIX-UPSTREAM posix_spawn_file_actions_addopen needs to copy the path argument (BZ #17048) -Patch1013: psfaa.patch -# PATCH-FIX-UPSTREAM Don't ignore too long lines in nss_files (BZ #17079) -Patch1014: nss-files-long-lines.patch -# PATCH-FIX-UPSTREAM Directory traversal in locale environment handling (BZ #17137) -Patch1015: setlocale-directory-traversal.patch -# PATCH-FIX-UPSTREAM Correct DT_PPC64_NUM (BZ #17153) -Patch1016: dt-ppc64-num.patch -# PATCH-FIX-UPSTREAM PowerPC: Fix gprof entry point for LE (BZ #17213) -Patch1017: ppc64le-profiling.patch -# PATCH-FIX-UPSTREAM S/390 Reverting the jmp_buf/ucontext_t ABI change (bnc#887228) -Patch1018: s390-revert-abi-change.patch -# PATCH-FIX-UPSTREAM Disable gconv transliteration module loading (BZ #17187) -Patch1019: disable-gconv-translit-modules.patch ### # Patches awaiting upstream approval ### # PATCH-FIX-UPSTREAM Always to locking when accessing streams (BZ #15142) Patch2000: fix-locking-in-_IO_cleanup.patch -# PATCH-FIX-UPSTREAM Don't ignore second answer from nameserver if the first one was empty (BZ #13651) -Patch2001: resolv-dont-ignore-second-answer.patch # PATCH-FIX-UPSTREAM Never try to execute the file in ldd (BZ #16750) Patch2002: ldd-system-interp.patch # PATCH-FIX-UPSTREAM Don't close or flush stdio streams on abort (BZ #15436) @@ -292,8 +250,6 @@ Patch2005: glibc-memset-nontemporal.diff Patch2006: ibm93x-redundant-shift-si.patch # PATCH-FIX-UPSTREAM Filter out PTHREAD_MUTEX_NO_ELISION_NP bit in pthread_mutexattr_gettype (BZ #15790) Patch2007: pthread-mutexattr-gettype-kind.patch -# PATCH-FIX-UPSTREAM Fix crashes on invalid input in IBM gconv modules (BZ #17325) -Patch2008: iconv-ibm-sentinel-check.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -494,36 +450,13 @@ rm nscd/s-stamp %patch304 -p1 %patch306 -p1 -%patch1000 -p1 -%patch1001 -p1 -%patch1002 -p1 -%patch1003 -p1 -%patch1004 -p1 -%patch1005 -p1 -%patch1006 -p1 -%patch1007 -p1 -%patch1008 -p1 -%patch1009 -p1 -%patch1010 -p1 -%patch1011 -p1 -%patch1012 -p1 -%patch1013 -p1 -%patch1014 -p1 -%patch1015 -p1 -%patch1016 -p1 -%patch1017 -p1 -%patch1018 -p1 -%patch1019 -p1 - %patch2000 -p1 -%patch2001 -p1 %patch2002 -p1 %patch2003 -p1 %patch2004 -p1 %patch2005 -p1 %patch2006 -p1 %patch2007 -p1 -%patch2008 -p1 %patch3000 @@ -581,10 +514,10 @@ echo "#define GITID \"%{git_id}\"" >> version.h # Default CFLAGS and Compiler # BuildFlags="%{optflags} -U_FORTIFY_SOURCE" -BuildFlags="$(echo $BuildFlags | sed -e 's#-fstack-protector##' -e 's#-ffortify=[0-9]*##')" +BuildFlags=$(echo $BuildFlags | sed -e 's#-fstack-protector##' -e 's#-ffortify=[0-9]*##') BuildCC="%__cc" BuildCCplus="%__cxx" -add_ons=",libidn" +add_ons=libidn # #now overwrite for some architectures # @@ -626,9 +559,6 @@ add_ons=",libidn" %ifarch %ix86 add_ons=$add_ons,noversion %endif -%ifarch %arm aarch64 mipsel ia64 m68k - add_ons=$add_ons,ports -%endif %ifarch mipsel # fails to build otherwise - need to recheck and fix %define enable_stackguard_randomization 0 @@ -637,7 +567,6 @@ add_ons=",libidn" configure_and_build_glibc() { local dirname="$1"; shift local cflags="$1"; shift - local addons="$1"; shift mkdir "cc-$dirname" cd "cc-$dirname" %ifarch %arm aarch64 @@ -664,7 +593,7 @@ configure_and_build_glibc() { CC="$BuildCC" CXX="$BuildCCplus" \ --prefix=%{_prefix} \ --libexecdir=%{_libexecdir} --infodir=%{_infodir} \ - --enable-add-ons=nptl$addons \ + --enable-add-ons=$add_ons \ $profile $elision \ "$@" \ %if %{enable_stackguard_randomization} @@ -694,7 +623,7 @@ configure_and_build_glibc() { # # Build base glibc # - configure_and_build_glibc base "$BuildFlags" "$add_ons" + configure_and_build_glibc base "$BuildFlags" %else # # Build POWER-optimized glibc @@ -705,10 +634,10 @@ configure_and_build_glibc() { pBuildFlags+=" -mcpu=%{powerpc_optimize_base}" %endif %if "%{powerpc_optimize_base}" != "" - configure_and_build_glibc base "$pBuildFlags" "$add_ons" --with-cpu=%{powerpc_optimize_base} + configure_and_build_glibc base "$pBuildFlags" --with-cpu=%{powerpc_optimize_base} %else # Use no default CPU - configure_and_build_glibc base "$pBuildFlags" "$add_ons" + configure_and_build_glibc base "$pBuildFlags" %endif %if %{build_variants} # Then other power variants: @@ -723,19 +652,19 @@ configure_and_build_glibc() { power7 \ %endif ; do - configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" "$add_ons" \ + configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" \ --with-cpu=$pcpu done # Eventually, special Cell variant: %if %{powerpc_optimize_cpu_cell} - configure_and_build_glibc ppc-cell-be "$BuildFlags -mcpu=cell" "$add_ons" + configure_and_build_glibc ppc-cell-be "$BuildFlags -mcpu=cell" %endif %endif # %{build_variants} %endif # optimize_power %if %{build_variants} %ifarch i686 x86_64 -configure_and_build_glibc noelision "$BuildFlags" "$add_ons" +configure_and_build_glibc noelision "$BuildFlags" %endif %endif @@ -785,8 +714,25 @@ popd export SUSE_ASNEEDED=0 # Increase timeout export TIMEOUTFACTOR=16 -make -C cc-base -k check || -find cc-base -name "*.out" | tar -czf - -T - | base64 +make -C cc-base -k check || { + cd cc-base + o=$- + set +x + for sum in */*.sum; do + while read s t; do + case $s in + XPASS:|PASS:) + echo ++++++ $s $t ++++++ + ;; + *) # X?FAIL: + echo ------ $s $t ------ + test ! -f $t.out || cat $t.out + ;; + esac + done < $sum + done + set -$o +} %else # This has to pass on all platforms! # Exceptions: @@ -1016,7 +962,6 @@ rm -f %{buildroot}%{_bindir}/pcprofiledump rm -f %{buildroot}%{_bindir}/sotruss rm -f %{buildroot}%{_bindir}/xtrace rm -f %{buildroot}%{_bindir}/pldd -rm -f %{buildroot}%{_mandir}/man1/mtrace.* rm -rf %{buildroot}%{_libdir}/audit %ifarch i686 @@ -1041,8 +986,7 @@ rm -f %{buildroot}/%{_lib}/ld*.so* %{buildroot}/%{_lib}/lib[!mp]* rm -f %{buildroot}/lib/ld*.so* rm -f %{buildroot}%{_libdir}/lib* rm -f %{buildroot}%{_bindir}/{catchsegv,ldd*,sprof} -rm -f %{buildroot}%{_mandir}/man1/[!m]* -rm -rf %{buildroot}%{_mandir}/man[!1] +rm -rf %{buildroot}%{_mandir}/man* rm -rf %{buildroot}/sbin %{buildroot}%{_includedir} %endif # %{utils_build} @@ -1266,7 +1210,6 @@ exit 0 %doc COPYING COPYING.LIB NEWS README BUGS CONFORMANCE %doc %{_mandir}/man1/catchsegv.1.gz %doc %{_mandir}/man1/rpcgen.1.gz -%doc %{_mandir}/man1/sprof.1.gz %doc %{_mandir}/man3/* %{_bindir}/catchsegv %{_bindir}/rpcgen @@ -1377,7 +1320,6 @@ exit 0 %{_bindir}/sotruss %{_bindir}/xtrace %{_bindir}/pldd -%doc %{_mandir}/man1/mtrace.1.gz %endif # %{utils_build} %changelog diff --git a/glibc-utils.changes b/glibc-utils.changes index 383ec79..2648c16 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,53 @@ +------------------------------------------------------------------- +Mon Sep 8 09:48:26 UTC 2014 - schwab@suse.de + +- Update to glibc 2.20 release. + * Reverted change of ABI data structures for s390 and s390x + * Support for file description locks is added to systems running the + Linux kernel + * Optimized strchr implementation for AArch64 + * The minimum Linux kernel version that this version of the GNU C Library + can be used with is 2.6.32 + * Running the testsuite no longer terminates as soon as a test fails + * The am33 port, which had not worked for several years, has been removed + from ports. + * The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer + supported; they now act the same as _DEFAULT_SOURCE (but generate a + warning) + * Optimized strcmp implementation for ARMv7 + * Added support for TX lock elision of pthread mutexes on s390 and s390x + * All supported architectures now use the main glibc sysdeps directory + instead of some being in a separate "ports" directory + * The NPTL implementation of POSIX pthreads is no longer an "add-on" + * Locale names, including those obtained from environment variables (LANG + and the LC_* variables), are more tightly checked for proper syntax + * On x86-64, the dynamic linker's lazy-binding support is now compatible + with application code using Intel MPX instructions +- Patches from upstream removed + * nss-dns-memleak.patch + * sin-sign.patch + * pldd-wait-ptrace-stop.patch + * nscd-track-startup-failures.patch + * powerpc-opt-power8.patch + * check-pf-alloca.patch + * getaddrinfo-uninit-result.patch + * ppc64-copysign.patch + * nextafterl-ibm-ldouble.patch + * ibm-long-double-math.patch + * ibm-long-double-frexpl.patch + * aarch64-setcontext.patch + * nss-nis-stack-use.patch + * psfaa.patch + * nss-files-long-lines.patch + * setlocale-directory-traversal.patch + * dt-ppc64-num.patch + * ppc64le-profiling.patch + * s390-revert-abi-change.patch + * disable-gconv-translit-modules.patch + * resolv-dont-ignore-second-answer.patch + * iconv-ibm-sentinel-check.patch +- Remove sprof.1, and mtrace.1, now included in the man-pages package + ------------------------------------------------------------------- Tue Sep 2 07:52:36 UTC 2014 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index 1ca5852..8f4f771 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -99,10 +99,10 @@ BuildRequires: gd-devel # 3.1 is the openSUSE 12.1 kernel %define enablekernel 3.0 -Version: 2.19 +Version: 2.20 Release: 0 -%define glibc_major_version 2.19 -%define git_id 9a869d822025 +%define glibc_major_version 2.20 +%define git_id b8079dd0d360 Url: http://www.gnu.org/software/libc/libc.html BuildRoot: %{_tmppath}/%{name}-%{version}-build #Source: glibc-%{version}-%{git_id}.tar.xz @@ -231,54 +231,12 @@ Patch306: glibc-fix-double-loopback.diff ### # Patches from upstream ### -# PATCH-FIX-UPSTREAM fix memory leak in nss_dns -Patch1000: nss-dns-memleak.patch -# PATCH-FIX-UPSTREAM Fix sign of input to bsloww1 (BZ #16623) -Patch1001: sin-sign.patch -# PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching -Patch1002: pldd-wait-ptrace-stop.patch -# PATCH-FIX-UPSTREAM Improved support for tracking startup failure in nscd service (BZ #16639) -Patch1003: nscd-track-startup-failures.patch -# PATCH-FIX-UPSTREAM GLIBC Optimizations For POWER8 Hardware -Patch1004: powerpc-opt-power8.patch -# PATCH-FIX-UPSTREAM Account for alloca use when collecting interface addresses -Patch1005: check-pf-alloca.patch -# PATCH-FIX-UPSTREAM Fix use of half-initialized result in getaddrinfo when using nscd -Patch1006: getaddrinfo-uninit-result.patch -# PATCH-FIX-UPSTREAM Fix ppc64le copysign overwriting parent stack frame (BZ #16786) -Patch1007: ppc64-copysign.patch -# PATCH-FIX-UPSTREAM Correct IBM long double nextafterl (BZ #16739) -Patch1008: nextafterl-ibm-ldouble.patch -# PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) -Patch1009: ibm-long-double-math.patch -# PATCH-FIX-UPSTREAM Correct IBM long double frexpl (BZ #16740, BZ #16619) -Patch1010: ibm-long-double-frexpl.patch -# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) -Patch1011: aarch64-setcontext.patch -# PATCH-FIX-UPSTREAM Fix unbound stack use in NIS NSS module (BZ #16932) -Patch1012: nss-nis-stack-use.patch -# PATCH-FIX-UPSTREAM posix_spawn_file_actions_addopen needs to copy the path argument (BZ #17048) -Patch1013: psfaa.patch -# PATCH-FIX-UPSTREAM Don't ignore too long lines in nss_files (BZ #17079) -Patch1014: nss-files-long-lines.patch -# PATCH-FIX-UPSTREAM Directory traversal in locale environment handling (BZ #17137) -Patch1015: setlocale-directory-traversal.patch -# PATCH-FIX-UPSTREAM Correct DT_PPC64_NUM (BZ #17153) -Patch1016: dt-ppc64-num.patch -# PATCH-FIX-UPSTREAM PowerPC: Fix gprof entry point for LE (BZ #17213) -Patch1017: ppc64le-profiling.patch -# PATCH-FIX-UPSTREAM S/390 Reverting the jmp_buf/ucontext_t ABI change (bnc#887228) -Patch1018: s390-revert-abi-change.patch -# PATCH-FIX-UPSTREAM Disable gconv transliteration module loading (BZ #17187) -Patch1019: disable-gconv-translit-modules.patch ### # Patches awaiting upstream approval ### # PATCH-FIX-UPSTREAM Always to locking when accessing streams (BZ #15142) Patch2000: fix-locking-in-_IO_cleanup.patch -# PATCH-FIX-UPSTREAM Don't ignore second answer from nameserver if the first one was empty (BZ #13651) -Patch2001: resolv-dont-ignore-second-answer.patch # PATCH-FIX-UPSTREAM Never try to execute the file in ldd (BZ #16750) Patch2002: ldd-system-interp.patch # PATCH-FIX-UPSTREAM Don't close or flush stdio streams on abort (BZ #15436) @@ -291,8 +249,6 @@ Patch2005: glibc-memset-nontemporal.diff Patch2006: ibm93x-redundant-shift-si.patch # PATCH-FIX-UPSTREAM Filter out PTHREAD_MUTEX_NO_ELISION_NP bit in pthread_mutexattr_gettype (BZ #15790) Patch2007: pthread-mutexattr-gettype-kind.patch -# PATCH-FIX-UPSTREAM Fix crashes on invalid input in IBM gconv modules (BZ #17325) -Patch2008: iconv-ibm-sentinel-check.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -494,36 +450,13 @@ rm nscd/s-stamp %patch304 -p1 %patch306 -p1 -%patch1000 -p1 -%patch1001 -p1 -%patch1002 -p1 -%patch1003 -p1 -%patch1004 -p1 -%patch1005 -p1 -%patch1006 -p1 -%patch1007 -p1 -%patch1008 -p1 -%patch1009 -p1 -%patch1010 -p1 -%patch1011 -p1 -%patch1012 -p1 -%patch1013 -p1 -%patch1014 -p1 -%patch1015 -p1 -%patch1016 -p1 -%patch1017 -p1 -%patch1018 -p1 -%patch1019 -p1 - %patch2000 -p1 -%patch2001 -p1 %patch2002 -p1 %patch2003 -p1 %patch2004 -p1 %patch2005 -p1 %patch2006 -p1 %patch2007 -p1 -%patch2008 -p1 %patch3000 @@ -581,10 +514,10 @@ echo "#define GITID \"%{git_id}\"" >> version.h # Default CFLAGS and Compiler # BuildFlags="%{optflags} -U_FORTIFY_SOURCE" -BuildFlags="$(echo $BuildFlags | sed -e 's#-fstack-protector##' -e 's#-ffortify=[0-9]*##')" +BuildFlags=$(echo $BuildFlags | sed -e 's#-fstack-protector##' -e 's#-ffortify=[0-9]*##') BuildCC="%__cc" BuildCCplus="%__cxx" -add_ons=",libidn" +add_ons=libidn # #now overwrite for some architectures # @@ -626,9 +559,6 @@ add_ons=",libidn" %ifarch %ix86 add_ons=$add_ons,noversion %endif -%ifarch %arm aarch64 mipsel ia64 m68k - add_ons=$add_ons,ports -%endif %ifarch mipsel # fails to build otherwise - need to recheck and fix %define enable_stackguard_randomization 0 @@ -637,7 +567,6 @@ add_ons=",libidn" configure_and_build_glibc() { local dirname="$1"; shift local cflags="$1"; shift - local addons="$1"; shift mkdir "cc-$dirname" cd "cc-$dirname" %ifarch %arm aarch64 @@ -664,7 +593,7 @@ configure_and_build_glibc() { CC="$BuildCC" CXX="$BuildCCplus" \ --prefix=%{_prefix} \ --libexecdir=%{_libexecdir} --infodir=%{_infodir} \ - --enable-add-ons=nptl$addons \ + --enable-add-ons=$add_ons \ $profile $elision \ "$@" \ %if %{enable_stackguard_randomization} @@ -694,7 +623,7 @@ configure_and_build_glibc() { # # Build base glibc # - configure_and_build_glibc base "$BuildFlags" "$add_ons" + configure_and_build_glibc base "$BuildFlags" %else # # Build POWER-optimized glibc @@ -705,10 +634,10 @@ configure_and_build_glibc() { pBuildFlags+=" -mcpu=%{powerpc_optimize_base}" %endif %if "%{powerpc_optimize_base}" != "" - configure_and_build_glibc base "$pBuildFlags" "$add_ons" --with-cpu=%{powerpc_optimize_base} + configure_and_build_glibc base "$pBuildFlags" --with-cpu=%{powerpc_optimize_base} %else # Use no default CPU - configure_and_build_glibc base "$pBuildFlags" "$add_ons" + configure_and_build_glibc base "$pBuildFlags" %endif %if %{build_variants} # Then other power variants: @@ -723,19 +652,19 @@ configure_and_build_glibc() { power7 \ %endif ; do - configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" "$add_ons" \ + configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" \ --with-cpu=$pcpu done # Eventually, special Cell variant: %if %{powerpc_optimize_cpu_cell} - configure_and_build_glibc ppc-cell-be "$BuildFlags -mcpu=cell" "$add_ons" + configure_and_build_glibc ppc-cell-be "$BuildFlags -mcpu=cell" %endif %endif # %{build_variants} %endif # optimize_power %if %{build_variants} %ifarch i686 x86_64 -configure_and_build_glibc noelision "$BuildFlags" "$add_ons" +configure_and_build_glibc noelision "$BuildFlags" %endif %endif @@ -785,8 +714,25 @@ popd export SUSE_ASNEEDED=0 # Increase timeout export TIMEOUTFACTOR=16 -make -C cc-base -k check || -find cc-base -name "*.out" | tar -czf - -T - | base64 +make -C cc-base -k check || { + cd cc-base + o=$- + set +x + for sum in */*.sum; do + while read s t; do + case $s in + XPASS:|PASS:) + echo ++++++ $s $t ++++++ + ;; + *) # X?FAIL: + echo ------ $s $t ------ + test ! -f $t.out || cat $t.out + ;; + esac + done < $sum + done + set -$o +} %else # This has to pass on all platforms! # Exceptions: @@ -1016,7 +962,6 @@ rm -f %{buildroot}%{_bindir}/pcprofiledump rm -f %{buildroot}%{_bindir}/sotruss rm -f %{buildroot}%{_bindir}/xtrace rm -f %{buildroot}%{_bindir}/pldd -rm -f %{buildroot}%{_mandir}/man1/mtrace.* rm -rf %{buildroot}%{_libdir}/audit %ifarch i686 @@ -1041,8 +986,7 @@ rm -f %{buildroot}/%{_lib}/ld*.so* %{buildroot}/%{_lib}/lib[!mp]* rm -f %{buildroot}/lib/ld*.so* rm -f %{buildroot}%{_libdir}/lib* rm -f %{buildroot}%{_bindir}/{catchsegv,ldd*,sprof} -rm -f %{buildroot}%{_mandir}/man1/[!m]* -rm -rf %{buildroot}%{_mandir}/man[!1] +rm -rf %{buildroot}%{_mandir}/man* rm -rf %{buildroot}/sbin %{buildroot}%{_includedir} %endif # %{utils_build} @@ -1266,7 +1210,6 @@ exit 0 %doc COPYING COPYING.LIB NEWS README BUGS CONFORMANCE %doc %{_mandir}/man1/catchsegv.1.gz %doc %{_mandir}/man1/rpcgen.1.gz -%doc %{_mandir}/man1/sprof.1.gz %doc %{_mandir}/man3/* %{_bindir}/catchsegv %{_bindir}/rpcgen @@ -1377,7 +1320,6 @@ exit 0 %{_bindir}/sotruss %{_bindir}/xtrace %{_bindir}/pldd -%doc %{_mandir}/man1/mtrace.1.gz %endif # %{utils_build} %changelog diff --git a/glibc.changes b/glibc.changes index 383ec79..2648c16 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,53 @@ +------------------------------------------------------------------- +Mon Sep 8 09:48:26 UTC 2014 - schwab@suse.de + +- Update to glibc 2.20 release. + * Reverted change of ABI data structures for s390 and s390x + * Support for file description locks is added to systems running the + Linux kernel + * Optimized strchr implementation for AArch64 + * The minimum Linux kernel version that this version of the GNU C Library + can be used with is 2.6.32 + * Running the testsuite no longer terminates as soon as a test fails + * The am33 port, which had not worked for several years, has been removed + from ports. + * The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer + supported; they now act the same as _DEFAULT_SOURCE (but generate a + warning) + * Optimized strcmp implementation for ARMv7 + * Added support for TX lock elision of pthread mutexes on s390 and s390x + * All supported architectures now use the main glibc sysdeps directory + instead of some being in a separate "ports" directory + * The NPTL implementation of POSIX pthreads is no longer an "add-on" + * Locale names, including those obtained from environment variables (LANG + and the LC_* variables), are more tightly checked for proper syntax + * On x86-64, the dynamic linker's lazy-binding support is now compatible + with application code using Intel MPX instructions +- Patches from upstream removed + * nss-dns-memleak.patch + * sin-sign.patch + * pldd-wait-ptrace-stop.patch + * nscd-track-startup-failures.patch + * powerpc-opt-power8.patch + * check-pf-alloca.patch + * getaddrinfo-uninit-result.patch + * ppc64-copysign.patch + * nextafterl-ibm-ldouble.patch + * ibm-long-double-math.patch + * ibm-long-double-frexpl.patch + * aarch64-setcontext.patch + * nss-nis-stack-use.patch + * psfaa.patch + * nss-files-long-lines.patch + * setlocale-directory-traversal.patch + * dt-ppc64-num.patch + * ppc64le-profiling.patch + * s390-revert-abi-change.patch + * disable-gconv-translit-modules.patch + * resolv-dont-ignore-second-answer.patch + * iconv-ibm-sentinel-check.patch +- Remove sprof.1, and mtrace.1, now included in the man-pages package + ------------------------------------------------------------------- Tue Sep 2 07:52:36 UTC 2014 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index 3ec081c..e78a302 100644 --- a/glibc.spec +++ b/glibc.spec @@ -100,10 +100,10 @@ BuildRequires: gd-devel # 3.1 is the openSUSE 12.1 kernel %define enablekernel 3.0 -Version: 2.19 +Version: 2.20 Release: 0 -%define glibc_major_version 2.19 -%define git_id 9a869d822025 +%define glibc_major_version 2.20 +%define git_id b8079dd0d360 Url: http://www.gnu.org/software/libc/libc.html BuildRoot: %{_tmppath}/%{name}-%{version}-build #Source: glibc-%{version}-%{git_id}.tar.xz @@ -232,54 +232,12 @@ Patch306: glibc-fix-double-loopback.diff ### # Patches from upstream ### -# PATCH-FIX-UPSTREAM fix memory leak in nss_dns -Patch1000: nss-dns-memleak.patch -# PATCH-FIX-UPSTREAM Fix sign of input to bsloww1 (BZ #16623) -Patch1001: sin-sign.patch -# PATCH-FIX-UPSTREAM Fix pldd not to leave process stopped after detaching -Patch1002: pldd-wait-ptrace-stop.patch -# PATCH-FIX-UPSTREAM Improved support for tracking startup failure in nscd service (BZ #16639) -Patch1003: nscd-track-startup-failures.patch -# PATCH-FIX-UPSTREAM GLIBC Optimizations For POWER8 Hardware -Patch1004: powerpc-opt-power8.patch -# PATCH-FIX-UPSTREAM Account for alloca use when collecting interface addresses -Patch1005: check-pf-alloca.patch -# PATCH-FIX-UPSTREAM Fix use of half-initialized result in getaddrinfo when using nscd -Patch1006: getaddrinfo-uninit-result.patch -# PATCH-FIX-UPSTREAM Fix ppc64le copysign overwriting parent stack frame (BZ #16786) -Patch1007: ppc64-copysign.patch -# PATCH-FIX-UPSTREAM Correct IBM long double nextafterl (BZ #16739) -Patch1008: nextafterl-ibm-ldouble.patch -# PATCH-FIX-UPSTREAM Remove faulty assembler implementations for IBM long double (BZ #16701, BZ #16706, BZ #16707) -Patch1009: ibm-long-double-math.patch -# PATCH-FIX-UPSTREAM Correct IBM long double frexpl (BZ #16740, BZ #16619) -Patch1010: ibm-long-double-frexpl.patch -# PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) -Patch1011: aarch64-setcontext.patch -# PATCH-FIX-UPSTREAM Fix unbound stack use in NIS NSS module (BZ #16932) -Patch1012: nss-nis-stack-use.patch -# PATCH-FIX-UPSTREAM posix_spawn_file_actions_addopen needs to copy the path argument (BZ #17048) -Patch1013: psfaa.patch -# PATCH-FIX-UPSTREAM Don't ignore too long lines in nss_files (BZ #17079) -Patch1014: nss-files-long-lines.patch -# PATCH-FIX-UPSTREAM Directory traversal in locale environment handling (BZ #17137) -Patch1015: setlocale-directory-traversal.patch -# PATCH-FIX-UPSTREAM Correct DT_PPC64_NUM (BZ #17153) -Patch1016: dt-ppc64-num.patch -# PATCH-FIX-UPSTREAM PowerPC: Fix gprof entry point for LE (BZ #17213) -Patch1017: ppc64le-profiling.patch -# PATCH-FIX-UPSTREAM S/390 Reverting the jmp_buf/ucontext_t ABI change (bnc#887228) -Patch1018: s390-revert-abi-change.patch -# PATCH-FIX-UPSTREAM Disable gconv transliteration module loading (BZ #17187) -Patch1019: disable-gconv-translit-modules.patch ### # Patches awaiting upstream approval ### # PATCH-FIX-UPSTREAM Always to locking when accessing streams (BZ #15142) Patch2000: fix-locking-in-_IO_cleanup.patch -# PATCH-FIX-UPSTREAM Don't ignore second answer from nameserver if the first one was empty (BZ #13651) -Patch2001: resolv-dont-ignore-second-answer.patch # PATCH-FIX-UPSTREAM Never try to execute the file in ldd (BZ #16750) Patch2002: ldd-system-interp.patch # PATCH-FIX-UPSTREAM Don't close or flush stdio streams on abort (BZ #15436) @@ -292,8 +250,6 @@ Patch2005: glibc-memset-nontemporal.diff Patch2006: ibm93x-redundant-shift-si.patch # PATCH-FIX-UPSTREAM Filter out PTHREAD_MUTEX_NO_ELISION_NP bit in pthread_mutexattr_gettype (BZ #15790) Patch2007: pthread-mutexattr-gettype-kind.patch -# PATCH-FIX-UPSTREAM Fix crashes on invalid input in IBM gconv modules (BZ #17325) -Patch2008: iconv-ibm-sentinel-check.patch # Non-glibc patches # PATCH-FIX-OPENSUSE Remove debianisms from manpages @@ -494,36 +450,13 @@ rm nscd/s-stamp %patch304 -p1 %patch306 -p1 -%patch1000 -p1 -%patch1001 -p1 -%patch1002 -p1 -%patch1003 -p1 -%patch1004 -p1 -%patch1005 -p1 -%patch1006 -p1 -%patch1007 -p1 -%patch1008 -p1 -%patch1009 -p1 -%patch1010 -p1 -%patch1011 -p1 -%patch1012 -p1 -%patch1013 -p1 -%patch1014 -p1 -%patch1015 -p1 -%patch1016 -p1 -%patch1017 -p1 -%patch1018 -p1 -%patch1019 -p1 - %patch2000 -p1 -%patch2001 -p1 %patch2002 -p1 %patch2003 -p1 %patch2004 -p1 %patch2005 -p1 %patch2006 -p1 %patch2007 -p1 -%patch2008 -p1 %patch3000 @@ -581,10 +514,10 @@ echo "#define GITID \"%{git_id}\"" >> version.h # Default CFLAGS and Compiler # BuildFlags="%{optflags} -U_FORTIFY_SOURCE" -BuildFlags="$(echo $BuildFlags | sed -e 's#-fstack-protector##' -e 's#-ffortify=[0-9]*##')" +BuildFlags=$(echo $BuildFlags | sed -e 's#-fstack-protector##' -e 's#-ffortify=[0-9]*##') BuildCC="%__cc" BuildCCplus="%__cxx" -add_ons=",libidn" +add_ons=libidn # #now overwrite for some architectures # @@ -626,9 +559,6 @@ add_ons=",libidn" %ifarch %ix86 add_ons=$add_ons,noversion %endif -%ifarch %arm aarch64 mipsel ia64 m68k - add_ons=$add_ons,ports -%endif %ifarch mipsel # fails to build otherwise - need to recheck and fix %define enable_stackguard_randomization 0 @@ -637,7 +567,6 @@ add_ons=",libidn" configure_and_build_glibc() { local dirname="$1"; shift local cflags="$1"; shift - local addons="$1"; shift mkdir "cc-$dirname" cd "cc-$dirname" %ifarch %arm aarch64 @@ -664,7 +593,7 @@ configure_and_build_glibc() { CC="$BuildCC" CXX="$BuildCCplus" \ --prefix=%{_prefix} \ --libexecdir=%{_libexecdir} --infodir=%{_infodir} \ - --enable-add-ons=nptl$addons \ + --enable-add-ons=$add_ons \ $profile $elision \ "$@" \ %if %{enable_stackguard_randomization} @@ -694,7 +623,7 @@ configure_and_build_glibc() { # # Build base glibc # - configure_and_build_glibc base "$BuildFlags" "$add_ons" + configure_and_build_glibc base "$BuildFlags" %else # # Build POWER-optimized glibc @@ -705,10 +634,10 @@ configure_and_build_glibc() { pBuildFlags+=" -mcpu=%{powerpc_optimize_base}" %endif %if "%{powerpc_optimize_base}" != "" - configure_and_build_glibc base "$pBuildFlags" "$add_ons" --with-cpu=%{powerpc_optimize_base} + configure_and_build_glibc base "$pBuildFlags" --with-cpu=%{powerpc_optimize_base} %else # Use no default CPU - configure_and_build_glibc base "$pBuildFlags" "$add_ons" + configure_and_build_glibc base "$pBuildFlags" %endif %if %{build_variants} # Then other power variants: @@ -723,19 +652,19 @@ configure_and_build_glibc() { power7 \ %endif ; do - configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" "$add_ons" \ + configure_and_build_glibc $pcpu "$BuildFlags -mcpu=$pcpu" \ --with-cpu=$pcpu done # Eventually, special Cell variant: %if %{powerpc_optimize_cpu_cell} - configure_and_build_glibc ppc-cell-be "$BuildFlags -mcpu=cell" "$add_ons" + configure_and_build_glibc ppc-cell-be "$BuildFlags -mcpu=cell" %endif %endif # %{build_variants} %endif # optimize_power %if %{build_variants} %ifarch i686 x86_64 -configure_and_build_glibc noelision "$BuildFlags" "$add_ons" +configure_and_build_glibc noelision "$BuildFlags" %endif %endif @@ -785,8 +714,25 @@ popd export SUSE_ASNEEDED=0 # Increase timeout export TIMEOUTFACTOR=16 -make -C cc-base -k check || -find cc-base -name "*.out" | tar -czf - -T - | base64 +make -C cc-base -k check || { + cd cc-base + o=$- + set +x + for sum in */*.sum; do + while read s t; do + case $s in + XPASS:|PASS:) + echo ++++++ $s $t ++++++ + ;; + *) # X?FAIL: + echo ------ $s $t ------ + test ! -f $t.out || cat $t.out + ;; + esac + done < $sum + done + set -$o +} %else # This has to pass on all platforms! # Exceptions: @@ -1016,7 +962,6 @@ rm -f %{buildroot}%{_bindir}/pcprofiledump rm -f %{buildroot}%{_bindir}/sotruss rm -f %{buildroot}%{_bindir}/xtrace rm -f %{buildroot}%{_bindir}/pldd -rm -f %{buildroot}%{_mandir}/man1/mtrace.* rm -rf %{buildroot}%{_libdir}/audit %ifarch i686 @@ -1041,8 +986,7 @@ rm -f %{buildroot}/%{_lib}/ld*.so* %{buildroot}/%{_lib}/lib[!mp]* rm -f %{buildroot}/lib/ld*.so* rm -f %{buildroot}%{_libdir}/lib* rm -f %{buildroot}%{_bindir}/{catchsegv,ldd*,sprof} -rm -f %{buildroot}%{_mandir}/man1/[!m]* -rm -rf %{buildroot}%{_mandir}/man[!1] +rm -rf %{buildroot}%{_mandir}/man* rm -rf %{buildroot}/sbin %{buildroot}%{_includedir} %endif # %{utils_build} @@ -1266,7 +1210,6 @@ exit 0 %doc COPYING COPYING.LIB NEWS README BUGS CONFORMANCE %doc %{_mandir}/man1/catchsegv.1.gz %doc %{_mandir}/man1/rpcgen.1.gz -%doc %{_mandir}/man1/sprof.1.gz %doc %{_mandir}/man3/* %{_bindir}/catchsegv %{_bindir}/rpcgen @@ -1377,7 +1320,6 @@ exit 0 %{_bindir}/sotruss %{_bindir}/xtrace %{_bindir}/pldd -%doc %{_mandir}/man1/mtrace.1.gz %endif # %{utils_build} %changelog diff --git a/ibm-long-double-frexpl.patch b/ibm-long-double-frexpl.patch deleted file mode 100644 index 5b1e3b8..0000000 --- a/ibm-long-double-frexpl.patch +++ /dev/null @@ -1,194 +0,0 @@ -2014-04-16 Alan Modra - - [BZ #16740] - [BZ #16619] - * sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Rewrite. - * math/libm-test.inc (frexp_test_data): Add tests. - -Index: glibc-2.19/math/libm-test.inc -=================================================================== ---- glibc-2.19.orig/math/libm-test.inc -+++ glibc-2.19/math/libm-test.inc -@@ -8723,6 +8723,15 @@ static const struct test_f_f1_data frexp - - TEST_fI_f1 (frexp, 12.8L, 0.8L, 4, NO_INEXACT_EXCEPTION), - TEST_fI_f1 (frexp, -27.34L, -0.854375L, 5, NO_INEXACT_EXCEPTION), -+ -+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106 -+ TEST_fI_f1 (frexp, 1.0L-0x1p-106L, 1.0L-0x1p-106L, 0, NO_INEXACT_EXCEPTION), -+ TEST_fI_f1 (frexp, 1.0L, 0.5L, 1, NO_INEXACT_EXCEPTION), -+ TEST_fI_f1 (frexp, 1.0L+0x1p-105L, 0.5L+0x1p-106L, 1, NO_INEXACT_EXCEPTION), -+ TEST_fI_f1 (frexp, -1.0L+0x1p-106L, -1.0L+0x1p-106L, 0, NO_INEXACT_EXCEPTION), -+ TEST_fI_f1 (frexp, -1.0L, -0.5L, 1, NO_INEXACT_EXCEPTION), -+ TEST_fI_f1 (frexp, -1.0L-0x1p-105L, -0.5L-0x1p-106L, 1, NO_INEXACT_EXCEPTION), -+#endif - }; - - static void -Index: glibc-2.19/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c -=================================================================== ---- glibc-2.19.orig/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c -+++ glibc-2.19/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c -@@ -31,57 +31,115 @@ static char rcsid[] = "$NetBSD: $"; - #include - #include - --static const long double --two107 = 162259276829213363391578010288128.0; /* 0x4670000000000000, 0 */ -- - long double __frexpl(long double x, int *eptr) - { -- uint64_t hx, lx, ix, ixl; -- int64_t explo; -- double xhi, xlo; -- -- ldbl_unpack (x, &xhi, &xlo); -- EXTRACT_WORDS64 (hx, xhi); -- EXTRACT_WORDS64 (lx, xlo); -- ixl = 0x7fffffffffffffffULL&lx; -- ix = 0x7fffffffffffffffULL&hx; -- *eptr = 0; -- if(ix>=0x7ff0000000000000ULL||ix==0) return x; /* 0,inf,nan */ -- if (ix<0x0010000000000000ULL) { /* subnormal */ -- x *= two107; -- xhi = ldbl_high (x); -- EXTRACT_WORDS64 (hx, xhi); -- ix = hx&0x7fffffffffffffffULL; -- *eptr = -107; -+ uint64_t hx, lx, ix, ixl; -+ int64_t explo, expon; -+ double xhi, xlo; -+ -+ ldbl_unpack (x, &xhi, &xlo); -+ EXTRACT_WORDS64 (hx, xhi); -+ EXTRACT_WORDS64 (lx, xlo); -+ ixl = 0x7fffffffffffffffULL & lx; -+ ix = 0x7fffffffffffffffULL & hx; -+ expon = 0; -+ if (ix >= 0x7ff0000000000000ULL || ix == 0) -+ { -+ /* 0,inf,nan. */ -+ *eptr = expon; -+ return x; -+ } -+ expon = ix >> 52; -+ if (expon == 0) -+ { -+ /* Denormal high double, the low double must be 0.0. */ -+ int cnt; -+ -+ /* Normalize. */ -+ if (sizeof (ix) == sizeof (long)) -+ cnt = __builtin_clzl (ix); -+ else if ((ix >> 32) != 0) -+ cnt = __builtin_clzl ((long) (ix >> 32)); -+ else -+ cnt = __builtin_clzl ((long) ix) + 32; -+ cnt = cnt - 12; -+ expon -= cnt; -+ ix <<= cnt + 1; -+ } -+ expon -= 1022; -+ ix &= 0x000fffffffffffffULL; -+ hx &= 0x8000000000000000ULL; -+ hx |= (1022LL << 52) | ix; -+ -+ if (ixl != 0) -+ { -+ /* If the high double is an exact power of two and the low -+ double has the opposite sign, then the exponent calculated -+ from the high double is one too big. */ -+ if (ix == 0 -+ && (int64_t) (hx ^ lx) < 0) -+ { -+ hx += 1L << 52; -+ expon -= 1; -+ } -+ -+ explo = ixl >> 52; -+ if (explo == 0) -+ { -+ /* The low double started out as a denormal. Normalize its -+ mantissa and adjust the exponent. */ -+ int cnt; -+ -+ if (sizeof (ixl) == sizeof (long)) -+ cnt = __builtin_clzl (ixl); -+ else if ((ixl >> 32) != 0) -+ cnt = __builtin_clzl ((long) (ixl >> 32)); -+ else -+ cnt = __builtin_clzl ((long) ixl) + 32; -+ cnt = cnt - 12; -+ explo -= cnt; -+ ixl <<= cnt + 1; -+ } -+ -+ /* With variable precision we can't assume much about the -+ magnitude of the returned low double. It may even be a -+ denormal. */ -+ explo -= expon; -+ ixl &= 0x000fffffffffffffULL; -+ lx &= 0x8000000000000000ULL; -+ if (explo <= 0) -+ { -+ /* Handle denormal low double. */ -+ if (explo > -52) -+ { -+ ixl |= 1LL << 52; -+ ixl >>= 1 - explo; -+ } -+ else -+ { -+ ixl = 0; -+ lx = 0; -+ if ((hx & 0x7ff0000000000000ULL) == (1023LL << 52)) -+ { -+ /* Oops, the adjustment we made above for values a -+ little smaller than powers of two turned out to -+ be wrong since the returned low double will be -+ zero. This can happen if the input was -+ something weird like 0x1p1000 - 0x1p-1000. */ -+ hx -= 1L << 52; -+ expon += 1; -+ } -+ } -+ explo = 0; - } -- *eptr += (ix>>52)-1022; -+ lx |= (explo << 52) | ixl; -+ } - -- if (ixl != 0ULL) { -- explo = (ixl>>52) - (ix>>52) + 0x3fe; -- if ((ixl&0x7ff0000000000000ULL) == 0LL) { -- /* the lower double is a denormal so we need to correct its -- mantissa and perhaps its exponent. */ -- int cnt; -- -- if (sizeof (ixl) == sizeof (long)) -- cnt = __builtin_clzl (ixl); -- else if ((ixl >> 32) != 0) -- cnt = __builtin_clzl ((long) (ixl >> 32)); -- else -- cnt = __builtin_clzl ((long) ixl) + 32; -- cnt = cnt - 12; -- lx = (lx&0x8000000000000000ULL) | ((explo-cnt)<<52) -- | ((ixl<<(cnt+1))&0x000fffffffffffffULL); -- } else -- lx = (lx&0x800fffffffffffffULL) | (explo<<52); -- } else -- lx = 0ULL; -- -- hx = (hx&0x800fffffffffffffULL) | 0x3fe0000000000000ULL; -- INSERT_WORDS64 (xhi, hx); -- INSERT_WORDS64 (xlo, lx); -- x = ldbl_pack (xhi, xlo); -- return x; -+ INSERT_WORDS64 (xhi, hx); -+ INSERT_WORDS64 (xlo, lx); -+ x = ldbl_pack (xhi, xlo); -+ *eptr = expon; -+ return x; - } - #ifdef IS_IN_libm - long_double_symbol (libm, __frexpl, frexpl); diff --git a/ibm-long-double-math.patch b/ibm-long-double-math.patch deleted file mode 100644 index c34d2c3..0000000 --- a/ibm-long-double-math.patch +++ /dev/null @@ -1,462 +0,0 @@ -2014-03-14 Adhemerval Zanella - - [BZ #16707] - * sysdeps/powerpc/powerpc64/fpu/s_roundl.S: Remove wrong - implementation. - * math/libm-test.inc (round_test_data): Add more tests. - - [BZ #16706] - * sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S: Remove wrong - implementation. - * math/libm-test.inc (nearbyint_test_data): Add more tests. - - [BZ #16701] - * sysdeps/powerpc/powerpc64/fpu/s_ceill.S: Remove wrong - implementation. - * math/libm-test.inc (ceil_test_data): Add more tests. - -Index: glibc-2.19/math/libm-test.inc -=================================================================== ---- glibc-2.19.orig/math/libm-test.inc -+++ glibc-2.19/math/libm-test.inc -@@ -6000,6 +6000,15 @@ static const struct test_f_f_data ceil_t - TEST_f_f (ceil, -72057594037927936.75L, -72057594037927936.0L), - TEST_f_f (ceil, -72057594037927937.5L, -72057594037927937.0L), - -+ /* Check cases where first double is a exact integer higher than 2^52 and -+ the precision is determined by second long double for IBM long double. */ -+ TEST_f_f (ceil, 34503599627370498.515625L, 34503599627370499.0L), -+ TEST_f_f (ceil, -34503599627370498.515625L, -34503599627370498.0L), -+# if LDBL_MANT_DIG >= 106 -+ TEST_f_f (ceil, 1192568192774434123539907640624.484375L, 1192568192774434123539907640625.0L), -+ TEST_f_f (ceil, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L), -+# endif -+ - TEST_f_f (ceil, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L), - TEST_f_f (ceil, 10141204801825835211973625643008.25L, 10141204801825835211973625643009.0L), - TEST_f_f (ceil, 10141204801825835211973625643008.5L, 10141204801825835211973625643009.0L), -@@ -10495,6 +10504,16 @@ static const struct test_f_f_data nearby - TEST_f_f (nearbyint, -562949953421312.75, -562949953421313.0, NO_INEXACT_EXCEPTION), - TEST_f_f (nearbyint, -1125899906842624.75, -1125899906842625.0, NO_INEXACT_EXCEPTION), - #endif -+#ifdef TEST_LDOUBLE -+ /* Check cases where first double is a exact integer higher than 2^52 and -+ the precision is determined by second long double for IBM long double. */ -+ TEST_f_f (nearbyint, 34503599627370498.515625L, 34503599627370499.0L), -+ TEST_f_f (nearbyint, -34503599627370498.515625L, -34503599627370499.0L), -+# if LDBL_MANT_DIG >= 106 -+ TEST_f_f (nearbyint, 1192568192774434123539907640624.484375L, 1192568192774434123539907640624.0L), -+ TEST_f_f (nearbyint, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L), -+# endif -+#endif - }; - - static void -@@ -11792,6 +11811,15 @@ static const struct test_f_f_data round_ - TEST_f_f (round, -72057594037927936.75L, -72057594037927937.0L), - TEST_f_f (round, -72057594037927937.5L, -72057594037927938.0L), - -+ /* Check cases where first double is a exact integer higher than 2^52 and -+ the precision is determined by second long double for IBM long double. */ -+ TEST_f_f (round, 34503599627370498.515625L, 34503599627370499.0L), -+ TEST_f_f (round, -34503599627370498.515625L, -34503599627370499.0L), -+# if LDBL_MANT_DIG >= 106 -+ TEST_f_f (round, 1192568192774434123539907640624.484375L, 1192568192774434123539907640624.0L), -+ TEST_f_f (round, -1192568192774434123539907640624.484375L, -1192568192774434123539907640624.0L), -+# endif -+ - TEST_f_f (round, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L), - TEST_f_f (round, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L), - TEST_f_f (round, 10141204801825835211973625643008.5L, 10141204801825835211973625643009.0L), -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/s_ceill.S -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/s_ceill.S -+++ /dev/null -@@ -1,132 +0,0 @@ --/* s_ceill.S IBM extended format long double version. -- Copyright (C) 2004-2014 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 -- . */ -- --#include --#include -- -- .section ".toc","aw" --.LC0: /* 2**52 */ -- .tc FD_43300000_0[TC],0x4330000000000000 -- -- .section ".text" -- --/* long double [fp1,fp2] ceill (long double x [fp1,fp2]) -- IEEE 1003.1 ceil function. -- -- PowerPC64 long double uses the IBM extended format which is -- represented two 64-floating point double values. The values are -- non-overlapping giving an effective precision of 106 bits. The first -- double contains the high order bits of mantissa and is always ceiled -- to represent a normal ceiling of long double to double. Since the -- long double value is sum of the high and low values, the low double -- normally has the opposite sign to compensate for the this ceiling. -- -- For long double there are two cases: -- 1) |x| < 2**52, all the integer bits are in the high double. -- ceil the high double and set the low double to -0.0. -- 2) |x| >= 2**52, ceiling involves both doubles. -- See the comment before label .L2 for details. -- */ -- --ENTRY (__ceill) -- mffs fp11 /* Save current FPU rounding mode. */ -- lfd fp13,.LC0@toc(2) -- fabs fp0,fp1 -- fabs fp9,fp2 -- fsub fp12,fp13,fp13 /* generate 0.0 */ -- fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ -- fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ -- bnl- cr7,.L2 -- mtfsfi 7,2 /* Set rounding mode toward +inf. */ -- fneg fp2,fp12 -- ble- cr6,.L1 -- fadd fp1,fp1,fp13 /* x+= TWO52; */ -- fsub fp1,fp1,fp13 /* x-= TWO52; */ -- fabs fp1,fp1 /* if (x == 0.0) */ --.L0: -- mtfsf 0x01,fp11 /* restore previous rounding mode. */ -- blr /* x = 0.0; */ --.L1: -- bge- cr6,.L0 /* if (x < 0.0) */ -- fsub fp1,fp1,fp13 /* x-= TWO52; */ -- fadd fp1,fp1,fp13 /* x+= TWO52; */ -- fcmpu cr5,fp1,fp12 /* if (x > 0.0) */ -- mtfsf 0x01,fp11 /* restore previous rounding mode. */ -- fnabs fp1,fp1 /* if (x == 0.0) */ -- blr /* x = -0.0; */ -- --/* The high double is > TWO52 so we need to round the low double and -- perhaps the high double. In this case we have to round the low -- double and handle any adjustment to the high double that may be -- caused by rounding (up). This is complicated by the fact that the -- high double may already be rounded and the low double may have the -- opposite sign to compensate.This gets a bit tricky so we use the -- following algorithm: -- -- tau = floor(x_high/TWO52); -- x0 = x_high - tau; -- x1 = x_low + tau; -- r1 = rint(x1); -- y_high = x0 + r1; -- y_low = x0 - y_high + r1; -- return y; */ --.L2: -- fcmpu cr7,fp9,fp13 /* if (|x_low| > TWO52) */ -- fcmpu cr0,fp9,fp12 /* || (|x_low| == 0.0) */ -- fcmpu cr5,fp2,fp12 /* if (x_low > 0.0) */ -- bgelr- cr7 /* return x; */ -- beqlr- cr0 -- mtfsfi 7,2 /* Set rounding mode toward +inf. */ -- fdiv fp8,fp1,fp13 /* x_high/TWO52 */ -- -- bng- cr6,.L6 /* if (x > 0.0) */ -- fctidz fp0,fp8 -- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ -- bng cr5,.L4 /* if (x_low > 0.0) */ -- fmr fp3,fp1 -- fmr fp4,fp2 -- b .L5 --.L4: /* if (x_low < 0.0) */ -- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ -- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ --.L5: -- fadd fp5,fp4,fp13 /* r1 = r1 + TWO52; */ -- fsub fp5,fp5,fp13 /* r1 = r1 - TWO52; */ -- b .L9 --.L6: /* if (x < 0.0) */ -- fctidz fp0,fp8 -- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ -- bnl cr5,.L7 /* if (x_low < 0.0) */ -- fmr fp3,fp1 -- fmr fp4,fp2 -- b .L8 --.L7: /* if (x_low > 0.0) */ -- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ -- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ --.L8: -- fsub fp5,fp4,fp13 /* r1-= TWO52; */ -- fadd fp5,fp5,fp13 /* r1+= TWO52; */ --.L9: -- mtfsf 0x01,fp11 /* restore previous rounding mode. */ -- fadd fp1,fp3,fp5 /* y_high = x0 + r1; */ -- fsub fp2,fp3,fp1 /* y_low = x0 - y_high + r1; */ -- fadd fp2,fp2,fp5 -- blr --END (__ceill) -- --long_double_symbol (libm, __ceill, ceill) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/s_nearbyintl.S -+++ /dev/null -@@ -1,113 +0,0 @@ --/* nearbyint long double. -- IBM extended format long double version. -- Copyright (C) 2004-2014 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 -- . */ -- --#include --#include -- -- .section ".toc","aw" --.LC0: /* 2**52 */ -- .tc FD_43300000_0[TC],0x4330000000000000 -- .section ".text" -- --/* long double [fp1,fp2] nearbyintl (long double x [fp1,fp2]) -- IEEE 1003.1 nearbyintl function. nearbyintl is similar to the rintl -- but does raise the "inexact" exception. This implementation is -- based on rintl but explicitly masks the inexact exception on entry -- and clears any pending inexact before restoring the exception mask -- on exit. -- -- PowerPC64 long double uses the IBM extended format which is -- represented two 64-floating point double values. The values are -- non-overlapping giving an effective precision of 106 bits. The first -- double contains the high order bits of mantissa and is always rounded -- to represent a normal rounding of long double to double. Since the -- long double value is sum of the high and low values, the low double -- normally has the opposite sign to compensate for the this rounding. -- -- For long double there are two cases: -- 1) |x| < 2**52, all the integer bits are in the high double. -- floor the high double and set the low double to -0.0. -- 2) |x| >= 2**52, Rounding involves both doubles. -- See the comment before label .L2 for details. -- */ --ENTRY (__nearbyintl) -- mffs fp11 /* Save current FPSCR. */ -- lfd fp13,.LC0@toc(2) -- fabs fp0,fp1 -- mtfsb0 28 /* Disable "inexact" exceptions. */ -- fsub fp12,fp13,fp13 /* generate 0.0 */ -- fabs fp9,fp2 -- fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ -- fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ -- bnl- cr7,.L2 -- fmr fp2,fp12 -- bng- cr6,.L4 -- fadd fp1,fp1,fp13 /* x+= TWO52; */ -- fsub fp1,fp1,fp13 /* x-= TWO52; */ -- b .L9 --.L4: -- bnl- cr6,.L9 /* if (x < 0.0) */ -- fsub fp1,fp13,fp1 /* x = TWO52 - x; */ -- fsub fp0,fp1,fp13 /* x = - (x - TWO52); */ -- fneg fp1,fp0 --.L9: -- mtfsb0 6 /* Clear any pending "inexact" exceptions. */ -- mtfsf 0x01,fp11 /* restore exception mask. */ -- blr -- --/* The high double is > TWO52 so we need to round the low double and -- perhaps the high double. This gets a bit tricky so we use the -- following algorithm: -- -- tau = floor(x_high/TWO52); -- x0 = x_high - tau; -- x1 = x_low + tau; -- r1 = nearbyint(x1); -- y_high = x0 + r1; -- y_low = r1 - tau; -- return y; */ --.L2: -- fcmpu cr7,fp9,fp13 /* if (|x_low| > TWO52) */ -- fcmpu cr0,fp9,fp12 /* || (|x_low| == 0.0) */ -- bge- cr7,.L9 /* return x; */ -- beq- cr0,.L9 -- fdiv fp8,fp1,fp13 /* x_high/TWO52 */ -- fctidz fp0,fp8 -- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ -- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ -- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ -- -- fcmpu cr6,fp4,fp12 /* if (x1 > 0.0) */ -- bng- cr6,.L8 -- fadd fp5,fp4,fp13 /* r1 = x1 + TWO52; */ -- fsub fp5,fp5,fp13 /* r1 = r1 - TWO52; */ -- b .L6 --.L8: -- fmr fp5,fp4 -- bge- cr6,.L6 /* if (x1 < 0.0) */ -- fsub fp5,fp13,fp4 /* r1 = TWO52 - x1; */ -- fsub fp0,fp5,fp13 /* r1 = - (r1 - TWO52); */ -- fneg fp5,fp0 --.L6: -- fadd fp1,fp3,fp5 /* y_high = x0 + r1; */ -- fsub fp2,fp5,fp8 /* y_low = r1 - tau; */ -- b .L9 --END (__nearbyintl) -- --long_double_symbol (libm, __nearbyintl, nearbyintl) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/s_roundl.S -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/s_roundl.S -+++ /dev/null -@@ -1,132 +0,0 @@ --/* long double round function. -- IBM extended format long double version. -- Copyright (C) 2004-2014 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 -- . */ -- --#include --#include -- -- .section ".toc","aw" --.LC0: /* 2**52 */ -- .tc FD_43300000_0[TC],0x4330000000000000 --.LC1: /* 0.5 */ -- .tc FD_3fe00000_0[TC],0x3fe0000000000000 -- .section ".text" -- --/* long double [fp1,fp2] roundl (long double x [fp1,fp2]) -- IEEE 1003.1 round function. IEEE specifies "round to the nearest -- integer value, rounding halfway cases away from zero, regardless of -- the current rounding mode." However PowerPC Architecture defines -- "Round to Nearest" as "Choose the best approximation. In case of a -- tie, choose the one that is even (least significant bit o).". -- So we can't use the PowerPC "Round to Nearest" mode. Instead we set -- "Round toward Zero" mode and round by adding +-0.5 before rounding -- to the integer value. */ -- --ENTRY (__roundl) -- mffs fp11 /* Save current FPU rounding mode. */ -- lfd fp13,.LC0@toc(2) -- fabs fp0,fp1 -- fabs fp9,fp2 -- fsub fp12,fp13,fp13 /* generate 0.0 */ -- fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO52) */ -- fcmpu cr6,fp1,fp12 /* if (x > 0.0) */ -- bnl- cr7,.L2 -- mtfsfi 7,1 /* Set rounding mode toward 0. */ -- lfd fp10,.LC1@toc(2) -- ble- cr6,.L1 -- fneg fp2,fp12 -- fadd fp1,fp1,fp10 /* x+= 0.5; */ -- fadd fp1,fp1,fp13 /* x+= TWO52; */ -- fsub fp1,fp1,fp13 /* x-= TWO52; */ -- fabs fp1,fp1 /* if (x == 0.0) x = 0.0; */ --.L0: -- mtfsf 0x01,fp11 /* restore previous rounding mode. */ -- blr --.L1: -- fsub fp9,fp1,fp10 /* x-= 0.5; */ -- fneg fp2,fp12 -- bge- cr6,.L0 /* if (x < 0.0) */ -- fsub fp1,fp9,fp13 /* x-= TWO52; */ -- fadd fp1,fp1,fp13 /* x+= TWO52; */ -- fnabs fp1,fp1 /* if (x == 0.0) x = -0.0; */ -- mtfsf 0x01,fp11 /* restore previous rounding mode. */ -- blr -- --/* The high double is > TWO52 so we need to round the low double and -- perhaps the high double. In this case we have to round the low -- double and handle any adjustment to the high double that may be -- caused by rounding (up). This is complicated by the fact that the -- high double may already be rounded and the low double may have the -- opposite sign to compensate.This gets a bit tricky so we use the -- following algorithm: -- -- tau = floor(x_high/TWO52); -- x0 = x_high - tau; -- x1 = x_low + tau; -- r1 = rint(x1); -- y_high = x0 + r1; -- y_low = x0 - y_high + r1; -- return y; */ --.L2: -- fcmpu cr7,fp9,fp13 /* if (|x_low| > TWO52) */ -- fcmpu cr0,fp9,fp12 /* || (|x_low| == 0.0) */ -- fcmpu cr5,fp2,fp12 /* if (x_low > 0.0) */ -- lfd fp10,.LC1@toc(2) -- bgelr- cr7 /* return x; */ -- beqlr- cr0 -- mtfsfi 7,1 /* Set rounding mode toward 0. */ -- fdiv fp8,fp1,fp13 /* x_high/TWO52 */ -- -- bng- cr6,.L6 /* if (x > 0.0) */ -- fctidz fp0,fp8 -- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ -- bng cr5,.L4 /* if (x_low > 0.0) */ -- fmr fp3,fp1 -- fmr fp4,fp2 -- b .L5 --.L4: /* if (x_low < 0.0) */ -- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ -- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ --.L5: -- fadd fp5,fp4,fp10 /* r1 = x1 + 0.5; */ -- fadd fp5,fp5,fp13 /* r1 = r1 + TWO52; */ -- fsub fp5,fp5,fp13 /* r1 = r1 - TWO52; */ -- b .L9 --.L6: /* if (x < 0.0) */ -- fctidz fp0,fp8 -- fcfid fp8,fp0 /* tau = floor(x_high/TWO52); */ -- bnl cr5,.L7 /* if (x_low < 0.0) */ -- fmr fp3,fp1 -- fmr fp4,fp2 -- b .L8 --.L7: /* if (x_low > 0.0) */ -- fsub fp3,fp1,fp8 /* x0 = x_high - tau; */ -- fadd fp4,fp2,fp8 /* x1 = x_low + tau; */ --.L8: -- fsub fp5,fp4,fp10 /* r1 = x1 - 0.5; */ -- fsub fp5,fp5,fp13 /* r1-= TWO52; */ -- fadd fp5,fp5,fp13 /* r1+= TWO52; */ --.L9: -- mtfsf 0x01,fp11 /* restore previous rounding mode. */ -- fadd fp1,fp3,fp5 /* y_high = x0 + r1; */ -- fsub fp2,fp3,fp1 /* y_low = x0 - y_high + r1; */ -- fadd fp2,fp2,fp5 -- blr --END (__roundl) -- --long_double_symbol (libm, __roundl, roundl) diff --git a/ibm93x-redundant-shift-si.patch b/ibm93x-redundant-shift-si.patch index 640c61f..420b7c0 100644 --- a/ibm93x-redundant-shift-si.patch +++ b/ibm93x-redundant-shift-si.patch @@ -110,7 +110,7 @@ Index: glibc-2.19/iconvdata/ibm930.c + curcs = sb; \ } \ \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + if (__glibc_unlikely (outptr + 1 > outend)) \ @@ -268,7 +269,6 @@ enum *outptr++ = 0x5b; \ else \ @@ -130,7 +130,7 @@ Index: glibc-2.19/iconvdata/ibm933.c + curcs = sb; \ } \ \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + if (__glibc_unlikely (outptr + 1 > outend)) \ @@ -262,7 +263,6 @@ enum break; \ } \ @@ -150,7 +150,7 @@ Index: glibc-2.19/iconvdata/ibm935.c + curcs = sb; \ } \ \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + if (__glibc_unlikely (outptr + 1 > outend)) \ @@ -262,7 +263,6 @@ enum break; \ } \ @@ -170,7 +170,7 @@ Index: glibc-2.19/iconvdata/ibm937.c + curcs = sb; \ } \ \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + if (__glibc_unlikely (outptr + 1 > outend)) \ @@ -262,7 +263,6 @@ enum break; \ } \ @@ -190,7 +190,7 @@ Index: glibc-2.19/iconvdata/ibm939.c + curcs = sb; \ } \ \ - if (__builtin_expect (outptr + 1 > outend, 0)) \ + if (__glibc_unlikely (outptr + 1 > outend)) \ @@ -267,7 +268,6 @@ enum *outptr++ = 0xb2; \ else \ diff --git a/iconv-ibm-sentinel-check.patch b/iconv-ibm-sentinel-check.patch deleted file mode 100644 index 9ff0980..0000000 --- a/iconv-ibm-sentinel-check.patch +++ /dev/null @@ -1,162 +0,0 @@ -2014-08-29 Florian Weimer - - [BZ #17325] - * iconvdata/ibm1364.c (BODY): Fix check for sentinel. - * iconvdata/ibm932.c (BODY): Replace invalid sentinel check with - assert. - * iconvdata/ibm933.c (BODY): Fix check for sentinel. - * iconvdata/ibm935.c (BODY): Likewise. - * iconvdata/ibm937.c (BODY): Likewise. - * iconvdata/ibm939.c (BODY): Likewise. - * iconvdata/ibm943.c (BODY): Replace invalid sentinel check with - assert. - * iconvdata/Makefile (iconv-test.out): Pass module list to test - script. - * iconvdata/run-iconv-test.sh: New test loop for checking for - decoder crashers. - -Index: glibc-2.19/iconvdata/Makefile -=================================================================== ---- glibc-2.19.orig/iconvdata/Makefile -+++ glibc-2.19/iconvdata/Makefile -@@ -302,6 +302,7 @@ $(objpfx)bug-iconv10.out: $(objpfx)gconv - $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \ - $(addprefix $(objpfx),$(modules.so)) \ - $(common-objdir)/iconv/iconv_prog TESTS -+ iconv_modules="$(modules)" \ - $(SHELL) $< $(common-objdir) '$(test-wrapper)' > $@ - - $(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \ -Index: glibc-2.19/iconvdata/ibm1364.c -=================================================================== ---- glibc-2.19.orig/iconvdata/ibm1364.c -+++ glibc-2.19/iconvdata/ibm1364.c -@@ -220,7 +220,8 @@ enum - ++rp2; \ - \ - uint32_t res; \ -- if (__builtin_expect (ch < rp2->start, 0) \ -+ if (__builtin_expect (rp2->start == 0xffff, 0) \ -+ || __builtin_expect (ch < rp2->start, 0) \ - || (res = DB_TO_UCS4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ - { \ -Index: glibc-2.19/iconvdata/ibm932.c -=================================================================== ---- glibc-2.19.orig/iconvdata/ibm932.c -+++ glibc-2.19/iconvdata/ibm932.c -@@ -73,11 +73,12 @@ - } \ - \ - ch = (ch * 0x100) + inptr[1]; \ -+ /* ch was less than 0xfd. */ \ -+ assert (ch < 0xfd00); \ - while (ch > rp2->end) \ - ++rp2; \ - \ -- if (__builtin_expect (rp2 == NULL, 0) \ -- || __builtin_expect (ch < rp2->start, 0) \ -+ if (__builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm932db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, '\1') == 0 && ch !=0)) \ - { \ -Index: glibc-2.19/iconvdata/ibm933.c -=================================================================== ---- glibc-2.19.orig/iconvdata/ibm933.c -+++ glibc-2.19/iconvdata/ibm933.c -@@ -161,7 +161,7 @@ enum - while (ch > rp2->end) \ - ++rp2; \ - \ -- if (__builtin_expect (rp2 == NULL, 0) \ -+ if (__builtin_expect (rp2->start == 0xffff, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm933db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ -Index: glibc-2.19/iconvdata/ibm935.c -=================================================================== ---- glibc-2.19.orig/iconvdata/ibm935.c -+++ glibc-2.19/iconvdata/ibm935.c -@@ -161,7 +161,7 @@ enum - while (ch > rp2->end) \ - ++rp2; \ - \ -- if (__builtin_expect (rp2 == NULL, 0) \ -+ if (__builtin_expect (rp2->start == 0xffff, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm935db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ -Index: glibc-2.19/iconvdata/ibm937.c -=================================================================== ---- glibc-2.19.orig/iconvdata/ibm937.c -+++ glibc-2.19/iconvdata/ibm937.c -@@ -161,7 +161,7 @@ enum - while (ch > rp2->end) \ - ++rp2; \ - \ -- if (__builtin_expect (rp2 == NULL, 0) \ -+ if (__builtin_expect (rp2->start == 0xffff, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm937db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ -Index: glibc-2.19/iconvdata/ibm939.c -=================================================================== ---- glibc-2.19.orig/iconvdata/ibm939.c -+++ glibc-2.19/iconvdata/ibm939.c -@@ -161,7 +161,7 @@ enum - while (ch > rp2->end) \ - ++rp2; \ - \ -- if (__builtin_expect (rp2 == NULL, 0) \ -+ if (__builtin_expect (rp2->start == 0xffff, 0) \ - || __builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm939db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ -Index: glibc-2.19/iconvdata/ibm943.c -=================================================================== ---- glibc-2.19.orig/iconvdata/ibm943.c -+++ glibc-2.19/iconvdata/ibm943.c -@@ -74,11 +74,12 @@ - } \ - \ - ch = (ch * 0x100) + inptr[1]; \ -+ /* ch was less than 0xfd. */ \ -+ assert (ch < 0xfd00); \ - while (ch > rp2->end) \ - ++rp2; \ - \ -- if (__builtin_expect (rp2 == NULL, 0) \ -- || __builtin_expect (ch < rp2->start, 0) \ -+ if (__builtin_expect (ch < rp2->start, 0) \ - || (res = __ibm943db_to_ucs4[ch + rp2->idx], \ - __builtin_expect (res, '\1') == 0 && ch !=0)) \ - { \ -Index: glibc-2.19/iconvdata/run-iconv-test.sh -=================================================================== ---- glibc-2.19.orig/iconvdata/run-iconv-test.sh -+++ glibc-2.19/iconvdata/run-iconv-test.sh -@@ -188,6 +188,24 @@ while read utf8 from filename; do - - done < TESTS2 - -+# Check for crashes in decoders. -+printf '\016\377\377\377\377\377\377\377' > $temp1 -+for from in $iconv_modules ; do -+ echo $ac_n "test decoder $from $ac_c" -+ PROG=`eval echo $ICONV` -+ if $PROG < $temp1 >/dev/null 2>&1 ; then -+ : # fall through -+ else -+ status=$? -+ if test $status -gt 1 ; then -+ echo "/FAILED" -+ failed=1 -+ continue -+ fi -+ fi -+ echo "OK" -+done -+ - exit $failed - # Local Variables: - # mode:shell-script diff --git a/manpages.tar.bz2 b/manpages.tar.bz2 index 7f16f69..87cb48b 100644 --- a/manpages.tar.bz2 +++ b/manpages.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f05635b9beaec8379f31f0f0bc4ce2382b4ba734e97319ae37077e1eaa97f826 -size 11861 +oid sha256:e8715a207e621f2dea9f4d766d55514b9ac4dc91ea9652e7768cea0f950cc88b +size 10824 diff --git a/nextafterl-ibm-ldouble.patch b/nextafterl-ibm-ldouble.patch deleted file mode 100644 index c5d107f..0000000 --- a/nextafterl-ibm-ldouble.patch +++ /dev/null @@ -1,116 +0,0 @@ -2014-04-02 Alan Modra - - [BZ #16739] - * sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Correct - output when value is near a power of two. Use int64_t for lx and - remove casts. Use decimal rather than hex exponent constants. - Don't use long double multiplication when double will suffice. - * math/libm-test.inc (nextafter_test_data): Add tests. - -Index: glibc-2.19/math/libm-test.inc -=================================================================== ---- glibc-2.19.orig/math/libm-test.inc -+++ glibc-2.19/math/libm-test.inc -@@ -10528,6 +10528,14 @@ static const struct test_ff_f_data nexta - // XXX Enable once gcc is fixed. - //TEST_ff_f (nextafter, 0x0.00000040000000000000p-16385L, -0.1L, 0x0.0000003ffffffff00000p-16385L), - #endif -+#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 106 -+ TEST_ff_f (nextafter, 1.0L, -10.0L, 1.0L-0x1p-106L, NO_EXCEPTION), -+ TEST_ff_f (nextafter, 1.0L, 10.0L, 1.0L+0x1p-105L, NO_EXCEPTION), -+ TEST_ff_f (nextafter, 1.0L-0x1p-106L, 10.0L, 1.0L, NO_EXCEPTION), -+ TEST_ff_f (nextafter, -1.0L, -10.0L, -1.0L-0x1p-105L, NO_EXCEPTION), -+ TEST_ff_f (nextafter, -1.0L, 10.0L, -1.0L+0x1p-106L, NO_EXCEPTION), -+ TEST_ff_f (nextafter, -1.0L+0x1p-106L, -10.0L, -1.0L, NO_EXCEPTION), -+#endif - - /* XXX We need the hexadecimal FP number representation here for further - tests. */ -Index: glibc-2.19/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c -=================================================================== ---- glibc-2.19.orig/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c -+++ glibc-2.19/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c -@@ -30,8 +30,7 @@ static char rcsid[] = "$NetBSD: $"; - - long double __nextafterl(long double x, long double y) - { -- int64_t hx,hy,ihx,ihy; -- uint64_t lx; -+ int64_t hx, hy, ihx, ihy, lx; - double xhi, xlo, yhi; - - ldbl_unpack (x, &xhi, &xlo); -@@ -76,19 +75,28 @@ long double __nextafterl(long double x, - u = math_opt_barrier (x); - x -= __LDBL_DENORM_MIN__; - if (ihx < 0x0360000000000000LL -- || (hx > 0 && (int64_t) lx <= 0) -- || (hx < 0 && (int64_t) lx > 1)) { -+ || (hx > 0 && lx <= 0) -+ || (hx < 0 && lx > 1)) { - u = u * u; - math_force_eval (u); /* raise underflow flag */ - } - return x; - } -- if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ -- INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52)); -- u = yhi; -- u *= 0x1.0000000000000p-105L; -+ /* If the high double is an exact power of two and the low -+ double is the opposite sign, then 1ulp is one less than -+ what we might determine from the high double. Similarly -+ if X is an exact power of two, and positive, because -+ making it a little smaller will result in the exponent -+ decreasing by one and normalisation of the mantissa. */ -+ if ((hx & 0x000fffffffffffffLL) == 0 -+ && ((lx != 0 && (hx ^ lx) < 0) -+ || (lx == 0 && hx >= 0))) -+ ihx -= 1LL << 52; -+ if (ihx < (106LL << 52)) { /* ulp will denormal */ -+ INSERT_WORDS64 (yhi, ihx & (0x7ffLL<<52)); -+ u = yhi * 0x1p-105; - } else { -- INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52)); -+ INSERT_WORDS64 (yhi, (ihx & (0x7ffLL<<52))-(105LL<<52)); - u = yhi; - } - return x - u; -@@ -103,8 +111,8 @@ long double __nextafterl(long double x, - u = math_opt_barrier (x); - x += __LDBL_DENORM_MIN__; - if (ihx < 0x0360000000000000LL -- || (hx > 0 && (int64_t) lx < 0 && lx != 0x8000000000000001LL) -- || (hx < 0 && (int64_t) lx >= 0)) { -+ || (hx > 0 && lx < 0 && lx != 0x8000000000000001LL) -+ || (hx < 0 && lx >= 0)) { - u = u * u; - math_force_eval (u); /* raise underflow flag */ - } -@@ -112,12 +120,21 @@ long double __nextafterl(long double x, - x = -0.0L; - return x; - } -- if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ -- INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52)); -- u = yhi; -- u *= 0x1.0000000000000p-105L; -+ /* If the high double is an exact power of two and the low -+ double is the opposite sign, then 1ulp is one less than -+ what we might determine from the high double. Similarly -+ if X is an exact power of two, and negative, because -+ making it a little larger will result in the exponent -+ decreasing by one and normalisation of the mantissa. */ -+ if ((hx & 0x000fffffffffffffLL) == 0 -+ && ((lx != 0 && (hx ^ lx) < 0) -+ || (lx == 0 && hx < 0))) -+ ihx -= 1LL << 52; -+ if (ihx < (106LL << 52)) { /* ulp will denormal */ -+ INSERT_WORDS64 (yhi, ihx & (0x7ffLL<<52)); -+ u = yhi * 0x1p-105; - } else { -- INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52)); -+ INSERT_WORDS64 (yhi, (ihx & (0x7ffLL<<52))-(105LL<<52)); - u = yhi; - } - return x + u; diff --git a/noversion.tar.bz2 b/noversion.tar.bz2 index 3cab5fa..070dd48 100644 --- a/noversion.tar.bz2 +++ b/noversion.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:469186780a61f0e0839e3938a674ebe7a46d649dd4de8ba52f1bc821aca42455 -size 1520 +oid sha256:3970c86754545a65f32f6595c3b638b9966e901827f2bc01db552b9cf9cf5bfc +size 1818 diff --git a/nscd-track-startup-failures.patch b/nscd-track-startup-failures.patch deleted file mode 100644 index f531a17..0000000 --- a/nscd-track-startup-failures.patch +++ /dev/null @@ -1,496 +0,0 @@ -From 532a60357ef4c5852cc1bf836cfd9d6f093ef204 Mon Sep 17 00:00:00 2001 -From: Siddhesh Poyarekar -Date: Mon, 3 Mar 2014 22:51:39 +0530 -Subject: [PATCH] nscd: Improved support for tracking startup failure in nscd - service (BZ #16639) - -Currently, the nscd parent process parses commandline options and -configuration, forks on startup and immediately exits with a success. -If the child process encounters some error after this, it goes -undetected and any services started up after it may have to repeatedly -check to make sure that the nscd service did actually start up and is -serving requests. - -To make this process more reliable, I have added a pipe between the -parent and child process, through which the child process sends a -notification to the parent informing it of its status. The parent -waits for this status and once it receives it, exits with the -corresponding exit code. So if the child service sends a success -status (0), the parent exits with a success status. Similarly for -error conditions, the child sends the non-zero status code, which the -parent passes on as the exit code. - -This, along with setting the nscd service type to forking in its -systemd configuration file, allows systemd to be certain that the nscd -service is ready and is accepting connections. - -2014-03-03 Siddhesh Poyarekar - - [BZ #16639] - * nscd/connections.c (nscd_init): Call do_exit. - (start_threads): Call do_exit and notify_parent. - (begin_drop_privileges): Call do_exit. - (finish_drop_privileges): Likewise. - * nscd/selinux.c (preserve_capabilities): Likewise. - (install_real_capabilities): Likewise. - (nscd_selinux_enabled): Likewise. - (avc_create_thread): Likewise. - (avc_alloc_lock): Likewise. - (nscd_avc_init): Likewise. - * nscd/nscd.c (parent_fd): New static variable. - (main): Create a pipe between parent and child processes. - Skip closing parent_fd. - (monitor_child): New function. - (do_exit): Likewise. - (notify_parent): Likewise. - * nscd/nscd.h (notify_parent): Likewise. - (do_exit): Likewise. - -Index: glibc-2.19/nscd/connections.c -=================================================================== ---- glibc-2.19.orig/nscd/connections.c -+++ glibc-2.19/nscd/connections.c -@@ -649,8 +649,8 @@ cannot create read-only descriptor for \ - close (fd); - } - else if (errno == EACCES) -- error (EXIT_FAILURE, 0, _("cannot access '%s'"), -- dbs[cnt].db_filename); -+ do_exit (EXIT_FAILURE, 0, _("cannot access '%s'"), -+ dbs[cnt].db_filename); - } - - if (dbs[cnt].head == NULL) -@@ -699,8 +699,7 @@ cannot create read-only descriptor for \ - { - dbg_log (_("database for %s corrupted or simultaneously used; remove %s manually if necessary and restart"), - dbnames[cnt], dbs[cnt].db_filename); -- // XXX Correct way to terminate? -- exit (1); -+ do_exit (1, 0, NULL); - } - - if (dbs[cnt].persistent) -@@ -867,7 +866,7 @@ cannot set socket to close on exec: %s; - if (sock < 0) - { - dbg_log (_("cannot open socket: %s"), strerror (errno)); -- exit (errno == EACCES ? 4 : 1); -+ do_exit (errno == EACCES ? 4 : 1, 0, NULL); - } - /* Bind a name to the socket. */ - struct sockaddr_un sock_addr; -@@ -876,7 +875,7 @@ cannot set socket to close on exec: %s; - if (bind (sock, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) < 0) - { - dbg_log ("%s: %s", _PATH_NSCDSOCKET, strerror (errno)); -- exit (errno == EACCES ? 4 : 1); -+ do_exit (errno == EACCES ? 4 : 1, 0, NULL); - } - - #ifndef __ASSUME_SOCK_CLOEXEC -@@ -888,7 +887,7 @@ cannot set socket to close on exec: %s; - { - dbg_log (_("cannot change socket to nonblocking mode: %s"), - strerror (errno)); -- exit (1); -+ do_exit (1, 0, NULL); - } - - /* The descriptor needs to be closed on exec. */ -@@ -896,7 +895,7 @@ cannot set socket to close on exec: %s; - { - dbg_log (_("cannot set socket to close on exec: %s"), - strerror (errno)); -- exit (1); -+ do_exit (1, 0, NULL); - } - } - #endif -@@ -909,7 +908,7 @@ cannot set socket to close on exec: %s; - { - dbg_log (_("cannot enable socket to accept connections: %s"), - strerror (errno)); -- exit (1); -+ do_exit (1, 0, NULL); - } - - #ifdef HAVE_NETLINK -@@ -953,7 +952,7 @@ cannot set socket to close on exec: %s; - dbg_log (_("\ - cannot change socket to nonblocking mode: %s"), - strerror (errno)); -- exit (1); -+ do_exit (1, 0, NULL); - } - - /* The descriptor needs to be closed on exec. */ -@@ -962,7 +961,7 @@ cannot change socket to nonblocking mode - { - dbg_log (_("cannot set socket to close on exec: %s"), - strerror (errno)); -- exit (1); -+ do_exit (1, 0, NULL); - } - } - # endif -@@ -2392,7 +2391,7 @@ start_threads (void) - if (pthread_cond_init (&dbs[i].prune_cond, &condattr) != 0) - { - dbg_log (_("could not initialize conditional variable")); -- exit (1); -+ do_exit (1, 0, NULL); - } - - pthread_t th; -@@ -2400,7 +2399,7 @@ start_threads (void) - && pthread_create (&th, &attr, nscd_run_prune, (void *) i) != 0) - { - dbg_log (_("could not start clean-up thread; terminating")); -- exit (1); -+ do_exit (1, 0, NULL); - } - } - -@@ -2414,13 +2413,17 @@ start_threads (void) - if (i == 0) - { - dbg_log (_("could not start any worker thread; terminating")); -- exit (1); -+ do_exit (1, 0, NULL); - } - - break; - } - } - -+ /* Now it is safe to let the parent know that we're doing fine and it can -+ exit. */ -+ notify_parent (0); -+ - /* Determine how much room for descriptors we should initially - allocate. This might need to change later if we cap the number - with MAXCONN. */ -@@ -2465,8 +2468,8 @@ begin_drop_privileges (void) - if (pwd == NULL) - { - dbg_log (_("Failed to run nscd as user '%s'"), server_user); -- error (EXIT_FAILURE, 0, _("Failed to run nscd as user '%s'"), -- server_user); -+ do_exit (EXIT_FAILURE, 0, -+ _("Failed to run nscd as user '%s'"), server_user); - } - - server_uid = pwd->pw_uid; -@@ -2483,7 +2486,8 @@ begin_drop_privileges (void) - { - /* This really must never happen. */ - dbg_log (_("Failed to run nscd as user '%s'"), server_user); -- error (EXIT_FAILURE, errno, _("initial getgrouplist failed")); -+ do_exit (EXIT_FAILURE, errno, -+ _("initial getgrouplist failed")); - } - - server_groups = (gid_t *) xmalloc (server_ngroups * sizeof (gid_t)); -@@ -2492,7 +2496,7 @@ begin_drop_privileges (void) - == -1) - { - dbg_log (_("Failed to run nscd as user '%s'"), server_user); -- error (EXIT_FAILURE, errno, _("getgrouplist failed")); -+ do_exit (EXIT_FAILURE, errno, _("getgrouplist failed")); - } - } - -@@ -2510,7 +2514,7 @@ finish_drop_privileges (void) - if (setgroups (server_ngroups, server_groups) == -1) - { - dbg_log (_("Failed to run nscd as user '%s'"), server_user); -- error (EXIT_FAILURE, errno, _("setgroups failed")); -+ do_exit (EXIT_FAILURE, errno, _("setgroups failed")); - } - - int res; -@@ -2521,8 +2525,7 @@ finish_drop_privileges (void) - if (res == -1) - { - dbg_log (_("Failed to run nscd as user '%s'"), server_user); -- perror ("setgid"); -- exit (4); -+ do_exit (4, errno, "setgid"); - } - - if (paranoia) -@@ -2532,8 +2535,7 @@ finish_drop_privileges (void) - if (res == -1) - { - dbg_log (_("Failed to run nscd as user '%s'"), server_user); -- perror ("setuid"); -- exit (4); -+ do_exit (4, errno, "setuid"); - } - - #if defined HAVE_LIBAUDIT && defined HAVE_LIBCAP -Index: glibc-2.19/nscd/nscd.c -=================================================================== ---- glibc-2.19.orig/nscd/nscd.c -+++ glibc-2.19/nscd/nscd.c -@@ -39,6 +39,8 @@ - #include - #include - #include -+#include -+#include - - #include "dbg_log.h" - #include "nscd.h" -@@ -101,6 +103,7 @@ gid_t old_gid; - - static int check_pid (const char *file); - static int write_pid (const char *file); -+static int monitor_child (int fd); - - /* Name and version of program. */ - static void print_version (FILE *stream, struct argp_state *state); -@@ -142,6 +145,7 @@ static struct argp argp = - - /* True if only statistics are requested. */ - static bool get_stats; -+static int parent_fd = -1; - - int - main (int argc, char **argv) -@@ -196,11 +200,27 @@ main (int argc, char **argv) - /* Behave like a daemon. */ - if (run_mode == RUN_DAEMONIZE) - { -+ int fd[2]; -+ -+ if (pipe (fd) != 0) -+ error (EXIT_FAILURE, errno, -+ _("cannot create a pipe to talk to the child")); -+ - pid = fork (); - if (pid == -1) - error (EXIT_FAILURE, errno, _("cannot fork")); - if (pid != 0) -- exit (0); -+ { -+ /* The parent only reads from the child. */ -+ close (fd[1]); -+ exit (monitor_child (fd[0])); -+ } -+ else -+ { -+ /* The child only writes to the parent. */ -+ close (fd[0]); -+ parent_fd = fd[1]; -+ } - } - - int nullfd = open (_PATH_DEVNULL, O_RDWR); -@@ -242,7 +262,8 @@ main (int argc, char **argv) - char *endp; - long int fdn = strtol (dirent->d_name, &endp, 10); - -- if (*endp == '\0' && fdn != dfdn && fdn >= min_close_fd) -+ if (*endp == '\0' && fdn != dfdn && fdn >= min_close_fd -+ && fdn != parent_fd) - close ((int) fdn); - } - -@@ -250,13 +271,14 @@ main (int argc, char **argv) - } - else - for (i = min_close_fd; i < getdtablesize (); i++) -- close (i); -+ if (i != parent_fd) -+ close (i); - - setsid (); - - if (chdir ("/") != 0) -- error (EXIT_FAILURE, errno, -- _("cannot change current working directory to \"/\"")); -+ do_exit (EXIT_FAILURE, errno, -+ _("cannot change current working directory to \"/\"")); - - openlog ("nscd", LOG_CONS | LOG_ODELAY, LOG_DAEMON); - -@@ -592,3 +614,79 @@ write_pid (const char *file) - - return result; - } -+ -+static int -+monitor_child (int fd) -+{ -+ int child_ret = 0; -+ int ret = read (fd, &child_ret, sizeof (child_ret)); -+ -+ /* The child terminated with an error, either via exit or some other abnormal -+ method, like a segfault. */ -+ if (ret <= 0 || child_ret != 0) -+ { -+ int err = wait (&child_ret); -+ -+ if (err < 0) -+ { -+ fprintf (stderr, _("wait failed")); -+ return 1; -+ } -+ -+ fprintf (stderr, _("child exited with status %d"), -+ WEXITSTATUS (child_ret)); -+ if (WIFSIGNALED (child_ret)) -+ fprintf (stderr, _(", terminated by signal %d.\n"), -+ WTERMSIG (child_ret)); -+ else -+ fprintf (stderr, ".\n"); -+ } -+ -+ /* We have the child status, so exit with that code. */ -+ close (fd); -+ -+ return child_ret; -+} -+ -+void -+do_exit (int child_ret, int errnum, const char *format, ...) -+{ -+ if (parent_fd != -1) -+ { -+ int ret = write (parent_fd, &child_ret, sizeof (child_ret)); -+ assert (ret == sizeof (child_ret)); -+ close (parent_fd); -+ } -+ -+ if (format != NULL) -+ { -+ /* Emulate error() since we don't have a va_list variant for it. */ -+ va_list argp; -+ -+ fflush (stdout); -+ -+ fprintf (stderr, "%s: ", program_invocation_name); -+ -+ va_start (argp, format); -+ vfprintf (stderr, format, argp); -+ va_end (argp); -+ -+ fprintf (stderr, ": %s\n", strerror (errnum)); -+ fflush (stderr); -+ } -+ -+ /* Finally, exit. */ -+ exit (child_ret); -+} -+ -+void -+notify_parent (int child_ret) -+{ -+ if (parent_fd == -1) -+ return; -+ -+ int ret = write (parent_fd, &child_ret, sizeof (child_ret)); -+ assert (ret == sizeof (child_ret)); -+ close (parent_fd); -+ parent_fd = -1; -+} -Index: glibc-2.19/nscd/nscd.h -=================================================================== ---- glibc-2.19.orig/nscd/nscd.h -+++ glibc-2.19/nscd/nscd.h -@@ -205,6 +205,8 @@ extern gid_t old_gid; - /* nscd.c */ - extern void termination_handler (int signum) __attribute__ ((__noreturn__)); - extern int nscd_open_socket (void); -+void notify_parent (int child_ret); -+void do_exit (int child_ret, int errnum, const char *format, ...); - - /* connections.c */ - extern void nscd_init (void); -Index: glibc-2.19/nscd/selinux.c -=================================================================== ---- glibc-2.19.orig/nscd/selinux.c -+++ glibc-2.19/nscd/selinux.c -@@ -179,7 +179,7 @@ preserve_capabilities (void) - if (prctl (PR_SET_KEEPCAPS, 1) == -1) - { - dbg_log (_("Failed to set keep-capabilities")); -- error (EXIT_FAILURE, errno, _("prctl(KEEPCAPS) failed")); -+ do_exit (EXIT_FAILURE, errno, _("prctl(KEEPCAPS) failed")); - /* NOTREACHED */ - } - -@@ -194,7 +194,7 @@ preserve_capabilities (void) - cap_free (tmp_caps); - - dbg_log (_("Failed to initialize drop of capabilities")); -- error (EXIT_FAILURE, 0, _("cap_init failed")); -+ do_exit (EXIT_FAILURE, 0, _("cap_init failed")); - } - - /* There is no reason why these should not work. */ -@@ -216,7 +216,7 @@ preserve_capabilities (void) - { - cap_free (new_caps); - dbg_log (_("Failed to drop capabilities")); -- error (EXIT_FAILURE, 0, _("cap_set_proc failed")); -+ do_exit (EXIT_FAILURE, 0, _("cap_set_proc failed")); - } - - return new_caps; -@@ -233,7 +233,7 @@ install_real_capabilities (cap_t new_cap - { - cap_free (new_caps); - dbg_log (_("Failed to drop capabilities")); -- error (EXIT_FAILURE, 0, _("cap_set_proc failed")); -+ do_exit (EXIT_FAILURE, 0, _("cap_set_proc failed")); - /* NOTREACHED */ - } - -@@ -242,7 +242,7 @@ install_real_capabilities (cap_t new_cap - if (prctl (PR_SET_KEEPCAPS, 0) == -1) - { - dbg_log (_("Failed to unset keep-capabilities")); -- error (EXIT_FAILURE, errno, _("prctl(KEEPCAPS) failed")); -+ do_exit (EXIT_FAILURE, errno, _("prctl(KEEPCAPS) failed")); - /* NOTREACHED */ - } - } -@@ -258,7 +258,7 @@ nscd_selinux_enabled (int *selinux_enabl - if (*selinux_enabled < 0) - { - dbg_log (_("Failed to determine if kernel supports SELinux")); -- exit (EXIT_FAILURE); -+ do_exit (EXIT_FAILURE, 0, NULL); - } - } - -@@ -272,7 +272,7 @@ avc_create_thread (void (*run) (void)) - rc = - pthread_create (&avc_notify_thread, NULL, (void *(*) (void *)) run, NULL); - if (rc != 0) -- error (EXIT_FAILURE, rc, _("Failed to start AVC thread")); -+ do_exit (EXIT_FAILURE, rc, _("Failed to start AVC thread")); - - return &avc_notify_thread; - } -@@ -294,7 +294,7 @@ avc_alloc_lock (void) - - avc_mutex = malloc (sizeof (pthread_mutex_t)); - if (avc_mutex == NULL) -- error (EXIT_FAILURE, errno, _("Failed to create AVC lock")); -+ do_exit (EXIT_FAILURE, errno, _("Failed to create AVC lock")); - pthread_mutex_init (avc_mutex, NULL); - - return avc_mutex; -@@ -334,7 +334,7 @@ nscd_avc_init (void) - avc_entry_ref_init (&aeref); - - if (avc_init ("avc", NULL, &log_cb, &thread_cb, &lock_cb) < 0) -- error (EXIT_FAILURE, errno, _("Failed to start AVC")); -+ do_exit (EXIT_FAILURE, errno, _("Failed to start AVC")); - else - dbg_log (_("Access Vector Cache (AVC) started")); - #ifdef HAVE_LIBAUDIT diff --git a/nss-dns-memleak.patch b/nss-dns-memleak.patch deleted file mode 100644 index c27b074..0000000 --- a/nss-dns-memleak.patch +++ /dev/null @@ -1,461 +0,0 @@ -2014-02-18 Andreas Schwab - - [BZ #16574] - * resolv/res_send.c (send_vc): Add parameter ansp2_malloced. - Store non-zero if the second buffer was newly allocated. - (send_dg): Likewise. - (__libc_res_nsend): Add parameter ansp2_malloced and pass it down - to send_vc and send_dg. - (res_nsend): Pass NULL for ansp2_malloced. - * resolv/res_query.c (__libc_res_nquery): Add parameter - answerp2_malloced and pass it down to __libc_res_nsend. - (res_nquery): Pass additional NULL to __libc_res_nquery. - (__libc_res_nsearch): Add parameter answerp2_malloced and pass it - down to __libc_res_nquery and __libc_res_nquerydomain. Deallocate - second answer buffer if answerp2_malloced was set. - (res_nsearch): Pass additional NULL to __libc_res_nsearch. - (__libc_res_nquerydomain): Add parameter - answerp2_malloced and pass it down to __libc_res_nquery. - (res_nquerydomain): Pass additional NULL to - __libc_res_nquerydomain. - * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r): Pass - additional NULL to __libc_res_nsend and __libc_res_nquery. - * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Pass - additional NULL to __libc_res_nsearch. - (_nss_dns_gethostbyname4_r): Revert last change. Use new - parameter of __libc_res_nsearch to check for separately allocated - second buffer. - (_nss_dns_gethostbyaddr2_r): Pass additional NULL to - __libc_res_nquery. - * resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Pass - additional NULL to __libc_res_nquery. - * resolv/gethnamaddr.c (gethostbyname2): Pass additional NULL to - __libc_res_nsearch. - (gethostbyaddr): Pass additional NULL to __libc_res_nquery. - * include/resolv.h: Update prototypes of __libc_res_nquery, - __libc_res_nsearch, __libc_res_nsend. - -2014-02-13 Andreas Schwab - - [BZ #16574] - * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname4_r): Free the - second answer buffer if it was separately allocated. - -Index: glibc-2.19/include/resolv.h -=================================================================== ---- glibc-2.19.orig/include/resolv.h -+++ glibc-2.19/include/resolv.h -@@ -48,11 +48,11 @@ libc_hidden_proto (__res_randomid) - libc_hidden_proto (__res_state) - - int __libc_res_nquery (res_state, const char *, int, int, u_char *, int, -- u_char **, u_char **, int *, int *); -+ u_char **, u_char **, int *, int *, int *); - int __libc_res_nsearch (res_state, const char *, int, int, u_char *, int, -- u_char **, u_char **, int *, int *); -+ u_char **, u_char **, int *, int *, int *); - int __libc_res_nsend (res_state, const u_char *, int, const u_char *, int, -- u_char *, int, u_char **, u_char **, int *, int *) -+ u_char *, int, u_char **, u_char **, int *, int *, int *) - attribute_hidden; - - libresolv_hidden_proto (_sethtent) -Index: glibc-2.19/resolv/gethnamaddr.c -=================================================================== ---- glibc-2.19.orig/resolv/gethnamaddr.c -+++ glibc-2.19/resolv/gethnamaddr.c -@@ -621,7 +621,7 @@ gethostbyname2(name, af) - buf.buf = origbuf = (querybuf *) alloca (1024); - - if ((n = __libc_res_nsearch(&_res, name, C_IN, type, buf.buf->buf, 1024, -- &buf.ptr, NULL, NULL, NULL)) < 0) { -+ &buf.ptr, NULL, NULL, NULL, NULL)) < 0) { - if (buf.buf != origbuf) - free (buf.buf); - Dprintf("res_nsearch failed (%d)\n", n); -@@ -716,12 +716,12 @@ gethostbyaddr(addr, len, af) - buf.buf = orig_buf = (querybuf *) alloca (1024); - - n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf, 1024, -- &buf.ptr, NULL, NULL, NULL); -+ &buf.ptr, NULL, NULL, NULL, NULL); - if (n < 0 && af == AF_INET6 && (_res.options & RES_NOIP6DOTINT) == 0) { - strcpy(qp, "ip6.int"); - n = __libc_res_nquery(&_res, qbuf, C_IN, T_PTR, buf.buf->buf, - buf.buf != orig_buf ? MAXPACKET : 1024, -- &buf.ptr, NULL, NULL, NULL); -+ &buf.ptr, NULL, NULL, NULL, NULL); - } - if (n < 0) { - if (buf.buf != orig_buf) -Index: glibc-2.19/resolv/nss_dns/dns-canon.c -=================================================================== ---- glibc-2.19.orig/resolv/nss_dns/dns-canon.c -+++ glibc-2.19/resolv/nss_dns/dns-canon.c -@@ -62,7 +62,7 @@ _nss_dns_getcanonname_r (const char *nam - { - int r = __libc_res_nquery (&_res, name, ns_c_in, qtypes[i], - buf, sizeof (buf), &ansp.ptr, NULL, NULL, -- NULL); -+ NULL, NULL); - if (r > 0) - { - /* We need to decode the response. Just one question record. -Index: glibc-2.19/resolv/nss_dns/dns-host.c -=================================================================== ---- glibc-2.19.orig/resolv/nss_dns/dns-host.c -+++ glibc-2.19/resolv/nss_dns/dns-host.c -@@ -190,7 +190,7 @@ _nss_dns_gethostbyname3_r (const char *n - host_buffer.buf = orig_host_buffer = (querybuf *) alloca (1024); - - n = __libc_res_nsearch (&_res, name, C_IN, type, host_buffer.buf->buf, -- 1024, &host_buffer.ptr, NULL, NULL, NULL); -+ 1024, &host_buffer.ptr, NULL, NULL, NULL, NULL); - if (n < 0) - { - switch (errno) -@@ -225,7 +225,7 @@ _nss_dns_gethostbyname3_r (const char *n - n = __libc_res_nsearch (&_res, name, C_IN, T_A, host_buffer.buf->buf, - host_buffer.buf != orig_host_buffer - ? MAXPACKET : 1024, &host_buffer.ptr, -- NULL, NULL, NULL); -+ NULL, NULL, NULL, NULL); - - if (n < 0) - { -@@ -308,12 +308,13 @@ _nss_dns_gethostbyname4_r (const char *n - u_char *ans2p = NULL; - int nans2p = 0; - int resplen2 = 0; -+ int ans2p_malloced = 0; - - int olderr = errno; - enum nss_status status; - int n = __libc_res_nsearch (&_res, name, C_IN, T_UNSPEC, - host_buffer.buf->buf, 2048, &host_buffer.ptr, -- &ans2p, &nans2p, &resplen2); -+ &ans2p, &nans2p, &resplen2, &ans2p_malloced); - if (n < 0) - { - switch (errno) -@@ -352,6 +353,10 @@ _nss_dns_gethostbyname4_r (const char *n - resplen2, name, pat, buffer, buflen, - errnop, herrnop, ttlp); - -+ /* Check whether ans2p was separately allocated. */ -+ if (ans2p_malloced) -+ free (ans2p); -+ - if (host_buffer.buf != orig_host_buffer) - free (host_buffer.buf); - -@@ -460,7 +465,7 @@ _nss_dns_gethostbyaddr2_r (const void *a - strcpy (qp, "].ip6.arpa"); - n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, - host_buffer.buf->buf, 1024, &host_buffer.ptr, -- NULL, NULL, NULL); -+ NULL, NULL, NULL, NULL); - if (n >= 0) - goto got_it_already; - } -@@ -481,14 +486,14 @@ _nss_dns_gethostbyaddr2_r (const void *a - } - - n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf, -- 1024, &host_buffer.ptr, NULL, NULL, NULL); -+ 1024, &host_buffer.ptr, NULL, NULL, NULL, NULL); - if (n < 0 && af == AF_INET6 && (_res.options & RES_NOIP6DOTINT) == 0) - { - strcpy (qp, "ip6.int"); - n = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, host_buffer.buf->buf, - host_buffer.buf != orig_host_buffer - ? MAXPACKET : 1024, &host_buffer.ptr, -- NULL, NULL, NULL); -+ NULL, NULL, NULL, NULL); - } - if (n < 0) - { -Index: glibc-2.19/resolv/nss_dns/dns-network.c -=================================================================== ---- glibc-2.19.orig/resolv/nss_dns/dns-network.c -+++ glibc-2.19/resolv/nss_dns/dns-network.c -@@ -129,7 +129,7 @@ _nss_dns_getnetbyname_r (const char *nam - net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); - - anslen = __libc_res_nsearch (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf, -- 1024, &net_buffer.ptr, NULL, NULL, NULL); -+ 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); - if (anslen < 0) - { - /* Nothing found. */ -@@ -205,7 +205,7 @@ _nss_dns_getnetbyaddr_r (uint32_t net, i - net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); - - anslen = __libc_res_nquery (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf, -- 1024, &net_buffer.ptr, NULL, NULL, NULL); -+ 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); - if (anslen < 0) - { - /* Nothing found. */ -Index: glibc-2.19/resolv/res_query.c -=================================================================== ---- glibc-2.19.orig/resolv/res_query.c -+++ glibc-2.19/resolv/res_query.c -@@ -98,7 +98,7 @@ static int - __libc_res_nquerydomain(res_state statp, const char *name, const char *domain, - int class, int type, u_char *answer, int anslen, - u_char **answerp, u_char **answerp2, int *nanswerp2, -- int *resplen2); -+ int *resplen2, int *answerp2_malloced); - - /* - * Formulate a normal query, send, and await answer. -@@ -119,7 +119,8 @@ __libc_res_nquery(res_state statp, - u_char **answerp, /* if buffer needs to be enlarged */ - u_char **answerp2, - int *nanswerp2, -- int *resplen2) -+ int *resplen2, -+ int *answerp2_malloced) - { - HEADER *hp = (HEADER *) answer; - HEADER *hp2; -@@ -224,7 +225,8 @@ __libc_res_nquery(res_state statp, - } - assert (answerp == NULL || (void *) *answerp == (void *) answer); - n = __libc_res_nsend(statp, query1, nquery1, query2, nquery2, answer, -- anslen, answerp, answerp2, nanswerp2, resplen2); -+ anslen, answerp, answerp2, nanswerp2, resplen2, -+ answerp2_malloced); - if (use_malloc) - free (buf); - if (n < 0) { -@@ -316,7 +318,7 @@ res_nquery(res_state statp, - int anslen) /* size of answer buffer */ - { - return __libc_res_nquery(statp, name, class, type, answer, anslen, -- NULL, NULL, NULL, NULL); -+ NULL, NULL, NULL, NULL, NULL); - } - libresolv_hidden_def (res_nquery) - -@@ -335,7 +337,8 @@ __libc_res_nsearch(res_state statp, - u_char **answerp, - u_char **answerp2, - int *nanswerp2, -- int *resplen2) -+ int *resplen2, -+ int *answerp2_malloced) - { - const char *cp, * const *domain; - HEADER *hp = (HEADER *) answer; -@@ -360,7 +363,7 @@ __libc_res_nsearch(res_state statp, - if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp))!= NULL) - return (__libc_res_nquery(statp, cp, class, type, answer, - anslen, answerp, answerp2, -- nanswerp2, resplen2)); -+ nanswerp2, resplen2, answerp2_malloced)); - - #ifdef DEBUG - if (statp->options & RES_DEBUG) -@@ -377,7 +380,8 @@ __libc_res_nsearch(res_state statp, - if (dots >= statp->ndots || trailing_dot) { - ret = __libc_res_nquerydomain(statp, name, NULL, class, type, - answer, anslen, answerp, -- answerp2, nanswerp2, resplen2); -+ answerp2, nanswerp2, resplen2, -+ answerp2_malloced); - if (ret > 0 || trailing_dot) - return (ret); - saved_herrno = h_errno; -@@ -386,11 +390,11 @@ __libc_res_nsearch(res_state statp, - answer = *answerp; - anslen = MAXPACKET; - } -- if (answerp2 -- && (*answerp2 < answer || *answerp2 >= answer + anslen)) -+ if (answerp2 && *answerp2_malloced) - { - free (*answerp2); - *answerp2 = NULL; -+ *answerp2_malloced = 0; - } - } - -@@ -417,7 +421,7 @@ __libc_res_nsearch(res_state statp, - class, type, - answer, anslen, answerp, - answerp2, nanswerp2, -- resplen2); -+ resplen2, answerp2_malloced); - if (ret > 0) - return (ret); - -@@ -425,12 +429,11 @@ __libc_res_nsearch(res_state statp, - answer = *answerp; - anslen = MAXPACKET; - } -- if (answerp2 -- && (*answerp2 < answer -- || *answerp2 >= answer + anslen)) -+ if (answerp2 && *answerp2_malloced) - { - free (*answerp2); - *answerp2 = NULL; -+ *answerp2_malloced = 0; - } - - /* -@@ -486,7 +489,8 @@ __libc_res_nsearch(res_state statp, - && !(tried_as_is || root_on_list)) { - ret = __libc_res_nquerydomain(statp, name, NULL, class, type, - answer, anslen, answerp, -- answerp2, nanswerp2, resplen2); -+ answerp2, nanswerp2, resplen2, -+ answerp2_malloced); - if (ret > 0) - return (ret); - } -@@ -498,10 +502,11 @@ __libc_res_nsearch(res_state statp, - * else send back meaningless H_ERRNO, that being the one from - * the last DNSRCH we did. - */ -- if (answerp2 && (*answerp2 < answer || *answerp2 >= answer + anslen)) -+ if (answerp2 && *answerp2_malloced) - { - free (*answerp2); - *answerp2 = NULL; -+ *answerp2_malloced = 0; - } - if (saved_herrno != -1) - RES_SET_H_ERRNO(statp, saved_herrno); -@@ -521,7 +526,7 @@ res_nsearch(res_state statp, - int anslen) /* size of answer */ - { - return __libc_res_nsearch(statp, name, class, type, answer, -- anslen, NULL, NULL, NULL, NULL); -+ anslen, NULL, NULL, NULL, NULL, NULL); - } - libresolv_hidden_def (res_nsearch) - -@@ -539,7 +544,8 @@ __libc_res_nquerydomain(res_state statp, - u_char **answerp, - u_char **answerp2, - int *nanswerp2, -- int *resplen2) -+ int *resplen2, -+ int *answerp2_malloced) - { - char nbuf[MAXDNAME]; - const char *longname = nbuf; -@@ -581,7 +587,7 @@ __libc_res_nquerydomain(res_state statp, - } - return (__libc_res_nquery(statp, longname, class, type, answer, - anslen, answerp, answerp2, nanswerp2, -- resplen2)); -+ resplen2, answerp2_malloced)); - } - - int -@@ -593,7 +599,8 @@ res_nquerydomain(res_state statp, - int anslen) /* size of answer */ - { - return __libc_res_nquerydomain(statp, name, domain, class, type, -- answer, anslen, NULL, NULL, NULL, NULL); -+ answer, anslen, NULL, NULL, NULL, NULL, -+ NULL); - } - libresolv_hidden_def (res_nquerydomain) - -Index: glibc-2.19/resolv/res_send.c -=================================================================== ---- glibc-2.19.orig/resolv/res_send.c -+++ glibc-2.19/resolv/res_send.c -@@ -186,12 +186,12 @@ evNowTime(struct timespec *res) { - static int send_vc(res_state, const u_char *, int, - const u_char *, int, - u_char **, int *, int *, int, u_char **, -- u_char **, int *, int *); -+ u_char **, int *, int *, int *); - static int send_dg(res_state, const u_char *, int, - const u_char *, int, - u_char **, int *, int *, int, - int *, int *, u_char **, -- u_char **, int *, int *); -+ u_char **, int *, int *, int *); - #ifdef DEBUG - static void Aerror(const res_state, FILE *, const char *, int, - const struct sockaddr *); -@@ -343,7 +343,7 @@ int - __libc_res_nsend(res_state statp, const u_char *buf, int buflen, - const u_char *buf2, int buflen2, - u_char *ans, int anssiz, u_char **ansp, u_char **ansp2, -- int *nansp2, int *resplen2) -+ int *nansp2, int *resplen2, int *ansp2_malloced) - { - int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; - -@@ -546,7 +546,8 @@ __libc_res_nsend(res_state statp, const - try = statp->retry; - n = send_vc(statp, buf, buflen, buf2, buflen2, - &ans, &anssiz, &terrno, -- ns, ansp, ansp2, nansp2, resplen2); -+ ns, ansp, ansp2, nansp2, resplen2, -+ ansp2_malloced); - if (n < 0) - return (-1); - if (n == 0 && (buf2 == NULL || *resplen2 == 0)) -@@ -556,7 +557,7 @@ __libc_res_nsend(res_state statp, const - n = send_dg(statp, buf, buflen, buf2, buflen2, - &ans, &anssiz, &terrno, - ns, &v_circuit, &gotsomewhere, ansp, -- ansp2, nansp2, resplen2); -+ ansp2, nansp2, resplen2, ansp2_malloced); - if (n < 0) - return (-1); - if (n == 0 && (buf2 == NULL || *resplen2 == 0)) -@@ -646,7 +647,7 @@ res_nsend(res_state statp, - const u_char *buf, int buflen, u_char *ans, int anssiz) - { - return __libc_res_nsend(statp, buf, buflen, NULL, 0, ans, anssiz, -- NULL, NULL, NULL, NULL); -+ NULL, NULL, NULL, NULL, NULL); - } - libresolv_hidden_def (res_nsend) - -@@ -657,7 +658,7 @@ send_vc(res_state statp, - const u_char *buf, int buflen, const u_char *buf2, int buflen2, - u_char **ansp, int *anssizp, - int *terrno, int ns, u_char **anscp, u_char **ansp2, int *anssizp2, -- int *resplen2) -+ int *resplen2, int *ansp2_malloced) - { - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; -@@ -823,6 +824,8 @@ send_vc(res_state statp, - } - *thisanssizp = MAXPACKET; - *thisansp = newp; -+ if (thisansp == ansp2) -+ *ansp2_malloced = 1; - anhp = (HEADER *) newp; - len = rlen; - } else { -@@ -992,7 +995,7 @@ send_dg(res_state statp, - const u_char *buf, int buflen, const u_char *buf2, int buflen2, - u_char **ansp, int *anssizp, - int *terrno, int ns, int *v_circuit, int *gotsomewhere, u_char **anscp, -- u_char **ansp2, int *anssizp2, int *resplen2) -+ u_char **ansp2, int *anssizp2, int *resplen2, int *ansp2_malloced) - { - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; -@@ -1238,6 +1241,8 @@ send_dg(res_state statp, - if (newp != NULL) { - *anssizp = MAXPACKET; - *thisansp = ans = newp; -+ if (thisansp == ansp2) -+ *ansp2_malloced = 1; - } - } - HEADER *anhp = (HEADER *) *thisansp; diff --git a/nss-files-long-lines.patch b/nss-files-long-lines.patch deleted file mode 100644 index ad1e169..0000000 --- a/nss-files-long-lines.patch +++ /dev/null @@ -1,24 +0,0 @@ -2014-06-23 Andreas Schwab - - [BZ #17079] - * nss/nss_files/files-XXX.c (get_contents): Store overflow marker - before reading the next line. - -Index: glibc-2.19/nss/nss_files/files-XXX.c -=================================================================== ---- glibc-2.19.orig/nss/nss_files/files-XXX.c -+++ glibc-2.19/nss/nss_files/files-XXX.c -@@ -198,10 +198,12 @@ get_contents (char *linebuf, size_t len, - { - int curlen = ((remaining_len > (size_t) INT_MAX) ? INT_MAX - : remaining_len); -- char *p = fgets_unlocked (curbuf, curlen, stream); - -+ /* Terminate the line so that we can test for overflow. */ - ((unsigned char *) curbuf)[curlen - 1] = 0xff; - -+ char *p = fgets_unlocked (curbuf, curlen, stream); -+ - /* EOF or read error. */ - if (p == NULL) - return gcr_error; diff --git a/nss-nis-stack-use.patch b/nss-nis-stack-use.patch deleted file mode 100644 index 6d0309f..0000000 --- a/nss-nis-stack-use.patch +++ /dev/null @@ -1,111 +0,0 @@ -2014-05-12 Andreas Schwab - - [BZ #16932] - * nis/nss_nis/nis-hosts.c (internal_gethostbyname2_r) - (_nss_nis_gethostbyname4_r): Return error if item length is larger - than maximum RPC packet size. - * nis/nss_nis/nis-initgroups.c (initgroups_netid): Likewise. - * nis/nss_nis/nis-network.c (_nss_nis_getnetbyname_r): Likewise. - * nis/nss_nis/nis-service.c (_nss_nis_getservbyname_r) - (_nss_nis_getservbyport_r): Likewise. - -Index: glibc-2.19/nis/nss_nis/nis-hosts.c -=================================================================== ---- glibc-2.19.orig/nis/nss_nis/nis-hosts.c -+++ glibc-2.19/nis/nss_nis/nis-hosts.c -@@ -270,6 +270,13 @@ internal_gethostbyname2_r (const char *n - - /* Convert name to lowercase. */ - size_t namlen = strlen (name); -+ /* Limit name length to the maximum size of an RPC packet. */ -+ if (namlen > UDPMSGSIZE) -+ { -+ *errnop = ERANGE; -+ return NSS_STATUS_UNAVAIL; -+ } -+ - char name2[namlen + 1]; - size_t i; - -@@ -461,6 +468,13 @@ _nss_nis_gethostbyname4_r (const char *n - - /* Convert name to lowercase. */ - size_t namlen = strlen (name); -+ /* Limit name length to the maximum size of an RPC packet. */ -+ if (namlen > UDPMSGSIZE) -+ { -+ *errnop = ERANGE; -+ return NSS_STATUS_UNAVAIL; -+ } -+ - char name2[namlen + 1]; - size_t i; - -Index: glibc-2.19/nis/nss_nis/nis-initgroups.c -=================================================================== ---- glibc-2.19.orig/nis/nss_nis/nis-initgroups.c -+++ glibc-2.19/nis/nss_nis/nis-initgroups.c -@@ -150,6 +150,13 @@ initgroups_netid (uid_t uid, gid_t group - gid_t **groupsp, long int limit, int *errnop, - const char *domainname) - { -+ /* Limit domainname length to the maximum size of an RPC packet. */ -+ if (strlen (domainname) > UDPMSGSIZE) -+ { -+ *errnop = ERANGE; -+ return NSS_STATUS_UNAVAIL; -+ } -+ - /* Prepare the key. The form is "unix.UID@DOMAIN" with the UID and - DOMAIN field filled in appropriately. */ - char key[sizeof ("unix.@") + sizeof (uid_t) * 3 + strlen (domainname)]; -Index: glibc-2.19/nis/nss_nis/nis-network.c -=================================================================== ---- glibc-2.19.orig/nis/nss_nis/nis-network.c -+++ glibc-2.19/nis/nss_nis/nis-network.c -@@ -179,6 +179,13 @@ _nss_nis_getnetbyname_r (const char *nam - - /* Convert name to lowercase. */ - size_t namlen = strlen (name); -+ /* Limit name length to the maximum size of an RPC packet. */ -+ if (namlen > UDPMSGSIZE) -+ { -+ *errnop = ERANGE; -+ return NSS_STATUS_UNAVAIL; -+ } -+ - char name2[namlen + 1]; - size_t i; - -Index: glibc-2.19/nis/nss_nis/nis-service.c -=================================================================== ---- glibc-2.19.orig/nis/nss_nis/nis-service.c -+++ glibc-2.19/nis/nss_nis/nis-service.c -@@ -271,6 +271,13 @@ _nss_nis_getservbyname_r (const char *na - /* If the protocol is given, we could try if our NIS server knows - about services.byservicename map. If yes, we only need one query. */ - size_t keylen = strlen (name) + (protocol ? 1 + strlen (protocol) : 0); -+ /* Limit key length to the maximum size of an RPC packet. */ -+ if (keylen > UDPMSGSIZE) -+ { -+ *errnop = ERANGE; -+ return NSS_STATUS_UNAVAIL; -+ } -+ - char key[keylen + 1]; - - /* key is: "name/proto" */ -@@ -355,6 +362,13 @@ _nss_nis_getservbyport_r (int port, cons - Otherwise try first port/tcp, then port/udp and then fallback - to sequential scanning of services.byname. */ - const char *proto = protocol != NULL ? protocol : "tcp"; -+ /* Limit protocol name length to the maximum size of an RPC packet. */ -+ if (strlen (proto) > UDPMSGSIZE) -+ { -+ *errnop = ERANGE; -+ return NSS_STATUS_UNAVAIL; -+ } -+ - do - { - /* key is: "port/proto" */ diff --git a/pldd-wait-ptrace-stop.patch b/pldd-wait-ptrace-stop.patch deleted file mode 100644 index 38520bc..0000000 --- a/pldd-wait-ptrace-stop.patch +++ /dev/null @@ -1,63 +0,0 @@ -2014-02-24 Andreas Schwab - - [BZ #15804] - * elf/pldd.c (wait_for_ptrace_stop): New function. - (main): Call it after attaching. - -Index: glibc-2.19/elf/pldd.c -=================================================================== ---- glibc-2.19.orig/elf/pldd.c -+++ glibc-2.19/elf/pldd.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -82,6 +83,7 @@ static char *exe; - - /* Local functions. */ - static int get_process_info (int dfd, long int pid); -+static void wait_for_ptrace_stop (long int pid); - - - int -@@ -170,6 +172,8 @@ main (int argc, char *argv[]) - tid); - } - -+ wait_for_ptrace_stop (tid); -+ - struct thread_list *newp = alloca (sizeof (*newp)); - newp->tid = tid; - newp->next = thread_list; -@@ -194,6 +198,27 @@ main (int argc, char *argv[]) - } - - -+/* Wait for PID to enter ptrace-stop state after being attached. */ -+static void -+wait_for_ptrace_stop (long int pid) -+{ -+ int status; -+ -+ /* While waiting for SIGSTOP being delivered to the tracee we have to -+ reinject any other pending signal. Ignore all other errors. */ -+ while (waitpid (pid, &status, __WALL) == pid && WIFSTOPPED (status)) -+ { -+ /* The STOP signal should not be delivered to the tracee. */ -+ if (WSTOPSIG (status) == SIGSTOP) -+ return; -+ if (ptrace (PTRACE_CONT, pid, NULL, -+ (void *) (uintptr_t) WSTOPSIG (status))) -+ /* The only possible error is that the process died. */ -+ return; -+ } -+} -+ -+ - /* Handle program arguments. */ - static error_t - parse_opt (int key, char *arg, struct argp_state *state) diff --git a/powerpc-opt-power8.patch b/powerpc-opt-power8.patch deleted file mode 100644 index e429a18..0000000 --- a/powerpc-opt-power8.patch +++ /dev/null @@ -1,2696 +0,0 @@ -2014-03-31 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S (MFVSRD_R3_V1): - Encode instruction correctly in little endian. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S (MFVSRD_R3_V1): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S (MFVSRD_R3_V1): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S (MFVSRD_R3_V1): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S (MFVSRD_R3_V1): - Likewise. - -2014-03-20 Adhemerval Zanella - Vidya Ranganathan - - * string/strpbrk.c (strpbrk): Using macro to redefine symbol name. - * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strpbrk-power7 - and strpbrk-ppc64 objects. - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c - (__libc_ifunc_impl_list): Add new strpbrk optimized symbols. - * sysdeps/powerpc/powerpc64/multiarch/strpbrk-power7.S: New file: - multiarch strpbrk for POWER7. - * sysdeps/powerpc/powerpc64/multiarch/strpbrk-ppc64.c: New file: - multiarch strpbrk for PPC64. - * sysdeps/powerpc/powerpc64/multiarch/strpbrk.c: New file: strpbrk - ifunc selector. - * sysdeps/powerpc/powerpc64/power7/strpbrk.S: New file: optimited - strpbrk for POWER7. - -2014-03-20 Adhemerval Zanella - - * string/strcspn.c (strcspn): Using macro to redefine symbol name. - * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strcspn-power7 - and strcspn-ppc64 objects. - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c - (__libc_ifunc_impl_list): Add new strcspn optimized symbols. - * sysdeps/powerpc/powerpc64/multiarch/strcspn-power7.S: New file: - multiarch strcspn for POWER7. - * sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c: New file: - multiarch strcspn for PPC64. - * sysdeps/powerpc/powerpc64/multiarch/strcspn.c: New file: strcspn - ifunc selector. - * sysdeps/powerpc/powerpc64/power7/strcspn.S: New file: optimited - strcspn for POWER7. - -2014-03-12 Adhemerval Zanella - - [BZ #16689] - * sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S - (__bzero_ppc): Call memset@local instead of __memset_ppc@local for - static build. - * sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c: Build IFUNC - selector for static builds. - - * sysdeps/powerpc/powerpc64/multiarch/strspn.c (strspn): Build IFUNC - selector for static builds. - -2014-03-11 Adhemerval Zanella - - [BZ #16683] - * sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S (__bzero_ppc): - Define it for static builds as well. - (NO_BZERO_IMPL): Likewise. - -2014-03-11 Vidya Ranganathan - - * sysdeps/powerpc/powerpc64/power7/strspn.S: New file: Optimization. - * sysdeps/powerpc/powerpc64/multiarch/strspn.c: New file: - multiarch strspn for PPC64. - * sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c: New file - * sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S: New file - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: - (__libc_ifunc_impl_list): Likewise. - * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strspn - multiarch optimizations - * string/strspn.c (strspn): Using macro to redefine symbol name. - -2014-03-10 Vidya Ranganathan - Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/power7/strncat.S: New file: Optimization. - * sysdeps/powerpc/powerpc64/multiarch/strncat.c: New file: - multiarch strncat for PPC64. - * sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c: New file - * sysdeps/powerpc/powerpc64/multiarch/strncat-power7.S: New file - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: - (__libc_ifunc_impl_list): Likewise. - * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strncat - multiarch optimizations - -2014-03-03 Rajalakshmi Srinivasaraghavan - - * sysdeps/powerpc/powerpc64/power7/strrchr.S: New file. - * sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strrchr multiarch - implementation. - * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c: - (__libc_ifunc_impl_list): Likewise. - * sysdeps/powerpc/powerpc64/multiarch/strrchr.c: New file. - * sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c: New file. - * sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S: New file. - * string/strrchr.c: Define STRRCHR. - -2014-02-27 Adhemerval Zanella - - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llround power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S: New file: - POWER8 llround ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c (__lllround): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S: New file: - POWER8 llround implementation. - - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add llrint power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S: New file: - POWER8 llrint ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c (__lllrint): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S: New file: - POWER8 llrint implementation. - - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add finite power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S: New file: - POWER8 finite ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c (__finite): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c (__finitef): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S: New file: - POWER8 finite implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S: New file. - - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isinf power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S: New file: - POWER8 isinf ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c (__isinf): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c (__isinff): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S: New file: - POWER8 isinf implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S: New file. - - * sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h (INIT_ARCH): - Add hwcap2 initialization. - * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile: Add isnan power8 - implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S: New file: - POWER8 isnan ifunc implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c (__isnan): Add - POWER8 implementation. - * sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c (__isnanf): - Likewise. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S: New file: - POWER8 isnan implementation. - * sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S: New file. - -Index: glibc-2.19/string/strcspn.c -=================================================================== ---- glibc-2.19.orig/string/strcspn.c -+++ glibc-2.19/string/strcspn.c -@@ -15,27 +15,18 @@ - License along with the GNU C Library; if not, see - . */ - --#if HAVE_CONFIG_H --# include --#endif -- --#if defined _LIBC || HAVE_STRING_H --# include --#else --# include --# ifndef strchr --# define strchr index --# endif --#endif -+#include - - #undef strcspn - -+#ifndef STRCSPN -+# define STRCSPN strcspn -+#endif -+ - /* Return the length of the maximum initial segment of S - which contains no characters from REJECT. */ - size_t --strcspn (s, reject) -- const char *s; -- const char *reject; -+STRCSPN (const char *s, const char *reject) - { - size_t count = 0; - -Index: glibc-2.19/string/strpbrk.c -=================================================================== ---- glibc-2.19.orig/string/strpbrk.c -+++ glibc-2.19/string/strpbrk.c -@@ -15,21 +15,17 @@ - License along with the GNU C Library; if not, see - . */ - --#ifdef HAVE_CONFIG_H --# include --#endif -- --#if defined _LIBC || defined HAVE_CONFIG_H --# include --#endif -+#include - - #undef strpbrk - -+#ifndef STRPBRK -+#define STRPBRK strpbrk -+#endif -+ - /* Find the first occurrence in S of any character in ACCEPT. */ - char * --strpbrk (s, accept) -- const char *s; -- const char *accept; -+STRPBRK (const char *s, const char *accept) - { - while (*s != '\0') - { -Index: glibc-2.19/string/strrchr.c -=================================================================== ---- glibc-2.19.orig/string/strrchr.c -+++ glibc-2.19/string/strrchr.c -@@ -19,9 +19,13 @@ - - #undef strrchr - -+#ifndef STRRCHR -+# define STRRCHR strrchr -+#endif -+ - /* Find the last occurrence of C in S. */ - char * --strrchr (const char *s, int c) -+STRRCHR (const char *s, int c) - { - const char *found, *p; - -Index: glibc-2.19/string/strspn.c -=================================================================== ---- glibc-2.19.orig/string/strspn.c -+++ glibc-2.19/string/strspn.c -@@ -18,13 +18,14 @@ - #include - - #undef strspn -+#ifndef STRSPN -+#define STRSPN strspn -+#endif - - /* Return the length of the maximum initial segment - of S which contains only characters in ACCEPT. */ - size_t --strspn (s, accept) -- const char *s; -- const char *accept; -+STRSPN (const char *s, const char *accept) - { - const char *p; - const char *a; -Index: glibc-2.19/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S -+++ glibc-2.19/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S -@@ -19,8 +19,17 @@ - - #include - -+/* memset ifunc selector is not built for static and memset@local -+ for shared builds makes the linker point the call to the ifunc -+ selector. */ -+#ifdef SHARED -+# define MEMSET __memset_ppc -+#else -+# define MEMSET memset -+#endif -+ - ENTRY (__bzero_ppc) - mr r5,r4 - li r4,0 -- b __memset_ppc@local -+ b MEMSET@local - END (__bzero_ppc) -Index: glibc-2.19/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c -+++ glibc-2.19/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c -@@ -17,7 +17,7 @@ - . */ - - /* Define multiple versions only for definition in libc. */ --#if defined SHARED && !defined NOT_IN_libc -+#ifndef NOT_IN_libc - # include - # include - # include "init-arch.h" -Index: glibc-2.19/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h -+++ glibc-2.19/sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h -@@ -36,6 +36,7 @@ - and fills the previous ones. */ - #define INIT_ARCH() \ - unsigned long int hwcap = __GLRO(dl_hwcap); \ -+ unsigned long int __attribute__((unused)) hwcap2 = __GLRO(dl_hwcap2); \ - if (hwcap & PPC_FEATURE_ARCH_2_06) \ - hwcap |= PPC_FEATURE_ARCH_2_05 | \ - PPC_FEATURE_POWER5_PLUS | \ -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile -@@ -4,7 +4,8 @@ sysdep_routines += s_isnan-power7 s_isna - s_copysign-ppc64 s_finite-power7 s_finite-ppc64 \ - s_finitef-ppc64 s_isinff-ppc64 s_isinf-power7 \ - s_isinf-ppc64 s_modf-power5+ s_modf-ppc64 \ -- s_modff-power5+ s_modff-ppc64 -+ s_modff-power5+ s_modff-ppc64 s_isnan-power8 \ -+ s_isinf-power8 s_finite-power8 - - libm-sysdep_routines += s_isnan-power7 s_isnan-power6x s_isnan-power6 \ - s_isnan-power5 s_isnan-ppc64 s_llround-power6x \ -@@ -21,7 +22,9 @@ libm-sysdep_routines += s_isnan-power7 s - s_logbl-power7 s_logb-ppc64 s_logbf-ppc64 \ - s_logbl-ppc64 s_modf-power5+ s_modf-ppc64 \ - s_modff-power5+ s_modff-ppc64 e_hypot-ppc64 \ -- e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 -+ e_hypot-power7 e_hypotf-ppc64 e_hypotf-power7 \ -+ s_isnan-power8 s_isinf-power8 s_finite-power8 \ -+ s_llrint-power8 s_llround-power8 - - CFLAGS-s_logbf-power7.c = -mcpu=power7 - CFLAGS-s_logbl-power7.c = -mcpu=power7 -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite-power8.S -@@ -0,0 +1,33 @@ -+/* isnan(). PowerPC64/POWER7 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+ -+#undef hidden_def -+#define hidden_def(name) -+#undef weak_alias -+#define weak_alias(name, alias) -+#undef strong_alias -+#define strong_alias(name, alias) -+#undef compat_symbol -+#define compat_symbol(lib, name, symbol, ver) -+ -+#define __finite __finite_power8 -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c -@@ -23,10 +23,13 @@ - - extern __typeof (__finite) __finite_ppc64 attribute_hidden; - extern __typeof (__finite) __finite_power7 attribute_hidden; -+extern __typeof (__finite) __finite_power8 attribute_hidden; - - libc_ifunc (__finite, -- (hwcap & PPC_FEATURE_ARCH_2_06) -- ? __finite_power7 -+ (hwcap2 & PPC_FEATURE2_ARCH_2_07) -+ ? __finite_power8 : -+ (hwcap & PPC_FEATURE_ARCH_2_06) -+ ? __finite_power7 - : __finite_ppc64); - - weak_alias (__finite, finite) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finitef.c -@@ -23,10 +23,13 @@ - extern __typeof (__finitef) __finitef_ppc64 attribute_hidden; - /* The double-precision version also works for single-precision. */ - extern __typeof (__finitef) __finite_power7 attribute_hidden; -+extern __typeof (__finitef) __finite_power8 attribute_hidden; - - libc_ifunc (__finitef, -- (hwcap & PPC_FEATURE_ARCH_2_06) -- ? __finite_power7 -+ (hwcap2 & PPC_FEATURE2_ARCH_2_07) -+ ? __finite_power8 : -+ (hwcap & PPC_FEATURE_ARCH_2_06) -+ ? __finite_power7 - : __finitef_ppc64); - - weak_alias (__finitef, finitef) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf-power8.S -@@ -0,0 +1,33 @@ -+/* isinf(). PowerPC64/POWER8 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+ -+#undef hidden_def -+#define hidden_def(name) -+#undef weak_alias -+#define weak_alias(name, alias) -+#undef strong_alias -+#define strong_alias(name, alias) -+#undef compat_symbol -+#define compat_symbol(lib, name, alias, ver) -+ -+#define __isinf __isinf_power8 -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c -@@ -23,10 +23,13 @@ - - extern __typeof (__isinf) __isinf_ppc64 attribute_hidden; - extern __typeof (__isinf) __isinf_power7 attribute_hidden; -+extern __typeof (__isinf) __isinf_power8 attribute_hidden; - - libc_ifunc (__isinf, -- (hwcap & PPC_FEATURE_ARCH_2_06) -- ? __isinf_power7 -+ (hwcap2 & PPC_FEATURE2_ARCH_2_07) -+ ? __isinf_power8 : -+ (hwcap & PPC_FEATURE_ARCH_2_06) -+ ? __isinf_power7 - : __isinf_ppc64); - - weak_alias (__isinf, isinf) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinff.c -@@ -24,10 +24,13 @@ - extern __typeof (__isinff) __isinff_ppc64 attribute_hidden; - /* The double-precision version also works for single-precision. */ - extern __typeof (__isinff) __isinf_power7 attribute_hidden; -+extern __typeof (__isinff) __isinf_power8 attribute_hidden; - - libc_ifunc (__isinff, -- (hwcap & PPC_FEATURE_ARCH_2_06) -- ? __isinf_power7 -+ (hwcap2 & PPC_FEATURE2_ARCH_2_07) -+ ? __isinf_power8 : -+ (hwcap & PPC_FEATURE_ARCH_2_06) -+ ? __isinf_power7 - : __isinff_ppc64); - - weak_alias (__isinff, isinff) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan-power8.S -@@ -0,0 +1,33 @@ -+/* isnan(). PowerPC64/POWER7 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+ -+#undef hidden_def -+#define hidden_def(name) -+#undef weak_alias -+#define weak_alias(name, alias) -+#undef strong_alias -+#define strong_alias(name, alias) -+#undef compat_symbol -+#define compat_symbol(lib, name, symbol, ver) -+ -+#define __isnan __isnan_power8 -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c -@@ -26,16 +26,19 @@ extern __typeof (__isnan) __isnan_power5 - extern __typeof (__isnan) __isnan_power6 attribute_hidden; - extern __typeof (__isnan) __isnan_power6x attribute_hidden; - extern __typeof (__isnan) __isnan_power7 attribute_hidden; -+extern __typeof (__isnan) __isnan_power8 attribute_hidden; - - libc_ifunc (__isnan, -- (hwcap & PPC_FEATURE_ARCH_2_06) -- ? __isnan_power7 : -- (hwcap & PPC_FEATURE_POWER6_EXT) -+ (hwcap2 & PPC_FEATURE2_ARCH_2_07) -+ ? __isnan_power8 : -+ (hwcap & PPC_FEATURE_ARCH_2_06) -+ ? __isnan_power7 : -+ (hwcap & PPC_FEATURE_POWER6_EXT) - ? __isnan_power6x : -- (hwcap & PPC_FEATURE_ARCH_2_05) -- ? __isnan_power6 : -- (hwcap & PPC_FEATURE_POWER5) -- ? __isnan_power5 -+ (hwcap & PPC_FEATURE_ARCH_2_05) -+ ? __isnan_power6 : -+ (hwcap & PPC_FEATURE_POWER5) -+ ? __isnan_power5 - : __isnan_ppc64); - - weak_alias (__isnan, isnan) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnanf.c -@@ -25,16 +25,19 @@ extern __typeof (__isnanf) __isnan_power - extern __typeof (__isnanf) __isnan_power6 attribute_hidden; - extern __typeof (__isnanf) __isnan_power6x attribute_hidden; - extern __typeof (__isnanf) __isnan_power7 attribute_hidden; -+extern __typeof (__isnanf) __isnan_power8 attribute_hidden; - - libc_ifunc (__isnanf, -- (hwcap & PPC_FEATURE_ARCH_2_06) -- ? __isnan_power7 : -- (hwcap & PPC_FEATURE_POWER6_EXT) -- ? __isnan_power6x : -- (hwcap & PPC_FEATURE_ARCH_2_05) -- ? __isnan_power6 : -- (hwcap & PPC_FEATURE_POWER5) -- ? __isnan_power5 -+ (hwcap2 & PPC_FEATURE2_ARCH_2_07) -+ ? __isnan_power8 : -+ (hwcap & PPC_FEATURE_ARCH_2_06) -+ ? __isnan_power7 : -+ (hwcap & PPC_FEATURE_POWER6_EXT) -+ ? __isnan_power6x : -+ (hwcap & PPC_FEATURE_ARCH_2_05) -+ ? __isnan_power6 : -+ (hwcap & PPC_FEATURE_POWER5) -+ ? __isnan_power5 - : __isnan_ppc64); - - weak_alias (__isnanf, isnanf) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint-power8.S -@@ -0,0 +1,31 @@ -+/* Round double to long int. PowerPC64/POWER6X default version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+ -+#undef weak_alias -+#define weak_alias(a,b) -+#undef strong_alias -+#define strong_alias(a,b) -+#undef compat_symbol -+#define compat_symbol(a,b,c,d) -+ -+#define __llrint __llrint_power8 -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llrint.c -@@ -30,10 +30,13 @@ - - extern __typeof (__llrint) __llrint_ppc64 attribute_hidden; - extern __typeof (__llrint) __llrint_power6x attribute_hidden; -+extern __typeof (__llrint) __llrint_power8 attribute_hidden; - - libc_ifunc (__llrint, -- (hwcap & PPC_FEATURE_POWER6_EXT) -- ? __llrint_power6x -+ (hwcap2 & PPC_FEATURE2_ARCH_2_07) -+ ? __llrint_power8 : -+ (hwcap & PPC_FEATURE_POWER6_EXT) -+ ? __llrint_power6x - : __llrint_ppc64); - - weak_alias (__llrint, llrint) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround-power8.S -@@ -0,0 +1,31 @@ -+/* llround(). PowerPC64 default version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+ -+#undef weak_alias -+#define weak_alias(name, alias) -+#undef strong_alias -+#define strong_alias(name, alias) -+#undef compat_symbol -+#define compat_symbol(lib, name, alias, ver) -+ -+#define __llround __llround_power8 -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/multiarch/s_llround.c -@@ -27,12 +27,15 @@ - extern __typeof (__llround) __llround_ppc64 attribute_hidden; - extern __typeof (__llround) __llround_power5plus attribute_hidden; - extern __typeof (__llround) __llround_power6x attribute_hidden; -+extern __typeof (__llround) __llround_power8 attribute_hidden; - - libc_ifunc (__llround, -- (hwcap & PPC_FEATURE_POWER6_EXT) -- ? __llround_power6x : -- (hwcap & PPC_FEATURE_POWER5_PLUS) -- ? __llround_power5plus -+ (hwcap2 & PPC_FEATURE2_ARCH_2_07) -+ ? __llround_power8 : -+ (hwcap & PPC_FEATURE_POWER6_EXT) -+ ? __llround_power6x : -+ (hwcap & PPC_FEATURE_POWER5_PLUS) -+ ? __llround_power5plus - : __llround_ppc64); - - weak_alias (__llround, llround) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/Makefile -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/multiarch/Makefile -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/Makefile -@@ -13,7 +13,10 @@ sysdep_routines += memcpy-power7 memcpy- - wcschr-power6 wcschr-ppc64 wcsrchr-power7 wcsrchr-power6 \ - wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \ - wordcopy-power7 wordcopy-power6 wordcopy-ppc64 \ -- strcpy-power7 strcpy-ppc64 stpcpy-power7 stpcpy-ppc64 -+ strcpy-power7 strcpy-ppc64 stpcpy-power7 stpcpy-ppc64 \ -+ strrchr-power7 strrchr-ppc64 strncat-power7 strncat-ppc64 \ -+ strspn-power7 strspn-ppc64 strcspn-power7 strcspn-ppc64 \ -+ strpbrk-power7 strpbrk-ppc64 - - CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops - CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c -@@ -238,5 +238,45 @@ __libc_ifunc_impl_list (const char *name - IFUNC_IMPL_ADD (array, i, wcscpy, 1, - __wcscpy_ppc)) - -+ /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */ -+ IFUNC_IMPL (i, name, strrchr, -+ IFUNC_IMPL_ADD (array, i, strrchr, -+ hwcap & PPC_FEATURE_HAS_VSX, -+ __strrchr_power7) -+ IFUNC_IMPL_ADD (array, i, strrchr, 1, -+ __strrchr_ppc)) -+ -+ /* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c. */ -+ IFUNC_IMPL (i, name, strncat, -+ IFUNC_IMPL_ADD (array, i, strncat, -+ hwcap & PPC_FEATURE_HAS_VSX, -+ __strncat_power7) -+ IFUNC_IMPL_ADD (array, i, strncat, 1, -+ __strncat_ppc)) -+ -+ /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c. */ -+ IFUNC_IMPL (i, name, strspn, -+ IFUNC_IMPL_ADD (array, i, strspn, -+ hwcap & PPC_FEATURE_HAS_VSX, -+ __strspn_power7) -+ IFUNC_IMPL_ADD (array, i, strspn, 1, -+ __strspn_ppc)) -+ -+ /* Support sysdeps/powerpc/powerpc64/multiarch/strcspn.c. */ -+ IFUNC_IMPL (i, name, strcspn, -+ IFUNC_IMPL_ADD (array, i, strcspn, -+ hwcap & PPC_FEATURE_HAS_VSX, -+ __strcspn_power7) -+ IFUNC_IMPL_ADD (array, i, strcspn, 1, -+ __strcspn_ppc)) -+ -+ /* Support sysdeps/powerpc/powerpc64/multiarch/strpbrk.c. */ -+ IFUNC_IMPL (i, name, strpbrk, -+ IFUNC_IMPL_ADD (array, i, strpbrk, -+ hwcap & PPC_FEATURE_HAS_VSX, -+ __strpbrk_power7) -+ IFUNC_IMPL_ADD (array, i, strpbrk, 1, -+ __strpbrk_ppc)) -+ - return i; - } -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S -@@ -18,10 +18,9 @@ - - #include - --#if defined SHARED && !defined NOT_IN_libc -- - /* Copied from bzero.S to prevent the linker from inserting a stub -- between bzero and memset. */ -+ between bzero and memset. NOTE: this code should be positioned -+ before ENTRY/END_GEN_TB redefinition. */ - ENTRY (__bzero_ppc) - CALL_MCOUNT 3 - mr r5,r4 -@@ -29,6 +28,8 @@ ENTRY (__bzero_ppc) - b L(_memset) - END_GEN_TB (__bzero_ppc,TB_TOCLESS) - -+ -+#if defined SHARED && !defined NOT_IN_libc - # undef EALIGN - # define EALIGN(name, alignt, words) \ - .section ".text"; \ -@@ -48,9 +49,9 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS) - # undef libc_hidden_builtin_def - # define libc_hidden_builtin_def(name) \ - .globl __GI_memset; __GI_memset = __memset_ppc -+#endif - - /* Do not implement __bzero at powerpc64/memset.S. */ --# define NO_BZERO_IMPL --#endif -+#define NO_BZERO_IMPL - - #include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strcspn-power7.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strcspn-power7.S -@@ -0,0 +1,40 @@ -+/* Optimized strcspn implementation for POWER7. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#undef EALIGN -+#define EALIGN(name, alignt, words) \ -+ .section ".text"; \ -+ ENTRY_2(__strcspn_power7) \ -+ .align ALIGNARG(alignt); \ -+ EALIGN_W_##words; \ -+ BODY_LABEL(__strcspn_power7): \ -+ cfi_startproc; \ -+ LOCALENTRY(__strcspn_power7) -+ -+#undef END -+#define END(name) \ -+ cfi_endproc; \ -+ TRACEBACK(__strcspn_power7) \ -+ END_2(__strcspn_power7) -+ -+#undef libc_hidden_builtin_def -+#define libc_hidden_builtin_def(name) -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strcspn-ppc64.c -@@ -0,0 +1,30 @@ -+/* Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#define STRCSPN __strcspn_ppc -+#ifdef SHARED -+ -+# undef libc_hidden_builtin_def -+# define libc_hidden_builtin_def(name) \ -+ __hidden_ver1 (__strcspn_ppc, __GI_strcspn, __strcspn_ppc); -+#endif -+ -+extern __typeof (strcspn) __strcspn_ppc attribute_hidden; -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strcspn.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strcspn.c -@@ -0,0 +1,31 @@ -+/* Multiple versions of strcspn. PowerPC64 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#ifndef NOT_IN_libc -+# include -+# include -+# include "init-arch.h" -+ -+extern __typeof (strcspn) __strcspn_ppc attribute_hidden; -+extern __typeof (strcspn) __strcspn_power7 attribute_hidden; -+ -+libc_ifunc (strcspn, -+ (hwcap & PPC_FEATURE_HAS_VSX) -+ ? __strcspn_power7 -+ : __strcspn_ppc); -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.S -@@ -0,0 +1,42 @@ -+/* Optimized strncat implementation for POWER7. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#undef EALIGN -+#define EALIGN(name, alignt, words) \ -+ .section ".text"; \ -+ ENTRY_2(__strncat_power7) \ -+ .align ALIGNARG(alignt); \ -+ EALIGN_W_##words; \ -+ BODY_LABEL(__strncat_power7): \ -+ cfi_startproc; \ -+ LOCALENTRY(__strncat_power7) -+ -+#undef END -+#define END(name) \ -+ cfi_endproc; \ -+ TRACEBACK(__strncat_power7) \ -+ END_2(__strncat_power7) -+ -+#undef libc_hidden_builtin_def -+#define libc_hidden_builtin_def(name) -+ -+#define STRLEN __strlen_power7 -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat-ppc64.c -@@ -0,0 +1,29 @@ -+/* Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#define STRNCAT __strncat_ppc -+#ifdef SHARED -+# undef libc_hidden_builtin_def -+# define libc_hidden_builtin_def(name) \ -+ __hidden_ver1 (__strncat_ppc, __GI_strncat, __strncat_ppc); -+#endif -+ -+extern __typeof (strncat) __strncat_ppc attribute_hidden; -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strncat.c -@@ -0,0 +1,31 @@ -+/* Multiple versions of strncat. PowerPC64 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#ifndef NOT_IN_libc -+# include -+# include -+# include "init-arch.h" -+ -+extern __typeof (strncat) __strncat_ppc attribute_hidden; -+extern __typeof (strncat) __strncat_power7 attribute_hidden; -+ -+libc_ifunc (strncat, -+ (hwcap & PPC_FEATURE_HAS_VSX) -+ ? __strncat_power7 -+ : __strncat_ppc); -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strpbrk-power7.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strpbrk-power7.S -@@ -0,0 +1,40 @@ -+/* Optimized strpbrk implementation for POWER7. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#undef EALIGN -+#define EALIGN(name, alignt, words) \ -+ .section ".text"; \ -+ ENTRY_2(__strpbrk_power7) \ -+ .align ALIGNARG(alignt); \ -+ EALIGN_W_##words; \ -+ BODY_LABEL(__strpbrk_power7): \ -+ cfi_startproc; \ -+ LOCALENTRY(__strpbrk_power7) -+ -+#undef END -+#define END(name) \ -+ cfi_endproc; \ -+ TRACEBACK(__strpbrk_power7) \ -+ END_2(__strpbrk_power7) -+ -+#undef libc_hidden_builtin_def -+#define libc_hidden_builtin_def(name) -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strpbrk-ppc64.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strpbrk-ppc64.c -@@ -0,0 +1,30 @@ -+/* Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#define STRPBRK __strpbrk_ppc -+#ifdef SHARED -+ -+# undef libc_hidden_builtin_def -+# define libc_hidden_builtin_def(name) \ -+ __hidden_ver1 (__strpbrk_ppc, __GI_strpbrk, __strpbrk_ppc); -+#endif -+ -+extern __typeof (strpbrk) __strpbrk_ppc attribute_hidden; -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strpbrk.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strpbrk.c -@@ -0,0 +1,31 @@ -+/* Multiple versions of strpbrk. PowerPC64 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#ifndef NOT_IN_libc -+# include -+# include -+# include "init-arch.h" -+ -+extern __typeof (strpbrk) __strpbrk_ppc attribute_hidden; -+extern __typeof (strpbrk) __strpbrk_power7 attribute_hidden; -+ -+libc_ifunc (strpbrk, -+ (hwcap & PPC_FEATURE_HAS_VSX) -+ ? __strpbrk_power7 -+ : __strpbrk_ppc); -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr-power7.S -@@ -0,0 +1,39 @@ -+/* Optimized strrchr implementation for POWER7. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#undef ENTRY -+#define ENTRY(name) \ -+ .section ".text"; \ -+ ENTRY_2(__strrchr_power7) \ -+ .align ALIGNARG(2); \ -+ BODY_LABEL(__strrchr_power7): \ -+ cfi_startproc; \ -+ LOCALENTRY(__strrchr_power7) -+ -+#undef END -+#define END(name) \ -+ cfi_endproc; \ -+ TRACEBACK(__strrchr_power7) \ -+ END_2(__strrchr_power7) -+ -+#undef libc_hidden_builtin_def -+#define libc_hidden_builtin_def(name) -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c -@@ -0,0 +1,33 @@ -+/* Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#define STRRCHR __strrchr_ppc -+#undef weak_alias -+#define weak_alias(name, aliasname) \ -+ extern __typeof (__strrchr_ppc) aliasname \ -+ __attribute__ ((weak, alias ("__strrchr_ppc"))); -+#if !defined(NOT_IN_libc) && defined(SHARED) -+# undef libc_hidden_builtin_def -+# define libc_hidden_builtin_def(name) \ -+ __hidden_ver1(__strrchr_ppc, __GI_strrchr, __strrchr_ppc); -+#endif -+ -+extern __typeof (strrchr) __strrchr_ppc attribute_hidden; -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strrchr.c -@@ -0,0 +1,35 @@ -+/* Multiple versions of strrchr. PowerPC64 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+/* Define multiple versions only for definition in libc. */ -+#ifndef NOT_IN_libc -+# include -+# include -+# include "init-arch.h" -+ -+extern __typeof (strrchr) __strrchr_ppc attribute_hidden; -+extern __typeof (strrchr) __strrchr_power7 attribute_hidden; -+ -+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle -+ ifunc symbol properly. */ -+libc_ifunc (strrchr, -+ (hwcap & PPC_FEATURE_HAS_VSX) -+ ? __strrchr_power7 -+ : __strrchr_ppc); -+weak_alias (strrchr, rindex) -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S -@@ -0,0 +1,40 @@ -+/* Optimized strspn implementation for POWER7. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#undef EALIGN -+#define EALIGN(name, alignt, words) \ -+ .section ".text"; \ -+ ENTRY_2(__strspn_power7) \ -+ .align ALIGNARG(alignt); \ -+ EALIGN_W_##words; \ -+ BODY_LABEL(__strspn_power7): \ -+ cfi_startproc; \ -+ LOCALENTRY(__strspn_power7) -+ -+#undef END -+#define END(name) \ -+ cfi_endproc; \ -+ TRACEBACK(__strspn_power7) \ -+ END_2(__strspn_power7) -+ -+#undef libc_hidden_builtin_def -+#define libc_hidden_builtin_def(name) -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c -@@ -0,0 +1,33 @@ -+/* Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+#define STRSPN __strspn_ppc -+#undef weak_alias -+#define weak_alias(name, aliasname) \ -+ extern __typeof (__strspn_ppc) aliasname \ -+ __attribute__ ((weak, alias ("__strspn_ppc"))); -+#if !defined(NOT_IN_libc) && defined(SHARED) -+# undef libc_hidden_builtin_def -+# define libc_hidden_builtin_def(name) \ -+ __hidden_ver1(__strspn_ppc, __GI_strspn, __strspn_ppc); -+#endif -+ -+extern __typeof (strspn) __strspn_ppc attribute_hidden; -+ -+#include -Index: glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/multiarch/strspn.c -@@ -0,0 +1,31 @@ -+/* Multiple versions of strspn. PowerPC64 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#ifndef NOT_IN_libc -+# include -+# include -+# include "init-arch.h" -+ -+extern __typeof (strspn) __strspn_ppc attribute_hidden; -+extern __typeof (strspn) __strspn_power7 attribute_hidden; -+ -+libc_ifunc (strspn, -+ (hwcap & PPC_FEATURE_HAS_VSX) -+ ? __strspn_power7 -+ : __strspn_ppc); -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power7/strcspn.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power7/strcspn.S -@@ -0,0 +1,139 @@ -+/* Optimized strcspn implementation for PowerPC64. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+/* size_t [r3] strcspn (const char [r4] *s, const char [r5] *reject) */ -+ -+ .machine power7 -+EALIGN (strcspn, 4, 0) -+ CALL_MCOUNT 3 -+ -+ /* The idea to speed up the algorithm is to create a lookup table -+ for fast check if input character should be considered. For ASCII -+ or ISO-8859-X character sets it has 256 positions. */ -+ lbz r10,0(r4) -+ -+ /* First the table should be cleared and to avoid unaligned accesses -+ when using the VSX stores the table address is aligned to 16 -+ bytes. */ -+ xxlxor v0,v0,v0 -+ -+ /* PPC64 ELF ABI stack is aligned to 16 bytes. */ -+ addi r9,r1,-256 -+ -+ li r8,48 -+ li r5,16 -+ li r6,32 -+ cmpdi cr7,r10,0 /* reject[0] == '\0' ? */ -+ addi r12,r9,64 -+ /* Clear the table with 0 values */ -+ stxvw4x v0,r0,r9 -+ addi r11,r9,128 -+ addi r7,r9,192 -+ stxvw4x v0,r9,r5 -+ stxvw4x v0,r9,r6 -+ stxvw4x v0,r9,r8 -+ stxvw4x v0,r0,r12 -+ stxvw4x v0,r12,r5 -+ stxvw4x v0,r12,r6 -+ stxvw4x v0,r12,r8 -+ stxvw4x v0,r0,r11 -+ stxvw4x v0,r11,r5 -+ stxvw4x v0,r11,r6 -+ stxvw4x v0,r11,r8 -+ stxvw4x v0,r0,r7 -+ stxvw4x v0,r7,r5 -+ stxvw4x v0,r7,r6 -+ stxvw4x v0,r7,r8 -+ li r8,1 -+ beq cr7,L(finish_table) /* If reject[0] == '\0' skip */ -+ -+ /* Initialize the table as: -+ for (i=0; reject[i]; i++ -+ table[reject[i]]] = 1 */ -+ .p2align 4,,15 -+L(init_table): -+ stbx r8,r9,r10 -+ lbzu r10,1(r4) -+ cmpdi cr7,r10,0 /* If reject[0] == '\0' finish */ -+ bne cr7,L(init_table) -+L(finish_table): -+ /* set table[0] = 1 */ -+ li r10,1 -+ stb r10,0(r9) -+ li r10,0 -+ b L(mainloop) -+ -+ /* Unrool the loop 4 times and check using the table as: -+ i = 0; -+ while (1) -+ { -+ if (table[input[i++]] == 1) -+ return i - 1; -+ if (table[input[i++]] == 1) -+ return i - 1; -+ if (table[input[i++]] == 1) -+ return i - 1; -+ if (table[input[i++]] == 1) -+ return i - 1; -+ } */ -+ .p2align 4,,15 -+L(unroll): -+ lbz r8,1(r3) -+ addi r10,r10,4 -+ lbzx r8,r9,r8 -+ cmpwi r7,r8,1 -+ beq cr7,L(end) -+ lbz r8,2(r3) -+ addi r3,r3,4 -+ lbzx r8,r9,r8 -+ cmpwi cr7,r8,1 -+ beq cr7,L(end2) -+ lbz r8,3(r7) -+ lbzx r8,r9,r8 -+ cmpwi cr7,r8,1 -+ beq cr7,L(end3) -+L(mainloop): -+ lbz r8,0(r3) -+ mr r7,r3 -+ addi r6,r10,1 -+ addi r4,r10,2 -+ addi r5,r10,3 -+ lbzx r8,r9,8 -+ cmpwi cr7,r8,1 -+ bne cr7,L(unroll) -+ mr r3,r10 -+ blr -+ -+ .p2align 4,,15 -+L(end): -+ mr r3,r6 -+ blr -+ -+ .p2align 4,,15 -+L(end2): -+ mr r3,r4 -+ blr -+ -+ .p2align 4,,15 -+L(end3): -+ mr r3,r5 -+ blr -+END (strcspn) -+libc_hidden_builtin_def (strcspn) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power7/strncat.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power7/strncat.S -@@ -0,0 +1,222 @@ -+/* Optimized strncat implementation for PowerPC64/POWER7. -+ -+ Copyright (C) 2014 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 -+ . */ -+ -+/* The algorithm is as follows for aligned memory access : -+ -+ if address of s2 is divisible by 0x7UL, -+ perform aligned doubleword catenation -+ else -+ perform unaligned catenation -+ -+ The aligned comparison are made using cmpb instructions. */ -+ -+/* char* [r3] strncat (const char *s1 [r3], -+ const char *s2 [r4], -+ size_t size [r5]) */ -+ -+#include -+ -+#ifndef STRNCAT -+# undef strncat -+# define STRNCAT strncat -+#endif -+ -+#ifndef STRLEN -+# define STRLEN __strlen_ppc -+#endif -+ -+#define FRAMESIZE (FRAME_MIN_SIZE+32) -+ -+ .machine power7 -+EALIGN(STRNCAT, 4, 0) -+ CALL_MCOUNT 3 -+ -+ mflr r0 /* Load link register LR to r0. */ -+ -+/* We shall use r29, r30 and r31 non volatile register for retention. -+ Save all the callee registers in the GPR save area. */ -+ std r29, -24(r1) /* Save callers register r29. */ -+ std r30, -16(r1) /* Save callers register r30. */ -+ std r31, -8(r1) /* Save callers register r31. */ -+ -+ std r0, 16(r1) /* Store the link register. */ -+ stdu r1, -FRAMESIZE(r1) /* Create the stack frame. */ -+ -+/* Improve performance with CPU pre-fetch. */ -+ dcbt 0, r3 /* Pre-fetch str to avoid cache -+ miss. */ -+ dcbt 0, r4 /* Pre-fetch accept to avoid cache -+ miss. */ -+ -+ mr. r29, r5 /* Save "n" in r29. */ -+ mr r30, r3 /* Save "s1" in r30 from r3. */ -+ beq cr0,L(done) -+ -+ mr r31, r4 /* Save "s2" in r31 from r4. */ -+ bl STRLEN /* Call optimized strlen on s1; goto -+ end of s1. */ -+ nop -+ cmpldi cr7, r29, 7 /* If s2 is <=7 process -+ byte-by-byte. */ -+ add r3, r30, r3 /* Grab the last character of s1. */ -+ bgt cr7,L(alignment) /* Process by aligned strings. */ -+ -+ cmpldi cr7, r29, 3 /* If n is >= 4, we can -+ byte-unroll. */ -+ addi r9, r3, -1 /* Make "s1" point before next -+ character, increment when read. */ -+ bgt cr7, L(bytes_unroll) /* Process each byte. */ -+ -+L(byte_by_byte): -+ lbz r10, 0(r31) -+ addi r8, r9, 1 -+ cmpdi cr7, r10, 0 /* Check for NULL in "s2". */ -+ stb r10, 1(r9) -+ beq cr7, L(done) -+ add r9, r9, r29 -+ subf r9, r8, r9 -+ addi r9, r9, 1 -+ mtctr r9 -+ b L(branch2) -+ .p2align 4 -+L(branch1): -+ lbzu r10, 1(r31) -+ cmpdi cr7, r10, 0 -+ stbu r10, 1(r8) -+ beq cr7,L(done) -+L(branch2): -+ mr r9, r8 -+ bdnz L(branch1) -+ beq cr7,L(done) -+L(nullTerminate): -+ li r10, 0 /* Load NULL for termination. */ -+ stb r10, 1(r9) /* Append or terminate s1 with -+ NULL. */ -+ .p2align 4 /* A small section here. */ -+L(done): /* We return now. */ -+ addi r1, r1, FRAMESIZE /* Restore stack pointer. */ -+ mr r3, r30 /* Set the return value length of -+ string. */ -+ ld r0, 16(r1) /* Read the saved link register. */ -+ ld r29, -24(r1) /* Restore save register r29. */ -+ ld r30, -16(r1) /* Restore save register r30. */ -+ ld r31, -8(r1) /* Restore save register r31. */ -+ mtlr r0 /* Restore link register. */ -+ blr /* Branch to link register. */ -+ -+ .p2align 4 -+L(alignment): -+ rldicl. r9, r31, 0, 61 /* Check if s2 is 8byte aligned */ -+ beq cr0,L(dwordAligned) -+ -+ .p2align 4 -+/* Unaligned bytes in string, so process byte by byte. -+ POWER7 has performance gains over loop unroll. */ -+L(bytes_unroll): -+ addi r9, r3, -1 -+ srdi r10, r29, 2 -+ mtctr r10 -+ b L(L10) -+ .p2align 4 -+L(L44): -+ lbz r10, 1(r31) /* Load byte. */ -+ cmpdi cr7, r10, 0 /* Compare ; if byte not zero, -+ continue. */ -+ stb r10, 2(r9) /* Store byte */ -+ beq cr7, L(done) -+ addi r31, r31, 4 -+ -+ lbz r10, -2(r31) /* Perform loop unroll here on byte -+ load and store. */ -+ cmpdi cr7, r10, 0 -+ stb r10, 3(r9) -+ beq cr7, L(done) -+ -+ lbz r10, -1(r31) /* Loop unroll here. */ -+ cmpdi cr7, r10, 0 -+ stbu r10, 4(r9) -+ beq cr7, L(done) -+ -+ bdz L(leftNbytes) -+ -+L(L10): -+ lbz r10, 0(r31) /* Loop unroll here. */ -+ cmpdi cr7, r10, 0 -+ stb r10, 1(r9) -+ bne cr7,L(L44) -+ b L(done) -+ .p2align 4 -+/* If s2 is double word aligned, we load and store double word. */ -+L(dwordAligned): -+/* read, write 8 bytes at a time */ -+ srdi r8, r29, 3 /* Compute count for CTR to loop; -+ count = n/8. */ -+ li r7, 0 /* Load r7 with NULL. */ -+ li r10, 0 /* Load r10 with MASK '0'. */ -+ -+ mtctr r8 /* Move count to CTR. */ -+L(loop8): -+ ld r9, 0(r31) /* Read double word from s2. */ -+ cmpb r6, r9, r10 /* Compare bytes in s2 we read -+ just now. */ -+ cmpdi r6, 0 /* If cmpb returned NULL, -+ we continue. */ -+ bne+ L(a8) -+ std r9, 0(r3) /* Append double word from s2 -+ with s1. */ -+ addi r3, r3, 8 /* Increment s1. */ -+ addi r31, r31, 8 /* Increment s2. */ -+ subi r29, r29, 8 /* Decrement count by 8. */ -+ bdnz L(loop8) /* Continue until "count" is -+ non zero. */ -+ -+L(a8): -+ cmpdi r29, 0 /* If "n" is already zero, we skip. */ -+ beq+ L(align8align) -+ -+ mtctr r29 /* Process left over bytes in "n". */ -+L(unaligned0): -+ lbz r9, 0(r31) /* Read a byte from s2. */ -+ cmpw r9, r7 /* If byte is NULL, we stop here . */ -+ beq+ L(align8align) /* Skip processing further if NULL. */ -+ stb r9, 0(r3) /* If not NULL, store byte into s1. */ -+ addi r3, r3, 1 /* Increment s1 by 1. */ -+ addi r31, r31, 1 /* Increment s2 by 1. */ -+ bdnz L(unaligned0) /* Decrement counter "n" and loop -+ until non zero. */ -+L(align8align): -+ stb r7, 0(r3) /* Terminate s1 with NULL. */ -+ -+ addi r1, r1, FRAMESIZE /* Restore stack pointer. */ -+ mr r3, r30 /* Set the return value, length of -+ string. */ -+ ld r0, 16(r1) /* Read the saved link register. */ -+ ld r29, -24(r1) /* Restore save register r29. */ -+ ld r30, -16(r1) /* Restore save register r30. */ -+ ld r31, -8(r1) /* Restore save register r31. */ -+ mtlr r0 /* Restore link register. */ -+ blr /* Branch to link register */ -+ -+ .p2align 4 -+L(leftNbytes): -+ rldicl. r29, r29, 0, 62 /* Check if n>0 and n < 4 bytes. */ -+ bne cr0,L(byte_by_byte) /* Process bytes one by one. */ -+ b L(nullTerminate) /* Now, finish catenation with -+ NULL termination. */ -+END(STRNCAT) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power7/strpbrk.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power7/strpbrk.S -@@ -0,0 +1,148 @@ -+/* Optimized strpbrk implementation for PowerPC64/POWER7. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+/* char [r3] *strpbrk(const char [r4] *s, const char [r5] *accept) */ -+ -+ .machine power7 -+EALIGN (strpbrk, 4, 0) -+ CALL_MCOUNT 3 -+ -+ lbz r10,0(r4) -+ cmpdi cr7,r10,0 /* accept[0] == '\0' ? */ -+ beq cr7,L(nullfound) -+ -+ /* The idea to speed up the algorithm is to create a lookup table -+ for fast check if input character should be considered. For ASCII -+ or ISO-8859-X character sets it has 256 positions. */ -+ -+ /* First the table should be cleared and to avoid unaligned accesses -+ when using the VSX stores the table address is aligned to 16 -+ bytes. */ -+ xxlxor v0,v0,v0 -+ -+ /* PPC64 ELF ABI stack is aligned to 16 bytes */ -+ addi r9,r1,-256 -+ -+ li r5,16 -+ li r6,32 -+ li r8,48 -+ addi r12,r9,64 -+ /* Clear the table with 0 values */ -+ stxvw4x v0,r0,r9 -+ addi r11,r9,128 -+ addi r7,r9,192 -+ stxvw4x v0,r9,r5 -+ li r0,1 -+ stxvw4x v0,r9,r6 -+ stxvw4x v0,r9,r8 -+ stxvw4x v0,r0,r12 -+ stxvw4x v0,r12,r5 -+ stxvw4x v0,r12,r6 -+ stxvw4x v0,r12,r8 -+ stxvw4x v0,r0,r11 -+ stxvw4x v0,r11,r5 -+ stxvw4x v0,r11,r6 -+ stxvw4x v0,r11,r8 -+ stxvw4x v0,r0,r7 -+ stxvw4x v0,r7,r5 -+ stxvw4x v0,r7,r6 -+ stxvw4x v0,r7,r8 -+ -+ /* Initialize the table as: -+ for (i=0; accept[i]; i++ -+ table[accept[i]]] = 1 */ -+ .p2align 4,,15 -+L(init_table): -+ stbx r0,r9,r10 -+ lbzu r10,1(r4) -+ cmpdi r0,r10,0 -+ bne cr0,L(init_table) -+L(finish_table): -+ /* set table[0] = 1 */ -+ li r4,1 -+ stb r4,0(r9) -+ b L(mainloop) -+ -+ /* Unrool the loop 4 times and check using the table as: -+ i = 0; -+ while (1) -+ { -+ if (table[input[i++]] == 1) -+ return (s[i -1] ? s + i - 1: NULL); -+ if (table[input[i++]] == 1) -+ return (s[i -1] ? s + i - 1: NULL); -+ if (table[input[i++]] == 1) -+ return (s[i -1] ? s + i - 1: NULL); -+ if (table[input[i++]] == 1) -+ return (s[i -1] ? s + i - 1: NULL); -+ } */ -+ .p2align 4 -+L(unroll): -+ lbz r0,1(r3) -+ lbzx r8,r9,r0 -+ cmpwi cr6,r8,1 -+ beq cr6,L(checkend2) -+ lbz r10,2(r3) -+ lbzx r4,r9,r10 -+ cmpwi cr7,r4,1 -+ beq cr7,L(checkend3) -+ lbz r12,3(r3) -+ addi r3,r3,4 -+ lbzx r11,r9,r12 -+ cmpwi cr0,r11,1 -+ beq cr0,L(checkend) -+L(mainloop): -+ lbz r12,0(r3) -+ addi r11,r3,1 -+ addi r5,r3,2 -+ addi r7,r3,3 -+ lbzx r6,r9,r12 -+ cmpwi cr1,r6,1 -+ bne cr1,L(unroll) -+ cmpdi cr0,r12,0 -+ beq cr0,L(nullfound) -+L(end): -+ blr -+ -+ .p2align 4 -+L(checkend): -+ cmpdi cr1,r12,0 -+ mr r3,r7 -+ bne cr1,L(end) -+L(nullfound): -+ /* return NULL */ -+ li 3,0 -+ blr -+ -+ .p2align 4 -+L(checkend2): -+ cmpdi cr7,r0,0 -+ mr r3,r11 -+ beq cr7,L(nullfound) -+ blr -+ -+ .p2align 4 -+L(checkend3): -+ cmpdi cr6,r10,0 -+ mr r3,r5 -+ beq cr6,L(nullfound) -+ blr -+END (strpbrk) -+libc_hidden_builtin_def (strpbrk) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power7/strrchr.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power7/strrchr.S -@@ -0,0 +1,255 @@ -+/* Optimized strrchr implementation for PowerPC64/POWER7 using cmpb insn. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+ -+/* int [r3] strrchr (char *s [r3], int c [r4]) */ -+ .machine power7 -+ENTRY (strrchr) -+ CALL_MCOUNT 2 -+ dcbt 0,r3 -+ clrrdi r8,r3,3 /* Align the address to doubleword boundary. */ -+ cmpdi cr7,r4,0 -+ ld r12,0(r8) /* Load doubleword from memory. */ -+ li r9,0 /* used to store last occurence */ -+ li r0,0 /* Doubleword with null chars to use -+ with cmpb. */ -+ -+ rlwinm r6,r3,3,26,28 /* Calculate padding. */ -+ -+ beq cr7,L(null_match) -+ -+ /* Replicate byte to doubleword. */ -+ insrdi r4,r4,8,48 -+ insrdi r4,r4,16,32 -+ insrdi r4,r4,32,0 -+ -+ /* r4 is changed now ,if its passed as more chars -+ check for null again */ -+ cmpdi cr7,r4,0 -+ beq cr7,L(null_match) -+ /* Now r4 has a doubleword of c bytes and r0 has -+ a doubleword of null bytes. */ -+ -+ cmpb r10,r12,r4 /* Compare each byte against c byte. */ -+ cmpb r11,r12,r0 /* Compare each byte against null byte. */ -+ -+ /* Move the doublewords left and right to discard the bits that are -+ not part of the string and bring them back as zeros. */ -+#ifdef __LITTLE_ENDIAN__ -+ srd r10,r10,r6 -+ srd r11,r11,r6 -+ sld r10,r10,r6 -+ sld r11,r11,r6 -+#else -+ sld r10,r10,r6 -+ sld r11,r11,r6 -+ srd r10,r10,r6 -+ srd r11,r11,r6 -+#endif -+ or r5,r10,r11 /* OR the results to speed things up. */ -+ cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes -+ have been found. */ -+ bne cr7,L(done) -+ -+L(align): -+ mtcrf 0x01,r8 -+ -+ /* Are we now aligned to a doubleword boundary? If so, skip to -+ the main loop. Otherwise, go through the alignment code. */ -+ -+ bt 28,L(loop) -+ -+ /* Handle WORD2 of pair. */ -+ ldu r12,8(r8) -+ cmpb r10,r12,r4 -+ cmpb r11,r12,r0 -+ or r5,r10,r11 -+ cmpdi cr7,r5,0 -+ bne cr7,L(done) -+ b L(loop) /* We branch here (rather than falling through) -+ to skip the nops due to heavy alignment -+ of the loop below. */ -+ .p2align 5 -+L(loop): -+ /* Load two doublewords, compare and merge in a -+ single register for speed. This is an attempt -+ to speed up the null-checking process for bigger strings. */ -+ ld r12,8(r8) -+ ldu r7,16(r8) -+ cmpb r10,r12,r4 -+ cmpb r11,r12,r0 -+ cmpb r6,r7,r4 -+ cmpb r7,r7,r0 -+ or r12,r10,r11 -+ or r5,r6,r7 -+ or r5,r12,r5 -+ cmpdi cr7,r5,0 -+ beq cr7,L(loop) -+ -+ /* OK, one (or both) of the doublewords contains a c/null byte. Check -+ the first doubleword and decrement the address in case the first -+ doubleword really contains a c/null byte. */ -+ cmpdi cr6,r12,0 -+ addi r8,r8,-8 -+ bne cr6,L(done) -+ -+ /* The c/null byte must be in the second doubleword. Adjust the -+ address again and move the result of cmpb to r10 so we can calculate -+ the pointer. */ -+ -+ mr r10,r6 -+ mr r11,r7 -+ addi r8,r8,8 -+ -+ /* r10/r11 have the output of the cmpb instructions, that is, -+ 0xff in the same position as the c/null byte in the original -+ doubleword from the string. Use that to calculate the pointer. */ -+ -+L(done): -+ /* if there are more than one 0xff in r11, find the first pos of ff -+ in r11 and fill r10 with 0 from that position */ -+ cmpdi cr7,r11,0 -+ beq cr7,L(no_null) -+#ifdef __LITTLE_ENDIAN__ -+ addi r3,r11,-1 -+ andc r3,r3,r11 -+ popcntd r0,r3 -+#else -+ cntlzd r0,r11 -+#endif -+ subfic r0,r0,63 -+ li r6,-1 -+#ifdef __LITTLE_ENDIAN__ -+ srd r0,r6,r0 -+#else -+ sld r0,r6,r0 -+#endif -+ and r10,r0,r10 -+L(no_null): -+#ifdef __LITTLE_ENDIAN__ -+ cntlzd r0,r10 /* Count leading zeros before c matches. */ -+ addi r3,r10,-1 -+ andc r3,r3,r10 -+ addi r10,r11,-1 -+ andc r10,r10,r11 -+ cmpld cr7,r3,r10 -+ bgt cr7,L(no_match) -+#else -+ addi r3,r10,-1 /* Count trailing zeros before c matches. */ -+ andc r3,r3,r10 -+ popcntd r0,r3 -+ cmpld cr7,r11,r10 -+ bgt cr7,L(no_match) -+#endif -+ srdi r0,r0,3 /* Convert trailing zeros to bytes. */ -+ subfic r0,r0,7 -+ add r9,r8,r0 /* Return address of the matching c byte -+ or null in case c was not found. */ -+ li r0,0 -+ cmpdi cr7,r11,0 /* If r11 == 0, no null's have been found. */ -+ beq cr7,L(align) -+ -+ .align 4 -+L(no_match): -+ mr r3,r9 -+ blr -+ -+/* We are here because strrchr was called with a null byte. */ -+ .align 4 -+L(null_match): -+ /* r0 has a doubleword of null bytes. */ -+ -+ cmpb r5,r12,r0 /* Compare each byte against null bytes. */ -+ -+ /* Move the doublewords left and right to discard the bits that are -+ not part of the string and bring them back as zeros. */ -+#ifdef __LITTLE_ENDIAN__ -+ srd r5,r5,r6 -+ sld r5,r5,r6 -+#else -+ sld r5,r5,r6 -+ srd r5,r5,r6 -+#endif -+ cmpdi cr7,r5,0 /* If r10 == 0, no c or null bytes -+ have been found. */ -+ bne cr7,L(done_null) -+ -+ mtcrf 0x01,r8 -+ -+ /* Are we now aligned to a quadword boundary? If so, skip to -+ the main loop. Otherwise, go through the alignment code. */ -+ -+ bt 28,L(loop_null) -+ -+ /* Handle WORD2 of pair. */ -+ ldu r12,8(r8) -+ cmpb r5,r12,r0 -+ cmpdi cr7,r5,0 -+ bne cr7,L(done_null) -+ b L(loop_null) /* We branch here (rather than falling through) -+ to skip the nops due to heavy alignment -+ of the loop below. */ -+ -+ /* Main loop to look for the end of the string. Since it's a -+ small loop (< 8 instructions), align it to 32-bytes. */ -+ .p2align 5 -+L(loop_null): -+ /* Load two doublewords, compare and merge in a -+ single register for speed. This is an attempt -+ to speed up the null-checking process for bigger strings. */ -+ ld r12,8(r8) -+ ldu r11,16(r8) -+ cmpb r5,r12,r0 -+ cmpb r10,r11,r0 -+ or r6,r5,r10 -+ cmpdi cr7,r6,0 -+ beq cr7,L(loop_null) -+ -+ /* OK, one (or both) of the doublewords contains a null byte. Check -+ the first doubleword and decrement the address in case the first -+ doubleword really contains a null byte. */ -+ -+ cmpdi cr6,r5,0 -+ addi r8,r8,-8 -+ bne cr6,L(done_null) -+ -+ /* The null byte must be in the second doubleword. Adjust the address -+ again and move the result of cmpb to r10 so we can calculate the -+ pointer. */ -+ -+ mr r5,r10 -+ addi r8,r8,8 -+ -+ /* r5 has the output of the cmpb instruction, that is, it contains -+ 0xff in the same position as the null byte in the original -+ doubleword from the string. Use that to calculate the pointer. */ -+L(done_null): -+#ifdef __LITTLE_ENDIAN__ -+ addi r0,r5,-1 -+ andc r0,r0,r5 -+ popcntd r0,r0 -+#else -+ cntlzd r0,r5 /* Count leading zeros before the match. */ -+#endif -+ srdi r0,r0,3 /* Convert trailing zeros to bytes. */ -+ add r3,r8,r0 /* Return address of the matching null byte. */ -+ blr -+END (strrchr) -+weak_alias (strrchr, rindex) -+libc_hidden_builtin_def (strrchr) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power7/strspn.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power7/strspn.S -@@ -0,0 +1,165 @@ -+/* Optimized strspn implementation for PowerPC64/POWER7. -+ -+ Copyright (C) 2014 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 -+ . */ -+ -+/* size_t [r3] strspn (const char *string [r3], -+ const char *needleAccept [r4] */ -+ -+/* Performance gains are grabbed through following techniques: -+ -+ > hashing of needle. -+ > hashing avoids scanning of duplicate entries in needle -+ across the string. -+ > initializing the hash table with Vector instructions -+ by quadword access. -+ > unrolling when scanning for character in string -+ across hash table. */ -+ -+/* Algorithm is as below: -+ 1. A empty hash table/dictionary is created comprising of -+ 256 ascii character set -+ 2. When hash entry is found in needle , the hash index -+ is initialized to 1 -+ 3. The string is scanned until end and for every character, -+ its corresponding hash index is compared. -+ 4. initial length of string (count) until first hit of -+ accept needle to be found is set to 0 -+ 4. If hash index is set to 1 for the index of string, -+ count is returned. -+ 5. Otherwise count is incremented and scanning continues -+ until end of string. */ -+ -+#include -+ -+#undef strspn -+ -+ .machine power7 -+EALIGN(strspn, 4, 0) -+ CALL_MCOUNT 2 -+ -+ lbz r10, 0(r4) /* load r10 with needle (r4) */ -+ addi r9, r1, -256 /* r9 is a hash of 256 bytes */ -+ -+ li r5, 16 /* set r5 = 16 as offset */ -+ li r6, 32 /* set r6 = 32 as offset */ -+ li r8, 48 /* set r8 = 48 as offset */ -+ -+/*Iniatliaze hash table with Zeroes in double indexed quadword accesses */ -+ xxlxor v0, v0, v0 /* prepare for initializing hash */ -+ -+ stxvd2x v0, r0, r9 /* initialize 1st quadword */ -+ stxvd2x v0, r9, r5 -+ stxvd2x v0, r9, r6 -+ stxvd2x v0, r9, r8 /* initialize 4th quadword */ -+ -+ addi r11, r9, 64 /* r11 is index to hash */ -+ -+ stxvd2x v0, r0, r11 /* initialize 5th quadword */ -+ stxvd2x v0, r11, r5 -+ stxvd2x v0, r11, r6 -+ stxvd2x v0, r11, r8 /* initialize 8th quadword */ -+ -+ addi r11, r9, 128 /* r11 is index to hash */ -+ -+ stxvd2x v0, r0, r11 /* initialize 9th quadword */ -+ stxvd2x v0, r11, r5 -+ stxvd2x v0, r11, r6 -+ stxvd2x v0, r11, r8 /* initialize 12th quadword */ -+ -+ addi r11, r9, 192 /* r11 is index to hash */ -+ -+ stxvd2x v0, r0, r11 /* initialize 13th quadword */ -+ stxvd2x v0, r11, r5 -+ stxvd2x v0, r11, r6 -+ stxvd2x v0, r11, r8 /* initialize 16th quadword */ -+ -+ li r8, 1 /* r8=1, marker into hash if found in -+ needle */ -+ -+ cmpdi cr7, r10, 0 /* accept needle is NULL */ -+ beq cr7, L(skipHashing) /* if needle is NULL, skip hashing */ -+ -+ .p2align 4 /* align section to 16 byte boundary */ -+L(hashing): -+ stbx r8, r9, r10 /* update hash with marker for the pivot of -+ the needle */ -+ lbzu r10, 1(r4) /* load needle into r10 and update to next */ -+ cmpdi cr7, r10, 0 /* if needle is has reached NULL, continue */ -+ bne cr7, L(hashing) /* loop to hash the needle */ -+ -+L(skipHashing): -+ li r10, 0 /* load counter = 0 */ -+ b L(beginScan) -+ -+ .p2align 4 /* align section to 16 byte boundary */ -+L(scanUnroll): -+ lbzx r8, r9, r8 /* load r8 with hash value at index */ -+ cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found -+ accept needle */ -+ beq cr7, L(ret1stIndex) /* we have hit accept needle, return the -+ count */ -+ -+ lbz r8, 1(r3) /* load string[1] into r8 */ -+ addi r10, r10, 4 /* increment counter */ -+ lbzx r8, r9, r8 /* load r8 with hash value at index */ -+ cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found -+ accept needle */ -+ beq cr7, L(ret2ndIndex) /* we have hit accept needle, return the -+ count */ -+ -+ lbz r8, 2(r3) /* load string[2] into r8 */ -+ lbzx r8, r9, r8 /* load r8 with hash value at index */ -+ cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found -+ accept needle */ -+ beq cr7, L(ret3rdIndex) /* we have hit accept needle, return the -+ count */ -+ -+ lbz r8, 3(r3) /* load string[3] into r8 */ -+ lbzx r8, r9, r8 /* load r8 with hash value at index */ -+ addi r3, r3, 4 /* unroll factor , increment string by 4 */ -+ cmpwi cr7, r8, 0 /* if we hit marker in hash, we have found -+ accept needle */ -+ beq cr7,L(ret4thIndex) /* we have hit accept needle, return the -+ count */ -+ -+L(beginScan): -+ lbz r8, 0(r3) /* load string[0] into r8 */ -+ addi r6, r10, 1 /* place holder for counter + 1 */ -+ addi r5, r10, 2 /* place holder for counter + 2 */ -+ addi r4, r10, 3 /* place holder for counter + 3 */ -+ cmpdi cr7, r8, 0 /* if we hit marker in hash, we have found -+ accept needle */ -+ bne cr7, L(scanUnroll) /* continue scanning */ -+ -+L(ret1stIndex): -+ mr r3, r10 /* update r3 for return */ -+ blr /* return */ -+ -+L(ret2ndIndex): -+ mr r3, r6 /* update r3 for return */ -+ blr /* return */ -+ -+L(ret3rdIndex): -+ mr r3, r5 /* update r3 for return */ -+ blr /* return */ -+ -+L(ret4thIndex): -+ mr r3, r4 /* update r3 for return */ -+ blr /* done */ -+END(strspn) -+libc_hidden_builtin_def (strspn) -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S -@@ -0,0 +1,61 @@ -+/* isfinite(). PowerPC64/POWER8 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+#include -+ -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+#define MFVSRD_R3_V1 .byte 0x66,0x00,0x23,0x7c /* mfvsrd r3,vs1 */ -+#else -+#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ -+#endif -+ -+/* int [r3] __finite ([fp1] x) */ -+ -+EALIGN (__finite, 4, 0) -+ CALL_MCOUNT 0 -+ MFVSRD_R3_V1 -+ lis r9,0x8010 -+ clrldi r3,r3,1 /* r3 = r3 & 0x8000000000000000 */ -+ rldicr r9,r9,32,31 /* r9 = (r9 << 32) & 0xffffffff */ -+ add r3,r3,r9 -+ rldicl r3,r3,1,63 -+ blr -+END (__finite) -+ -+hidden_def (__finite) -+weak_alias (__finite, finite) -+ -+/* It turns out that the 'double' version will also always work for -+ single-precision. */ -+strong_alias (__finite, __finitef) -+hidden_def (__finitef) -+weak_alias (__finitef, finitef) -+ -+#ifdef IS_IN_libm -+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0) -+compat_symbol (libm, __finite, __finitel, GLIBC_2_0) -+compat_symbol (libm, finite, finitel, GLIBC_2_0) -+# endif -+#else -+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) -+compat_symbol (libc, __finite, __finitel, GLIBC_2_0); -+compat_symbol (libc, finite, finitel, GLIBC_2_0); -+# endif -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_finitef.S -@@ -0,0 +1 @@ -+/* This function uses the same code as s_finite.S. */ -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isinf.S -@@ -0,0 +1,66 @@ -+/* isinf(). PowerPC64/POWER8 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+#include -+ -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+#define MFVSRD_R3_V1 .byte 0x66,0x00,0x23,0x7c /* mfvsrd r3,vs1 */ -+#else -+#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ -+#endif -+ -+/* int [r3] __isinf([fp1] x) */ -+ -+EALIGN (__isinf, 4, 0) -+ CALL_MCOUNT 0 -+ MFVSRD_R3_V1 -+ lis r9,0x7ff0 /* r9 = 0x7ff0 */ -+ rldicl r10,r3,0,1 /* r10 = r3 & (0x8000000000000000) */ -+ sldi r9,r9,32 /* r9 = r9 << 52 */ -+ cmpd cr7,r10,r9 /* fp1 & 0x7ff0000000000000 ? */ -+ beq cr7,L(inf) -+ li r3,0 /* Not inf */ -+ blr -+L(inf): -+ sradi r3,r3,63 /* r3 = r3 >> 63 */ -+ ori r3,r3,1 /* r3 = r3 | 0x1 */ -+ blr -+END (__isinf) -+ -+hidden_def (__isinf) -+weak_alias (__isinf, isinf) -+ -+/* It turns out that the 'double' version will also always work for -+ single-precision. */ -+strong_alias (__isinf, __isinff) -+hidden_def (__isinff) -+weak_alias (__isinff, isinff) -+ -+#ifdef NO_LONG_DOUBLE -+strong_alias (__isinf, __isinfl) -+weak_alias (__isinf, isinfl) -+#endif -+ -+#ifndef IS_IN_libm -+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -+compat_symbol (libc, __isinf, __isinfl, GLIBC_2_0); -+compat_symbol (libc, isinf, isinfl, GLIBC_2_0); -+# endif -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isinff.S -@@ -0,0 +1 @@ -+/* This function uses the same code as s_isinf.S. */ -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isnan.S -@@ -0,0 +1,58 @@ -+/* isnan(). PowerPC64/POWER8 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+#include -+ -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+#define MFVSRD_R3_V1 .byte 0x66,0x00,0x23,0x7c /* mfvsrd r3,vs1 */ -+#else -+#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ -+#endif -+ -+/* int [r3] __isnan([f1] x) */ -+ -+EALIGN (__isnan, 4, 0) -+ CALL_MCOUNT 0 -+ MFVSRD_R3_V1 -+ lis r9,0x7ff0 -+ clrldi r3,r3,1 /* r3 = r3 & 0x8000000000000000 */ -+ rldicr r9,r9,32,31 /* r9 = (r9 << 32) & 0xffffffff */ -+ subf r3,r3,r9 -+ rldicl r3,r3,1,63 -+ blr -+END (__isnan) -+ -+/* It turns out that the 'double' version will also always work for -+ single-precision. */ -+strong_alias (__isnan, __isnanf) -+hidden_def (__isnanf) -+weak_alias (__isnanf, isnanf) -+ -+#ifdef NO_LONG_DOUBLE -+strong_alias (__isnan, __isnanl) -+weak_alias (__isnan, isnanl) -+#endif -+ -+#ifndef IS_IN_libm -+# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) -+compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0); -+compat_symbol (libc, isnan, isnanl, GLIBC_2_0); -+# endif -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_isnanf.S -@@ -0,0 +1 @@ -+/* This function uses the same code as s_isnan.S. */ -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_llrint.S -@@ -0,0 +1,50 @@ -+/* Round double to long int. POWER8 PowerPC64 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+#include -+ -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+#define MFVSRD_R3_V1 .byte 0x66,0x00,0x23,0x7c /* mfvsrd r3,vs1 */ -+#else -+#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ -+#endif -+ -+/* long long int[r3] __llrint (double x[fp1]) */ -+ENTRY (__llrint) -+ CALL_MCOUNT 0 -+ fctid fp1,fp1 -+ MFVSRD_R3_V1 -+ blr -+END (__llrint) -+ -+strong_alias (__llrint, __lrint) -+weak_alias (__llrint, llrint) -+weak_alias (__lrint, lrint) -+ -+#ifdef NO_LONG_DOUBLE -+strong_alias (__llrint, __llrintl) -+weak_alias (__llrint, llrintl) -+strong_alias (__lrint, __lrintl) -+weak_alias (__lrint, lrintl) -+#endif -+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1) -+compat_symbol (libm, __lrint, lrintl, GLIBC_2_1) -+#endif -Index: glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S -@@ -0,0 +1,52 @@ -+/* llround function. POWER8 PowerPC64 version. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+#include -+ -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+#define MFVSRD_R3_V1 .byte 0x66,0x00,0x23,0x7c /* mfvsrd r3,vs1 */ -+#else -+#define MFVSRD_R3_V1 .byte 0x7c,0x23,0x00,0x66 /* mfvsrd r3,vs1 */ -+#endif -+ -+/* long long [r3] llround (float x [fp1]) */ -+ -+ENTRY (__llround) -+ CALL_MCOUNT 0 -+ frin fp1,fp1 /* Round to nearest +-0.5. */ -+ fctidz fp1,fp1 /* Convert To Integer DW round toward 0. */ -+ MFVSRD_R3_V1 -+ blr -+END (__llround) -+ -+strong_alias (__llround, __lround) -+weak_alias (__llround, llround) -+weak_alias (__lround, lround) -+ -+#ifdef NO_LONG_DOUBLE -+weak_alias (__llround, llroundl) -+strong_alias (__llround, __llroundl) -+weak_alias (__lround, lroundl) -+strong_alias (__lround, __lroundl) -+#endif -+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -+compat_symbol (libm, __llround, llroundl, GLIBC_2_1) -+compat_symbol (libm, __lround, lroundl, GLIBC_2_1) -+#endif diff --git a/ppc64-copysign.patch b/ppc64-copysign.patch deleted file mode 100644 index 5cdcb94..0000000 --- a/ppc64-copysign.patch +++ /dev/null @@ -1,23 +0,0 @@ -2014-04-01 Alan Modra - - [BZ #16786] - * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Don't trash stack. - -Index: glibc-2.19/sysdeps/powerpc/powerpc64/fpu/s_copysign.S -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/fpu/s_copysign.S -+++ glibc-2.19/sysdeps/powerpc/powerpc64/fpu/s_copysign.S -@@ -27,11 +27,11 @@ ENTRY(__copysign) - /* double [f1] copysign (double [f1] x, double [f2] y); - copysign(x,y) returns a value with the magnitude of x and - with the sign bit of y. */ -- stfd fp2,56(r1) -+ stfd fp2,-8(r1) - nop - nop - nop -- ld r3,56(r1) -+ ld r3,-8(r1) - cmpdi r3,0 - blt L(0) - fabs fp1,fp1 diff --git a/ppc64le-profiling.patch b/ppc64le-profiling.patch deleted file mode 100644 index f495711..0000000 --- a/ppc64le-profiling.patch +++ /dev/null @@ -1,23 +0,0 @@ -2013-07-29 Adhemerval Zanella - - [BZ #17213] - * sysdeps/powerpc/powerpc64/entry.h: Fix TEXT_START definition for - powerpc64le. - -Index: glibc-2.19/sysdeps/powerpc/powerpc64/entry.h -=================================================================== ---- glibc-2.19.orig/sysdeps/powerpc/powerpc64/entry.h -+++ glibc-2.19/sysdeps/powerpc/powerpc64/entry.h -@@ -23,6 +23,7 @@ extern void _start (void); - - #define ENTRY_POINT _start - -+#if _CALL_ELF != 2 - /* We have to provide a special declaration. */ - #define ENTRY_POINT_DECL(class) class void _start (void); - -@@ -33,3 +34,4 @@ extern void _start (void); - #define TEXT_START \ - ({ extern unsigned long int _start_as_data[] asm ("_start"); \ - _start_as_data[0]; }) -+#endif diff --git a/psfaa.patch b/psfaa.patch deleted file mode 100644 index f3596ae..0000000 --- a/psfaa.patch +++ /dev/null @@ -1,139 +0,0 @@ -2014-06-11 Florian Weimer - - [BZ #17048] - * posix/spawn_int.h (struct __spawn_action): Make the path string - non-const to support deallocation. - * posix/spawn_faction_addopen.c - (posix_spawn_file_actions_addopen): Make a copy of the pathname. - * posix/spawn_faction_destroy.c - (posix_spawn_file_actions_destroy): Adjust comment. Deallocate - path in all spawn_do_open actions. - * posix/tst-spawn.c (do_test): Exercise the copy operation in - posix_spawn_file_actions_addopen. - -Index: glibc-2.19/posix/spawn_faction_addopen.c -=================================================================== ---- glibc-2.19.orig/posix/spawn_faction_addopen.c -+++ glibc-2.19/posix/spawn_faction_addopen.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - - #include "spawn_int.h" - -@@ -35,17 +36,24 @@ posix_spawn_file_actions_addopen (posix_ - if (fd < 0 || fd >= maxfd) - return EBADF; - -+ char *path_copy = strdup (path); -+ if (path_copy == NULL) -+ return ENOMEM; -+ - /* Allocate more memory if needed. */ - if (file_actions->__used == file_actions->__allocated - && __posix_spawn_file_actions_realloc (file_actions) != 0) -- /* This can only mean we ran out of memory. */ -- return ENOMEM; -+ { -+ /* This can only mean we ran out of memory. */ -+ free (path_copy); -+ return ENOMEM; -+ } - - /* Add the new value. */ - rec = &file_actions->__actions[file_actions->__used]; - rec->tag = spawn_do_open; - rec->action.open_action.fd = fd; -- rec->action.open_action.path = path; -+ rec->action.open_action.path = path_copy; - rec->action.open_action.oflag = oflag; - rec->action.open_action.mode = mode; - -Index: glibc-2.19/posix/spawn_faction_destroy.c -=================================================================== ---- glibc-2.19.orig/posix/spawn_faction_destroy.c -+++ glibc-2.19/posix/spawn_faction_destroy.c -@@ -18,11 +18,29 @@ - #include - #include - --/* Initialize data structure for file attribute for `spawn' call. */ -+#include "spawn_int.h" -+ -+/* Deallocate the file actions. */ - int - posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *file_actions) - { -- /* Free the memory allocated. */ -+ /* Free the paths in the open actions. */ -+ for (int i = 0; i < file_actions->__used; ++i) -+ { -+ struct __spawn_action *sa = &file_actions->__actions[i]; -+ switch (sa->tag) -+ { -+ case spawn_do_open: -+ free (sa->action.open_action.path); -+ break; -+ case spawn_do_close: -+ case spawn_do_dup2: -+ /* No cleanup required. */ -+ break; -+ } -+ } -+ -+ /* Free the array of actions. */ - free (file_actions->__actions); - return 0; - } -Index: glibc-2.19/posix/spawn_int.h -=================================================================== ---- glibc-2.19.orig/posix/spawn_int.h -+++ glibc-2.19/posix/spawn_int.h -@@ -22,7 +22,7 @@ struct __spawn_action - struct - { - int fd; -- const char *path; -+ char *path; - int oflag; - mode_t mode; - } open_action; -Index: glibc-2.19/posix/tst-spawn.c -=================================================================== ---- glibc-2.19.orig/posix/tst-spawn.c -+++ glibc-2.19/posix/tst-spawn.c -@@ -168,6 +168,7 @@ do_test (int argc, char *argv[]) - char fd2name[18]; - char fd3name[18]; - char fd4name[18]; -+ char *name3_copy; - char *spargv[12]; - int i; - -@@ -222,9 +223,15 @@ do_test (int argc, char *argv[]) - if (posix_spawn_file_actions_addclose (&actions, fd1) != 0) - error (EXIT_FAILURE, errno, "posix_spawn_file_actions_addclose"); - /* We want to open the third file. */ -- if (posix_spawn_file_actions_addopen (&actions, fd3, name3, -+ name3_copy = strdup (name3); -+ if (name3_copy == NULL) -+ error (EXIT_FAILURE, errno, "strdup"); -+ if (posix_spawn_file_actions_addopen (&actions, fd3, name3_copy, - O_RDONLY, 0666) != 0) - error (EXIT_FAILURE, errno, "posix_spawn_file_actions_addopen"); -+ /* Overwrite the name to check that a copy has been made. */ -+ memset (name3_copy, 'X', strlen (name3_copy)); -+ - /* We dup the second descriptor. */ - fd4 = MAX (2, MAX (fd1, MAX (fd2, fd3))) + 1; - if (posix_spawn_file_actions_adddup2 (&actions, fd2, fd4) != 0) -@@ -253,6 +260,7 @@ do_test (int argc, char *argv[]) - /* Cleanup. */ - if (posix_spawn_file_actions_destroy (&actions) != 0) - error (EXIT_FAILURE, errno, "posix_spawn_file_actions_destroy"); -+ free (name3_copy); - - /* Wait for the child. */ - if (waitpid (pid, &status, 0) != pid) diff --git a/pthread-mutex-trylock-elision.patch b/pthread-mutex-trylock-elision.patch index 6886125..cc2fec3 100644 --- a/pthread-mutex-trylock-elision.patch +++ b/pthread-mutex-trylock-elision.patch @@ -1,19 +1,15 @@ [PATCH] Properly handle forced elision in pthread_mutex_trylock BZ #16657 - * pthread_mutex_trylock.c (__pthread_mutex_trylock): Use + * nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock): Use FORCE_ELISION instead of DO_ELISION. * sysdeps/unix/sysv/linux/x86/force-elision.h (DO_ELISION): Remove. ---- - nptl/pthread_mutex_trylock.c | 7 +++---- - nptl/sysdeps/unix/sysv/linux/x86/force-elision.h | 5 ----- - 2 files changed, 3 insertions(+), 9 deletions(-) -Index: glibc-2.19/nptl/pthread_mutex_trylock.c +Index: glibc-2.19.90/nptl/pthread_mutex_trylock.c =================================================================== ---- glibc-2.19.orig/nptl/pthread_mutex_trylock.c -+++ glibc-2.19/nptl/pthread_mutex_trylock.c +--- glibc-2.19.90.orig/nptl/pthread_mutex_trylock.c ++++ glibc-2.19.90/nptl/pthread_mutex_trylock.c @@ -26,8 +26,8 @@ #define lll_trylock_elision(a,t) lll_trylock(a) #endif @@ -35,10 +31,10 @@ Index: glibc-2.19/nptl/pthread_mutex_trylock.c /*FALL THROUGH*/ case PTHREAD_MUTEX_ADAPTIVE_NP: case PTHREAD_MUTEX_ERRORCHECK_NP: -Index: glibc-2.19/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h +Index: glibc-2.19.90/sysdeps/unix/sysv/linux/x86/force-elision.h =================================================================== ---- glibc-2.19.orig/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h -+++ glibc-2.19/nptl/sysdeps/unix/sysv/linux/x86/force-elision.h +--- glibc-2.19.90.orig/sysdeps/unix/sysv/linux/x86/force-elision.h ++++ glibc-2.19.90/sysdeps/unix/sysv/linux/x86/force-elision.h @@ -16,11 +16,6 @@ License along with the GNU C Library; if not, see . */ diff --git a/resolv-dont-ignore-second-answer.patch b/resolv-dont-ignore-second-answer.patch deleted file mode 100644 index a540f22..0000000 --- a/resolv-dont-ignore-second-answer.patch +++ /dev/null @@ -1,33 +0,0 @@ -Don't ignore second answer from nameserver if the first one was empty (BZ #13651) - -Index: glibc-2.19/resolv/res_query.c -=================================================================== ---- glibc-2.19.orig/resolv/res_query.c -+++ glibc-2.19/resolv/res_query.c -@@ -382,7 +382,7 @@ __libc_res_nsearch(res_state statp, - answer, anslen, answerp, - answerp2, nanswerp2, resplen2, - answerp2_malloced); -- if (ret > 0 || trailing_dot) -+ if (ret > 0 || (ret == 0 && *resplen2 > 0) || trailing_dot) - return (ret); - saved_herrno = h_errno; - tried_as_is++; -@@ -422,7 +422,7 @@ __libc_res_nsearch(res_state statp, - answer, anslen, answerp, - answerp2, nanswerp2, - resplen2, answerp2_malloced); -- if (ret > 0) -+ if (ret > 0 || (ret == 0 && *resplen2 > 0)) - return (ret); - - if (answerp && *answerp != answer) { -@@ -491,7 +491,7 @@ __libc_res_nsearch(res_state statp, - answer, anslen, answerp, - answerp2, nanswerp2, resplen2, - answerp2_malloced); -- if (ret > 0) -+ if (ret > 0 || (ret == 0 && *resplen2 > 0)) - return (ret); - } - diff --git a/s390-revert-abi-change.patch b/s390-revert-abi-change.patch deleted file mode 100644 index 59c55f7..0000000 --- a/s390-revert-abi-change.patch +++ /dev/null @@ -1,2292 +0,0 @@ -2014-07-30 Stefan Liebler - - * sysdeps/s390/Makefile: Delete file. - * sysdeps/s390/Versions (GLIBC_2.19): Remove __setjmp. - * sysdeps/s390/__longjmp.c: Delete file. - * sysdeps/s390/bits/setjmp.h (__s390_jmp_buf): - Remove fields __flags and __reserved. - * sysdeps/s390/longjmp.c: Include setjmp/longjmp.c - and add versioning. - * sysdeps/s390/rtld-__longjmp.c: Delete file. - * sysdeps/s390/rtld-global-offsets.sym: Likewise. - * sysdeps/s390/rtld-setjmp.S: Likewise. - * sysdeps/s390/s390-32/__longjmp-common.c: Move to ... - * sysdeps/s390/s390-32/__longjmp.c: ... here. - * sysdeps/s390/s390-32/setjmp-common.S: Move to ... - * sysdeps/s390/s390-32/setjmp.S: ... here. - Add versioning. - (__sigsetjmp): Remove setting __flags field. - * sysdeps/s390/s390-64/__longjmp-common.c:Move to ... - * sysdeps/s390/s390-64/__longjmp.c: ... here. - * sysdeps/s390/s390-64/setjmp-common.S: Move to ... - * sysdeps/s390/s390-64/setjmp.S: ... here. - Add versioning. - (__sigsetjmp): Remove setting __flags field. - * sysdeps/s390/setjmp.S: Delete file. - * sysdeps/s390/sigjmp.c: Likewise. - * sysdeps/s390/v1-longjmp.c: Likewise. - * sysdeps/s390/v1-setjmp.h: Likewise. - * sysdeps/s390/v1-sigjmp.c: Likewise. - * sysdeps/unix/sysv/linux/s390/Makefile (sysdep_routines): - Remove v1-longjmp_chk. - * sysdeps/unix/sysv/linux/s390/getcontext.S: Delete file. - * sysdeps/unix/sysv/linux/s390/longjmp_chk.c: - Include debug/longjmp_chk.c and add versioning. - * nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c: - Include nptl/sysdeps/pthread/pt-longjmp.c and add versioning. - * sysdeps/unix/sysv/linux/s390/rtld-getcontext.S: Delete file. - * sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c: - Include __longjmp.c. - * sysdeps/unix/sysv/linux/s390/s390-32/getcontext-common.S: - Move to ... - * sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S: ... here. - (__getcontext): Remove setting __flags field. - Add versioning. - * sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S: - Don´t restore upper high grps. - * sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S: - Likewise. - (__swapcontext): Remove setting uc_flags field. - * sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.sym: - Delete file. - * sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c: - Include __longjmp.c. - * sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S: - Move to ... - * sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S: ... here. - (__getcontext): Remove setting __flags field. - Add versioning. - * sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S: - (__swapcontext): Remove setting uc_flags field. - * unix/sysv/linux/s390/s390-64/ucontext_i.sym: Delete file. - * sysdeps/unix/sysv/linux/s390/sys/ucontext.h (ucontext): - Remove fields uc_high_gprs and __reserved. - * sysdeps/unix/sysv/linux/s390/ucontext_i.sym: - New file with reverted content. - * sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c: Delete file. - * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: - Regenerated. - * sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist: - Regenerated. - -Index: glibc-2.19/nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c -=================================================================== ---- glibc-2.19.orig/nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c -+++ glibc-2.19/nptl/sysdeps/unix/sysv/linux/s390/pt-longjmp.c -@@ -15,49 +15,30 @@ - License along with the GNU C Library; if not, see - . - -- This is a copy of pthread/pt-longjmp.c made for extending the -- jmpbuf structure on System z. */ -+ Versioned copy of nptl/pt-longjmp.c modified for versioning -+ the reverted jmpbuf extension. */ - --#include --#include --#include --#include "pthreadP.h" - #include --#if defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_19) - --/* The __v1 version prototypes are declared in v1-setjmp.h which -- cannot be included together with setjmp.h. So we put the -- prototypes here manually. */ --extern void __v1__libc_siglongjmp (sigjmp_buf env, int val) -- __attribute__ ((noreturn)); --extern void __v1__libc_longjmp (sigjmp_buf env, int val) -- __attribute__ ((noreturn)); -- --void __v1_siglongjmp (sigjmp_buf env, int val) --{ -- __v1__libc_siglongjmp (env, val); --} -- --void __v1_longjmp (jmp_buf env, int val) --{ -- __v1__libc_longjmp (env, val); --} -- --compat_symbol (libpthread, __v1_longjmp, longjmp, GLIBC_2_0); --compat_symbol (libpthread, __v1_siglongjmp, siglongjmp, GLIBC_2_0); --#endif /* defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_19)) */ -- --void --__v2_longjmp (jmp_buf env, int val) --{ -- __libc_longjmp (env, val); --} -- --void --__v2_siglongjmp (jmp_buf env, int val) --{ -- __libc_siglongjmp (env, val); --} -- --versioned_symbol (libpthread, __v2_longjmp, longjmp, GLIBC_2_19); --versioned_symbol (libpthread, __v2_siglongjmp, siglongjmp, GLIBC_2_19); -+#if defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20) -+ /* we need a unique name in case of symbol versioning. */ -+# define longjmp __v1longjmp -+#endif /* defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */ -+ -+#include -+ -+#if defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20) -+/* In glibc release 2.19 new versions of longjmp-functions were introduced, -+ but were reverted before 2.20. Thus both versions are the same function. */ -+ -+# undef longjmp -+ -+strong_alias (__v1longjmp, __v2longjmp) -+versioned_symbol (libpthread, __v1longjmp, longjmp, GLIBC_2_0); -+compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19); -+ -+weak_alias (siglongjmp, __v1siglongjmp) -+weak_alias (siglongjmp, __v2siglongjmp) -+versioned_symbol (libpthread, __v1siglongjmp, siglongjmp, GLIBC_2_0); -+compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19); -+#endif /* defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */ -Index: glibc-2.19/sysdeps/s390/Makefile -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/Makefile -+++ /dev/null -@@ -1,9 +0,0 @@ --ifeq ($(subdir),setjmp) --ifeq (yes,$(build-shared)) --sysdep_routines += v1-longjmp v1-sigjmp --endif --endif -- --ifeq ($(subdir),csu) --gen-as-const-headers += rtld-global-offsets.sym --endif -Index: glibc-2.19/sysdeps/s390/Versions -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/Versions -+++ glibc-2.19/sysdeps/s390/Versions -@@ -1,12 +1,8 @@ - libc { - GLIBC_2.19 { -- setjmp; _setjmp; __setjmp; __sigsetjmp; -+ setjmp; _setjmp; __sigsetjmp; - longjmp; _longjmp; siglongjmp; - } -- GLIBC_PRIVATE { -- __v1__libc_longjmp; __v1__libc_siglongjmp; -- __v2__libc_longjmp; __v2__libc_siglongjmp; -- } - } - - ld { -Index: glibc-2.19/sysdeps/s390/__longjmp.c -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/__longjmp.c -+++ /dev/null -@@ -1,31 +0,0 @@ --/* Copyright (C) 2013 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 -- . */ -- --#include --#include -- --#define __longjmp __v2__longjmp --#include "__longjmp-common.c" --#undef __longjmp --strong_alias (__v2__longjmp, __longjmp) -- --#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) --# undef __longjmp --# define __V1_JMPBUF --# define __longjmp __v1__longjmp --# include "__longjmp-common.c" --#endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) */ -Index: glibc-2.19/sysdeps/s390/bits/setjmp.h -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/bits/setjmp.h -+++ glibc-2.19/sysdeps/s390/bits/setjmp.h -@@ -40,10 +40,6 @@ typedef struct __s390_jmp_buf - /* We save fpu registers 4 and 6. */ - long __fpregs[4]; - # endif --#ifndef __V1_JMPBUF -- unsigned long __flags; -- char __reserved[128]; --#endif - } __jmp_buf[1]; - - #endif -Index: glibc-2.19/sysdeps/s390/longjmp.c -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/longjmp.c -+++ glibc-2.19/sysdeps/s390/longjmp.c -@@ -15,50 +15,28 @@ - License along with the GNU C Library; if not, see - . - -- Versioned copy of sysdeps/generic/longjmp.c modified for extended -- jmpbuf. */ -+ Versioned copy of setjmp/longjmp.c modified for versioning -+ the reverted jmpbuf extension. */ - - #include --#include --#include --#include -- --extern void __v2__longjmp (__jmp_buf __env, int __val) -- __attribute__ ((__noreturn__)); --extern void __v2__libc_longjmp (sigjmp_buf env, int val) -- __attribute__ ((__noreturn__)); --libc_hidden_proto (__v2__libc_longjmp) -- --/* Set the signal mask to the one specified in ENV, and jump -- to the position specified in ENV, causing the setjmp -- call there to return VAL, or 1 if VAL is 0. */ --void --__v2__libc_siglongjmp (sigjmp_buf env, int val) --{ -- /* Perform any cleanups needed by the frames being unwound. */ -- _longjmp_unwind (env, val); -- -- if (env[0].__mask_was_saved) -- /* Restore the saved signal mask. */ -- (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, -- (sigset_t *) NULL); -- -- /* Call the machine-dependent function to restore machine state. */ -- __v2__longjmp (env[0].__jmpbuf, val ?: 1); --} -- --#ifndef __v2__longjmp --strong_alias (__v2__libc_siglongjmp, __v2__libc_longjmp) --libc_hidden_def (__v2__libc_longjmp) --weak_alias (__v2__libc_siglongjmp, __v2_longjmp) --weak_alias (__v2__libc_siglongjmp, __v2longjmp) --weak_alias (__v2__libc_siglongjmp, __v2siglongjmp) -- --/* These will be used by libpthread only. */ --versioned_symbol (libc, __v2__libc_longjmp, __libc_longjmp, GLIBC_PRIVATE); --versioned_symbol (libc, __v2__libc_siglongjmp, __libc_siglongjmp, GLIBC_PRIVATE); -- --versioned_symbol (libc, __v2_longjmp, _longjmp, GLIBC_2_19); --versioned_symbol (libc, __v2longjmp, longjmp, GLIBC_2_19); --versioned_symbol (libc, __v2siglongjmp, siglongjmp, GLIBC_2_19); --#endif /* ifndef __v2__longjmp */ -+ -+#include -+ -+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) -+/* In glibc release 2.19 new versions of longjmp-functions were introduced, -+ but were reverted before 2.20. Thus both versions are the same function. */ -+weak_alias (__libc_siglongjmp, __v1_longjmp) -+weak_alias (__libc_siglongjmp, __v2_longjmp) -+versioned_symbol (libc, __v1_longjmp, _longjmp, GLIBC_2_0); -+compat_symbol (libc, __v2_longjmp, _longjmp, GLIBC_2_19); -+ -+weak_alias (__libc_siglongjmp, __v1longjmp) -+weak_alias (__libc_siglongjmp, __v2longjmp) -+versioned_symbol (libc, __v1longjmp, longjmp, GLIBC_2_0); -+compat_symbol (libc, __v2longjmp, longjmp, GLIBC_2_19); -+ -+weak_alias (__libc_siglongjmp, __v1siglongjmp) -+weak_alias (__libc_siglongjmp, __v2siglongjmp) -+versioned_symbol (libc, __v1siglongjmp, siglongjmp, GLIBC_2_0); -+compat_symbol (libc, __v2siglongjmp, siglongjmp, GLIBC_2_19); -+#endif /* SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ -Index: glibc-2.19/sysdeps/s390/rtld-__longjmp.c -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/rtld-__longjmp.c -+++ /dev/null -@@ -1,19 +0,0 @@ --/* Copyright (C) 2013 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 -- . */ -- --/* Build a non-versioned object for rtld-*. */ --# include "__longjmp-common.c" -Index: glibc-2.19/sysdeps/s390/rtld-global-offsets.sym -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/rtld-global-offsets.sym -+++ /dev/null -@@ -1,7 +0,0 @@ --#define SHARED 1 -- --#include -- --#define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem) -- --RTLD_GLOBAL_RO_DL_HWCAP_OFFSET rtld_global_ro_offsetof (_dl_hwcap) -Index: glibc-2.19/sysdeps/s390/rtld-setjmp.S -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/rtld-setjmp.S -+++ /dev/null -@@ -1,20 +0,0 @@ --/* Extendible version of setjmp for System z -- Copyright (C) 2013 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 -- . */ -- --/* Build a non-versioned object for rtld-*. */ --# include "setjmp-common.S" -Index: glibc-2.19/sysdeps/s390/s390-32/__longjmp-common.c -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/s390-32/__longjmp-common.c -+++ /dev/null -@@ -1,68 +0,0 @@ --/* Copyright (C) 2000-2014 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -- -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- The GNU C Library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, see -- . */ -- --#include --#include --#include --#include --#include --#include -- --/* Jump to the position specified by ENV, causing the -- setjmp call there to return VAL, or 1 if VAL is 0. */ --attribute_hidden void --__longjmp (__jmp_buf env, int val) --{ --#ifdef PTR_DEMANGLE -- uintptr_t guard = THREAD_GET_POINTER_GUARD (); --# ifdef CHECK_SP -- CHECK_SP (env, guard); --# endif --#elif defined CHECK_SP -- CHECK_SP (env, 0); --#endif -- register int r2 __asm ("%r2") = val == 0 ? 1 : val; --#ifdef PTR_DEMANGLE -- register uintptr_t r3 __asm ("%r3") = guard; -- register void *r1 __asm ("%r1") = (void *) env; --#endif -- /* Restore registers and jump back. */ -- asm volatile ("ld %%f6,48(%1)\n\t" -- "ld %%f4,40(%1)\n\t" --#ifdef PTR_DEMANGLE -- "lm %%r6,%%r13,0(%1)\n\t" -- "lm %%r4,%%r5,32(%1)\n\t" -- "xr %%r4,%2\n\t" -- "xr %%r5,%2\n\t" -- "lr %%r15,%%r5\n\t" -- "br %%r4" --#else -- "lm %%r6,%%r15,0(%1)\n\t" -- "br %%r14" --#endif -- : : "r" (r2), --#ifdef PTR_DEMANGLE -- "r" (r1), "r" (r3) --#else -- "a" (env) --#endif -- ); -- -- /* Avoid `volatile function does return' warnings. */ -- for (;;); --} -Index: glibc-2.19/sysdeps/s390/s390-32/__longjmp.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/s390/s390-32/__longjmp.c -@@ -0,0 +1,68 @@ -+/* Copyright (C) 2000-2014 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Jump to the position specified by ENV, causing the -+ setjmp call there to return VAL, or 1 if VAL is 0. */ -+void -+__longjmp (__jmp_buf env, int val) -+{ -+#ifdef PTR_DEMANGLE -+ uintptr_t guard = THREAD_GET_POINTER_GUARD (); -+# ifdef CHECK_SP -+ CHECK_SP (env, guard); -+# endif -+#elif defined CHECK_SP -+ CHECK_SP (env, 0); -+#endif -+ register int r2 __asm ("%r2") = val == 0 ? 1 : val; -+#ifdef PTR_DEMANGLE -+ register uintptr_t r3 __asm ("%r3") = guard; -+ register void *r1 __asm ("%r1") = (void *) env; -+#endif -+ /* Restore registers and jump back. */ -+ asm volatile ("ld %%f6,48(%1)\n\t" -+ "ld %%f4,40(%1)\n\t" -+#ifdef PTR_DEMANGLE -+ "lm %%r6,%%r13,0(%1)\n\t" -+ "lm %%r4,%%r5,32(%1)\n\t" -+ "xr %%r4,%2\n\t" -+ "xr %%r5,%2\n\t" -+ "lr %%r15,%%r5\n\t" -+ "br %%r4" -+#else -+ "lm %%r6,%%r15,0(%1)\n\t" -+ "br %%r14" -+#endif -+ : : "r" (r2), -+#ifdef PTR_DEMANGLE -+ "r" (r1), "r" (r3) -+#else -+ "a" (env) -+#endif -+ ); -+ -+ /* Avoid `volatile function does return' warnings. */ -+ for (;;); -+} -Index: glibc-2.19/sysdeps/s390/s390-32/setjmp-common.S -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/s390-32/setjmp-common.S -+++ /dev/null -@@ -1,84 +0,0 @@ --/* setjmp for s390, ELF version. -- Copyright (C) 2000-2014 Free Software Foundation, Inc. -- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -- 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 -- . */ -- --#include --#define _ASM --#define _SETJMP_H --#include -- -- /* We include the BSD entry points here as well but we make -- them weak. */ --ENTRY (setjmp) -- .weak C_SYMBOL_NAME (setjmp) -- lhi %r3,1 /* second argument of one */ -- j 0f /* branch relativ to __sigsetjmp */ --END (setjmp) -- -- /* Binary compatibility entry point. */ --ENTRY(_setjmp) -- .weak C_SYMBOL_NAME (_setjmp) -- lhi %r3,0 /* second argument of zero */ -- j 0f /* branch relativ to __sigsetjmp */ --END (_setjmp) --libc_hidden_def (_setjmp) -- --ENTRY(__setjmp) -- lhi %r3,0 /* second argument of zero */ -- j 0f /* branch relativ to __sigsetjmp */ --END (__setjmp) -- --ENTRY(__sigsetjmp) --0: --#ifdef PTR_MANGLE -- stm %r6,%r13,0(%r2) /* store registers in jmp_buf */ -- lr %r4,%r14 -- lr %r5,%r15 -- PTR_MANGLE (%r4, %r1) -- PTR_MANGLE2 (%r5, %r1) -- stm %r4,%r5,32(%r2) --#else -- stm %r6,%r15,0(%r2) /* store registers in jmp_buf */ --#endif --#ifndef __V1_JMPBUF -- lhi %r4,0 -- st %r4,56(%r2) /* Set __flags to 0. */ --#endif -- std %f4,40(%r2) -- std %f6,48(%r2) --#if defined NOT_IN_libc && defined IS_IN_rtld -- /* In ld.so we never save the signal mask. */ -- lhi %r2,0 -- br %r14 --#elif defined PIC -- /* We cannot use the PLT, because it requires that %r12 be set, but -- we can't save and restore our caller's value. Instead, we do an -- indirect jump through the GOT. */ -- basr %r1,0 --0: al %r1,1f-0b(0,%r1) /* get address of global offset table */ -- /* get address of __sigjmp_save from got */ -- l %r1,__sigjmp_save@GOT12(0,%r1) -- br %r1 --1: .long _GLOBAL_OFFSET_TABLE_ - 0b --#else -- basr %r1,0 --0: l %r1,1f-0b(0,%r1) /* load address of __sigjmp_save */ -- br %r1 /* tail-call __sigjmp_save */ --1: .long __sigjmp_save --#endif --END (__sigsetjmp) -Index: glibc-2.19/sysdeps/s390/s390-32/setjmp.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/s390/s390-32/setjmp.S -@@ -0,0 +1,111 @@ -+/* setjmp for s390, ELF version. -+ Copyright (C) 2000-2014 Free Software Foundation, Inc. -+ Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -+ 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 -+ . */ -+ -+#include -+#define _ASM -+#define _SETJMP_H -+#include -+#include -+ -+#if !defined IS_IN_rtld -+# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) -+ /* we need a unique name in case of symbol versioning. */ -+# define __sigsetjmp __v1__sigsetjmp -+# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ -+#endif /* !defined IS_IN_rtld */ -+ -+ /* We include the BSD entry points here as well but we make -+ them weak. */ -+ENTRY (setjmp) -+ .weak C_SYMBOL_NAME (setjmp) -+ lhi %r3,1 /* second argument of one */ -+ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */ -+END (setjmp) -+ -+ /* Binary compatibility entry point. */ -+ENTRY(_setjmp) -+ .weak C_SYMBOL_NAME (_setjmp) -+ lhi %r3,0 /* second argument of zero */ -+ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */ -+END (_setjmp) -+libc_hidden_def (_setjmp) -+ -+ENTRY(__setjmp) -+ lhi %r3,0 /* second argument of zero */ -+ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */ -+END (__setjmp) -+ -+ENTRY(__sigsetjmp) -+.Linternal_sigsetjmp: -+#ifdef PTR_MANGLE -+ stm %r6,%r13,0(%r2) /* store registers in jmp_buf */ -+ lr %r4,%r14 -+ lr %r5,%r15 -+ PTR_MANGLE (%r4, %r1) -+ PTR_MANGLE2 (%r5, %r1) -+ stm %r4,%r5,32(%r2) -+#else -+ stm %r6,%r15,0(%r2) /* store registers in jmp_buf */ -+#endif -+ std %f4,40(%r2) -+ std %f6,48(%r2) -+#if defined NOT_IN_libc && defined IS_IN_rtld -+ /* In ld.so we never save the signal mask. */ -+ lhi %r2,0 -+ br %r14 -+#elif defined PIC -+ /* We cannot use the PLT, because it requires that %r12 be set, but -+ we can't save and restore our caller's value. Instead, we do an -+ indirect jump through the GOT. */ -+ basr %r1,0 -+.L0: al %r1,.L1 - .L0(0,%r1) /* get address of global offset table */ -+ /* get address of __sigjmp_save from got */ -+ l %r1,__sigjmp_save@GOT12(0,%r1) -+ br %r1 -+.L1: .long _GLOBAL_OFFSET_TABLE_ - .L0 -+#else -+ basr %r1,0 -+.L0: l %r1,.L1-.L0(0,%r1) /* load address of __sigjmp_save */ -+ br %r1 /* tail-call __sigjmp_save */ -+.L1: .long __sigjmp_save -+#endif -+END (__sigsetjmp) -+ -+#if !defined IS_IN_rtld -+# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) -+/* In glibc release 2.19 new versions of setjmp-functions were introduced, -+ but were reverted before 2.20. Thus both versions are the same function. */ -+ -+# undef __sigsetjmp -+ -+weak_alias (setjmp, __v1setjmp); -+weak_alias (setjmp, __v2setjmp); -+versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0); -+compat_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19); -+ -+weak_alias (_setjmp, __v1_setjmp); -+weak_alias (_setjmp, __v2_setjmp); -+versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0); -+compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19); -+ -+strong_alias (__v1__sigsetjmp, __v2__sigsetjmp); -+versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0); -+compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19); -+# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ -+#endif /* if !defined IS_IN_rtld */ -Index: glibc-2.19/sysdeps/s390/s390-64/__longjmp-common.c -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/s390-64/__longjmp-common.c -+++ /dev/null -@@ -1,74 +0,0 @@ --/* Copyright (C) 2001-2014 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -- -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- The GNU C Library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, see -- . */ -- --#include --#include --#include --#include --#include --#include -- --/* Jump to the position specified by ENV, causing the -- setjmp call there to return VAL, or 1 if VAL is 0. */ --attribute_hidden void --__longjmp (__jmp_buf env, int val) --{ --#ifdef PTR_DEMANGLE -- uintptr_t guard = THREAD_GET_POINTER_GUARD (); --# ifdef CHECK_SP -- CHECK_SP (env, guard); --# endif --#elif defined CHECK_SP -- CHECK_SP (env, 0); --#endif -- register long int r2 __asm ("%r2") = val == 0 ? 1 : val; --#ifdef PTR_DEMANGLE -- register uintptr_t r3 __asm ("%r3") = guard; -- register void *r1 __asm ("%r1") = (void *) env; --#endif -- /* Restore registers and jump back. */ -- asm volatile ("ld %%f8,80(%1)\n\t" -- "ld %%f9,88(%1)\n\t" -- "ld %%f10,96(%1)\n\t" -- "ld %%f11,104(%1)\n\t" -- "ld %%f12,112(%1)\n\t" -- "ld %%f13,120(%1)\n\t" -- "ld %%f14,128(%1)\n\t" -- "ld %%f15,136(%1)\n\t" --#ifdef PTR_DEMANGLE -- "lmg %%r6,%%r13,0(%1)\n\t" -- "lmg %%r4,%%r5,64(%1)\n\t" -- "xgr %%r4,%2\n\t" -- "xgr %%r5,%2\n\t" -- "lgr %%r15,%%r5\n\t" -- "br %%r4" --#else -- "lmg %%r6,%%r15,0(%1)\n\t" -- "br %%r14" --#endif -- : : "r" (r2), --#ifdef PTR_DEMANGLE -- "r" (r1), "r" (r3) --#else -- "a" (env) --#endif -- ); -- -- /* Avoid `volatile function does return' warnings. */ -- for (;;); --} -Index: glibc-2.19/sysdeps/s390/s390-64/__longjmp.c -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/s390/s390-64/__longjmp.c -@@ -0,0 +1,74 @@ -+/* Copyright (C) 2001-2014 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Jump to the position specified by ENV, causing the -+ setjmp call there to return VAL, or 1 if VAL is 0. */ -+void -+__longjmp (__jmp_buf env, int val) -+{ -+#ifdef PTR_DEMANGLE -+ uintptr_t guard = THREAD_GET_POINTER_GUARD (); -+# ifdef CHECK_SP -+ CHECK_SP (env, guard); -+# endif -+#elif defined CHECK_SP -+ CHECK_SP (env, 0); -+#endif -+ register long int r2 __asm ("%r2") = val == 0 ? 1 : val; -+#ifdef PTR_DEMANGLE -+ register uintptr_t r3 __asm ("%r3") = guard; -+ register void *r1 __asm ("%r1") = (void *) env; -+#endif -+ /* Restore registers and jump back. */ -+ asm volatile ("ld %%f8,80(%1)\n\t" -+ "ld %%f9,88(%1)\n\t" -+ "ld %%f10,96(%1)\n\t" -+ "ld %%f11,104(%1)\n\t" -+ "ld %%f12,112(%1)\n\t" -+ "ld %%f13,120(%1)\n\t" -+ "ld %%f14,128(%1)\n\t" -+ "ld %%f15,136(%1)\n\t" -+#ifdef PTR_DEMANGLE -+ "lmg %%r6,%%r13,0(%1)\n\t" -+ "lmg %%r4,%%r5,64(%1)\n\t" -+ "xgr %%r4,%2\n\t" -+ "xgr %%r5,%2\n\t" -+ "lgr %%r15,%%r5\n\t" -+ "br %%r4" -+#else -+ "lmg %%r6,%%r15,0(%1)\n\t" -+ "br %%r14" -+#endif -+ : : "r" (r2), -+#ifdef PTR_DEMANGLE -+ "r" (r1), "r" (r3) -+#else -+ "a" (env) -+#endif -+ ); -+ -+ /* Avoid `volatile function does return' warnings. */ -+ for (;;); -+} -Index: glibc-2.19/sysdeps/s390/s390-64/setjmp-common.S -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/s390-64/setjmp-common.S -+++ /dev/null -@@ -1,79 +0,0 @@ --/* setjmp for 64 bit S/390, ELF version. -- Copyright (C) 2001-2014 Free Software Foundation, Inc. -- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -- 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 -- . */ -- --#include --#define _ASM --#define _SETJMP_H --#include -- -- /* We include the BSD entry points here as well but we make -- them weak. */ --ENTRY (setjmp) -- .weak C_SYMBOL_NAME (setjmp) -- lghi %r3,1 /* Second argument of one. */ -- j 0f /* Branch relativ to __sigsetjmp. */ --END (setjmp) -- -- /* Binary compatibility entry point. */ --ENTRY(_setjmp) -- .weak C_SYMBOL_NAME (_setjmp) -- slgr %r3,%r3 /* Second argument of zero. */ -- j 0f /* Branch relativ to __sigsetjmp. */ --END (_setjmp) --libc_hidden_def (_setjmp) -- --ENTRY(__setjmp) -- slgr %r3,%r3 /* Second argument of zero. */ -- j 0f /* Branch relativ to __sigsetjmp. */ --END (__setjmp) -- --ENTRY(__sigsetjmp) --0: --#ifdef PTR_MANGLE -- stmg %r6,%r13,0(%r2) /* Store registers in jmp_buf. */ -- lgr %r4,%r14 -- lgr %r5,%r15 -- PTR_MANGLE (%r4, %r1) -- PTR_MANGLE2 (%r5, %r1) -- stmg %r4,%r5,64(%r2) --#else -- stmg %r6,%r15,0(%r2) /* Store registers in jmp_buf. */ --#endif --#ifndef __V1_JMPBUF -- lghi %r4,0 -- stg %r4,144(%r2) /* Set __flags to 0. */ --#endif -- std %f8,80(%r2) -- std %f9,88(%r2) -- std %f10,96(%r2) -- std %f11,104(%r2) -- std %f12,112(%r2) -- std %f13,120(%r2) -- std %f14,128(%r2) -- std %f15,136(%r2) --#if defined NOT_IN_libc && defined IS_IN_rtld -- /* In ld.so we never save the signal mask. */ -- lghi %r2,0 -- br %r14 --#elif defined PIC -- jg __sigjmp_save@PLT /* Branch to PLT of __sigsetjmp. */ --#else -- jg __sigjmp_save --#endif --END (__sigsetjmp) -Index: glibc-2.19/sysdeps/s390/s390-64/setjmp.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/s390/s390-64/setjmp.S -@@ -0,0 +1,106 @@ -+/* setjmp for 64 bit S/390, ELF version. -+ Copyright (C) 2001-2014 Free Software Foundation, Inc. -+ Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -+ 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 -+ . */ -+ -+#include -+#define _ASM -+#define _SETJMP_H -+#include -+#include -+ -+#if !defined IS_IN_rtld -+# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) -+ /* we need a unique name in case of symbol versioning. */ -+# define __sigsetjmp __v1__sigsetjmp -+# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ -+#endif /* !defined IS_IN_rtld */ -+ -+ /* We include the BSD entry points here as well but we make -+ them weak. */ -+ENTRY (setjmp) -+ .weak C_SYMBOL_NAME (setjmp) -+ lghi %r3,1 /* Second argument of one. */ -+ j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ -+END (setjmp) -+ -+ /* Binary compatibility entry point. */ -+ENTRY(_setjmp) -+ .weak C_SYMBOL_NAME (_setjmp) -+ slgr %r3,%r3 /* Second argument of zero. */ -+ j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ -+END (_setjmp) -+libc_hidden_def (_setjmp) -+ -+ENTRY(__setjmp) -+ slgr %r3,%r3 /* Second argument of zero. */ -+ j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */ -+END (__setjmp) -+ -+ENTRY(__sigsetjmp) -+.Linternal_sigsetjmp: -+#ifdef PTR_MANGLE -+ stmg %r6,%r13,0(%r2) /* Store registers in jmp_buf. */ -+ lgr %r4,%r14 -+ lgr %r5,%r15 -+ PTR_MANGLE (%r4, %r1) -+ PTR_MANGLE2 (%r5, %r1) -+ stmg %r4,%r5,64(%r2) -+#else -+ stmg %r6,%r15,0(%r2) /* Store registers in jmp_buf. */ -+#endif -+ std %f8,80(%r2) -+ std %f9,88(%r2) -+ std %f10,96(%r2) -+ std %f11,104(%r2) -+ std %f12,112(%r2) -+ std %f13,120(%r2) -+ std %f14,128(%r2) -+ std %f15,136(%r2) -+#if defined NOT_IN_libc && defined IS_IN_rtld -+ /* In ld.so we never save the signal mask. */ -+ lghi %r2,0 -+ br %r14 -+#elif defined PIC -+ jg __sigjmp_save@PLT /* Branch to PLT of __sigsetjmp. */ -+#else -+ jg __sigjmp_save -+#endif -+END (__sigsetjmp) -+ -+#if !defined IS_IN_rtld -+# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) -+/* In glibc release 2.19 new versions of setjmp-functions were introduced, -+ but were reverted before 2.20. Thus both versions are the same function. */ -+ -+# undef __sigsetjmp -+ -+weak_alias (setjmp, __v1setjmp); -+weak_alias (setjmp, __v2setjmp); -+versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0); -+compat_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19); -+ -+weak_alias (_setjmp, __v1_setjmp); -+weak_alias (_setjmp, __v2_setjmp); -+versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0); -+compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19); -+ -+strong_alias (__v1__sigsetjmp, __v2__sigsetjmp); -+versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0); -+compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19); -+# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ -+#endif /* if !defined IS_IN_rtld */ -Index: glibc-2.19/sysdeps/s390/setjmp.S -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/setjmp.S -+++ /dev/null -@@ -1,64 +0,0 @@ --/* Extendible version of setjmp for System z -- Copyright (C) 2013 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 -- . */ -- --#include --#include -- --versioned_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19) --versioned_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19) --versioned_symbol (libc, __v2__setjmp, __setjmp, GLIBC_2_19) --versioned_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19) --#define setjmp __v2setjmp --#define _setjmp __v2_setjmp --#define __setjmp __v2__setjmp --#define __sigsetjmp __v2__sigsetjmp --#define __sigjmp_save __v2__sigjmp_save -- --#include "setjmp-common.S" -- --#undef setjmp --#undef _setjmp --#undef __setjmp --#undef __sigsetjmp --#undef __sigjmp_save --libc_hidden_ver (__v2setjmp, setjmp) --libc_hidden_ver (__v2_setjmp, _setjmp) --libc_hidden_ver (__v2__setjmp, __setjmp) --libc_hidden_ver (__v2__sigsetjmp, __sigsetjmp) -- --#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) --compat_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0) --compat_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0) --compat_symbol (libc, __v1__setjmp, __setjmp, GLIBC_2_0) --compat_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0) --# define setjmp __v1setjmp --# define _setjmp __v1_setjmp --# define __setjmp __v1__setjmp --# define __sigsetjmp __v1__sigsetjmp --# define __sigjmp_save __v1__sigjmp_save --# define __V1_JMPBUF -- --# include "setjmp-common.S" -- --# undef setjmp --# undef _setjmp --# undef __setjmp --# undef __sigsetjmp --# undef __sigjmp_save -- --#endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) */ -Index: glibc-2.19/sysdeps/s390/sigjmp.c -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/sigjmp.c -+++ /dev/null -@@ -1,34 +0,0 @@ --/* Copyright (C) 1992-2013 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 -- . */ -- --#include --#include --#include -- --/* This function is called by the `sigsetjmp' macro -- before doing a `__setjmp' on ENV[0].__jmpbuf. -- Always return zero. */ -- --int --__v2__sigjmp_save (sigjmp_buf env, int savemask) --{ -- env[0].__mask_was_saved = (savemask && -- __sigprocmask (SIG_BLOCK, (sigset_t *) NULL, -- &env[0].__saved_mask) == 0); -- -- return 0; --} -Index: glibc-2.19/sysdeps/s390/v1-longjmp.c -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/v1-longjmp.c -+++ /dev/null -@@ -1,57 +0,0 @@ --/* Copyright (C) 2013 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 -- . -- -- Versioned copy of sysdeps/generic/longjmp.c modified for extended -- jmpbuf. */ -- --#include --#include --#include --#include "v1-setjmp.h" -- --#if !defined NOT_INT_libc && defined SHARED --# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) -- --void --__v1__libc_siglongjmp (__v1__sigjmp_buf env, int val) --{ -- /* Perform any cleanups needed by the frames being unwound. */ -- _longjmp_unwind (env, val); -- -- if (env[0].__mask_was_saved) -- /* Restore the saved signal mask. */ -- (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, -- (sigset_t *) NULL); -- -- /* Call the machine-dependent function to restore machine state. */ -- __v1__longjmp (env[0].__jmpbuf, val ?: 1); --} -- --# ifndef __v1__longjmp --strong_alias (__v1__libc_siglongjmp, __v1__libc_longjmp) --libc_hidden_def (__v1__libc_longjmp) --weak_alias (__v1__libc_siglongjmp, __v1_longjmp) --weak_alias (__v1__libc_siglongjmp, __v1longjmp) --weak_alias (__v1__libc_siglongjmp, __v1siglongjmp) -- --compat_symbol (libc, __v1_longjmp, _longjmp, GLIBC_2_0); --compat_symbol (libc, __v1longjmp, longjmp, GLIBC_2_0); --compat_symbol (libc, __v1siglongjmp, siglongjmp, GLIBC_2_0); -- --# endif /* ifndef __v1__longjmp */ --# endif /* SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) */ --#endif /* if !defined NOT_INT_libc && defined SHARED */ -Index: glibc-2.19/sysdeps/s390/v1-setjmp.h -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/v1-setjmp.h -+++ /dev/null -@@ -1,111 +0,0 @@ --/* Copyright (C) 1991-2013 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 -- . */ -- --/* -- * ISO C99 Standard: 7.13 Nonlocal jumps -- */ -- --#ifndef _V1_SETJMP_H --#define _V1_SETJMP_H 1 -- --#include -- --__BEGIN_DECLS -- --#define __V1_JMPBUF --#define _SETJMP_H --#include /* Get `__jmp_buf'. */ -- --#ifndef _ASM -- --#include /* Get `__sigset_t'. */ -- -- --/* Calling environment, plus possibly a saved signal mask. */ --typedef struct __v1__jmp_buf_tag -- { -- /* NOTE: The machine-dependent definitions of `__sigsetjmp' -- assume that a `jmp_buf' begins with a `__jmp_buf' and that -- `__mask_was_saved' follows it. Do not move these members -- or add others before it. */ -- __jmp_buf __jmpbuf; /* Calling environment. */ -- int __mask_was_saved; /* Saved the signal mask? */ -- __sigset_t __saved_mask; /* Saved signal mask. */ -- } __v1__jmp_buf[1]; -- -- --/* Store the calling environment in ENV, also saving the signal mask. -- Return 0. */ --extern int __v1setjmp (__v1__jmp_buf __env); -- --/* Store the calling environment in ENV, also saving the -- signal mask if SAVEMASK is nonzero. Return 0. -- This is the internal name for `sigsetjmp'. */ --extern int __v1__sigsetjmp (struct __v1__jmp_buf_tag __env[1], -- int __savemask); -- --/* Store the calling environment in ENV, not saving the signal mask. -- Return 0. */ --extern int __v1_setjmp (struct __v1__jmp_buf_tag __env[1]); -- --/* Jump to the environment saved in ENV, making the -- `setjmp' call there return VAL, or 1 if VAL is 0. */ --extern void __v1longjmp (struct __v1__jmp_buf_tag __env[1], int __val) -- __attribute__ ((__noreturn__)); -- --/* Same. Usually `_longjmp' is used with `_setjmp', which does not save -- the signal mask. But it is how ENV was saved that determines whether -- `longjmp' restores the mask; `_longjmp' is just an alias. */ --extern void __v1_longjmp (struct __v1__jmp_buf_tag __env[1], int __val) -- __attribute__ ((__noreturn__)); -- --/* Use the same type for `jmp_buf' and `sigjmp_buf'. -- The `__mask_was_saved' flag determines whether -- or not `longjmp' will restore the signal mask. */ --typedef struct __v1__jmp_buf_tag __v1__sigjmp_buf[1]; -- --/* Jump to the environment saved in ENV, making the -- sigsetjmp call there return VAL, or 1 if VAL is 0. -- Restore the signal mask if that sigsetjmp call saved it. -- This is just an alias `longjmp'. */ --extern void __v1siglongjmp (__v1__sigjmp_buf __env, int __val) -- __attribute__ ((__noreturn__)); -- --/* Internal machine-dependent function to restore context sans signal mask. */ --extern void __v1__longjmp (__jmp_buf __env, int __val) -- __attribute__ ((__noreturn__)); -- --/* Internal function to possibly save the current mask of blocked signals -- in ENV, and always set the flag saying whether or not it was saved. -- This is used by the machine-dependent definition of `__sigsetjmp'. -- Always returns zero, for convenience. */ --extern int __v1__sigjmp_save (__v1__jmp_buf __env, int __savemask); -- --extern void _longjmp_unwind (__v1__jmp_buf env, int val); -- --extern void __v1__libc_siglongjmp (__v1__sigjmp_buf env, int val) -- __attribute__ ((noreturn)); -- --extern void __v1__libc_longjmp (__v1__sigjmp_buf env, int val) -- __attribute__ ((noreturn)); -- --libc_hidden_proto (__v1__libc_longjmp) --libc_hidden_proto (__v1_setjmp) --libc_hidden_proto (__v1__sigsetjmp) --#endif /* !_ASM */ -- --#endif /* ifndef _V1_SETJMP_H */ -Index: glibc-2.19/sysdeps/s390/v1-sigjmp.c -=================================================================== ---- glibc-2.19.orig/sysdeps/s390/v1-sigjmp.c -+++ /dev/null -@@ -1,44 +0,0 @@ --/* Copyright (C) 1992-2013 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 -- . -- -- Copied from setjmp/sigjmp.c for extending jmp_buf. */ -- --#include --#include -- --#if !defined NOT_IN_libc && defined SHARED --# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) --# include --# include --# include -- --/* This function is called by the `sigsetjmp' macro -- before doing a `__setjmp' on ENV[0].__jmpbuf. -- Always return zero. */ -- --int --__v1__sigjmp_save (__v1__sigjmp_buf env, int savemask) --{ -- env[0].__mask_was_saved = (savemask && -- __sigprocmask (SIG_BLOCK, (sigset_t *) NULL, -- &env[0].__saved_mask) == 0); -- -- return 0; --} -- --# endif /* SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_19) */ --#endif /* !NOT_IN_libc && SHARED */ -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/Makefile -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/Makefile -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/Makefile -@@ -16,9 +16,3 @@ endif - ifeq ($(subdir),elf) - sysdep_routines += dl-vdso - endif -- --ifeq ($(subdir),debug) --ifeq (yes,$(build-shared)) --sysdep_routines += v1-longjmp_chk --endif --endif -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/getcontext.S -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/getcontext.S -+++ /dev/null -@@ -1,38 +0,0 @@ --/* Extendible version of getcontext for System z -- Copyright (C) 2013 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 -- . */ -- --#include --#include -- --versioned_symbol (libc, __v2getcontext, getcontext, GLIBC_2_19) --#define __getcontext __v2getcontext -- --#include "getcontext-common.S" -- --#undef __getcontext -- --libc_hidden_ver (__v2getcontext, getcontext) -- --#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_19) --# define __V1_UCONTEXT --compat_symbol (libc, __v1getcontext, getcontext, GLIBC_2_1) --# define __getcontext __v1getcontext --# include "getcontext-common.S" --# undef __getcontext -- --#endif -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/longjmp_chk.c -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/longjmp_chk.c -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/longjmp_chk.c -@@ -15,30 +15,34 @@ - License along with the GNU C Library; if not, see - . - -- This is a copy of debug/longjmp_chk.c extended for symbol -- versioning. */ -+ Versioned copy of debug/longjmp_chk.c modified for versioning -+ the reverted jmpbuf extension. */ - - #include --#include - --/* This place is the only user of these functions. */ --extern void ____v2__longjmp_chk (__jmp_buf __env, int __val) -+#if !defined NOT_IN_libc && defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) -+/* this is a copy from debug/longjmp_chk.c because we need an unique name -+ for __longjmp_chk, but it is already named via a define -+ for __libc_siglongjmp in debug/longjmp_chk.c. */ -+# include -+ -+// XXX Should move to include/setjmp.h -+extern void ____longjmp_chk (__jmp_buf __env, int __val) - __attribute__ ((__noreturn__)); - --#if defined NOT_IN_libc -+# define __longjmp ____longjmp_chk -+# define __libc_siglongjmp __v1__longjmp_chk - --# define __v2__longjmp ____longjmp_chk --# define __v2__libc_siglongjmp __longjmp_chk -+# include - --# include -+/* In glibc release 2.19 a new versions of __longjmp_chk was introduced, -+ but was reverted before 2.20. Thus both versions are the same function. */ -+strong_alias (__v1__longjmp_chk, __v2__longjmp_chk); -+versioned_symbol (libc, __v1__longjmp_chk, __longjmp_chk, GLIBC_2_11); -+compat_symbol (libc, __v2__longjmp_chk, __longjmp_chk, GLIBC_2_19); - - #else - --# define __v2__longjmp ____v2__longjmp_chk --# define __v2__libc_siglongjmp __v2__libc_siglongjmp_chk -- --# include -- --versioned_symbol (libc, __v2__libc_siglongjmp_chk, __longjmp_chk, GLIBC_2_19); -+# include - - #endif -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/rtld-getcontext.S -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/rtld-getcontext.S -+++ /dev/null -@@ -1,19 +0,0 @@ --/* Copyright (C) 2013 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 -- . */ -- --/* Build a non-versioned object for rtld-*. */ --#include "getcontext-common.S" -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c -@@ -26,8 +26,8 @@ - #include - #include - #include --#include --#include -+ -+#define __longjmp ____longjmp_chk - - #define CHECK_SP(env, guard) \ - do \ -@@ -51,22 +51,4 @@ - } \ - } while (0) - -- --#if defined NOT_IN_libc --/* Build a non-versioned object for rtld-*. */ --# define __longjmp ____longjmp_chk --# include "__longjmp-common.c" -- --#else /* !NOT_IN_libc */ --# define __longjmp ____v2__longjmp_chk --# include "__longjmp-common.c" -- --# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_11, GLIBC_2_19) --# undef __longjmp --# define __V1_JMPBUF --# define __longjmp ____v1__longjmp_chk --# include "__longjmp-common.c" --# undef __longjmp -- --# endif --#endif /* !NOT_IN_libc */ -+#include "__longjmp.c" -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/getcontext-common.S -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-32/getcontext-common.S -+++ /dev/null -@@ -1,112 +0,0 @@ --/* Copyright (C) 2001-2014 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -- -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- The GNU C Library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, see -- . */ -- --#include --#include -- --#include "rtld-global-offsets.h" --#include "ucontext_i.h" -- --/* __getcontext (const ucontext_t *ucp) -- -- Saves the machine context in UCP such that when it is activated, -- it appears as if __getcontext() returned again. -- -- This implementation is intended to be used for *synchronous* context -- switches only. Therefore, it does not have to save anything -- other than the PRESERVED state. */ -- --ENTRY(__getcontext) -- lr %r1,%r2 -- -- /* rt_sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask, sigsetsize). */ -- la %r2,SIG_BLOCK -- slr %r3,%r3 -- la %r4,SC_MASK(%r1) -- lhi %r5,_NSIG8 -- svc SYS_ify(rt_sigprocmask) -- -- /* Store fpu context. */ -- stfpc SC_FPC(%r1) -- std %f0,SC_FPRS(%r1) -- std %f1,SC_FPRS+8(%r1) -- std %f2,SC_FPRS+16(%r1) -- std %f3,SC_FPRS+24(%r1) -- std %f4,SC_FPRS+32(%r1) -- std %f5,SC_FPRS+40(%r1) -- std %f6,SC_FPRS+48(%r1) -- std %f7,SC_FPRS+56(%r1) -- std %f8,SC_FPRS+64(%r1) -- std %f9,SC_FPRS+72(%r1) -- std %f10,SC_FPRS+80(%r1) -- std %f11,SC_FPRS+88(%r1) -- std %f12,SC_FPRS+96(%r1) -- std %f13,SC_FPRS+104(%r1) -- std %f14,SC_FPRS+112(%r1) -- std %f15,SC_FPRS+120(%r1) -- -- lhi %r2,0 --#ifndef __V1_UCONTEXT -- bras %r3,0f --# ifdef IS_IN_rtld -- /* Within ld.so we can do slightly better by addressing dl_hwap -- relative to GOT start. */ --1: .long _GLOBAL_OFFSET_TABLE_ - 1b -- .long C_SYMBOL_NAME(_rtld_global_ro)@GOTOFF --0: l %r4,0(%r3) -- la %r4,0(%r3,%r4) -- l %r5,4(%r3) -- /* _dl_hwcap is 64 bit and we need the lower 32. */ -- l %r3,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(%r4,%r5) --# elif PIC --1: .long _GLOBAL_OFFSET_TABLE_ - 1b -- .long C_SYMBOL_NAME(_rtld_global_ro)@GOT --0: l %r4,0(%r3) -- la %r4,0(%r3,%r4) /* GOT pointer -> r4 */ -- l %r5,4(%r3) /* GOT offset -> r5 */ -- l %r5,0(%r4,%r5) /* GOT slot -> r5 */ -- l %r3,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(%r5) --# else -- .long C_SYMBOL_NAME(_dl_hwcap) --0: l %r3,0(%r3) -- l %r3,0(%r3) --# endif -- tml %r3,512 /* HWCAP_S390_HIGH_GPRS */ -- jz 2f -- /* highgprs implies zarch so stmh/oill is ok here. */ -- .machine "z900" -- .machinemode "zarch_nohighgprs" -- stmh %r0,%r15,SC_HIGHGPRS(%r1) -- oill %r2,1 /* UCONTEXT_UC_FLAGS_HIGH_GPRS */ --#endif --2: st %r2,SC_FLGS(%r1) -- -- /* Set __getcontext return value to 0. */ -- slr %r2,%r2 -- -- /* Store access registers. */ -- stam %a0,%a15,SC_ACRS(%r1) -- -- /* Store general purpose registers. */ -- stm %r0,%r15,SC_GPRS(%r1) -- -- /* Return. */ -- br %r14 --END(__getcontext) -- --weak_alias (__getcontext, getcontext) -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S -@@ -0,0 +1,86 @@ -+/* Copyright (C) 2001-2014 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ -+#include -+#include -+ -+#include "ucontext_i.h" -+ -+#include -+ -+/* __getcontext (const ucontext_t *ucp) -+ -+ Saves the machine context in UCP such that when it is activated, -+ it appears as if __getcontext() returned again. -+ -+ This implementation is intended to be used for *synchronous* context -+ switches only. Therefore, it does not have to save anything -+ other than the PRESERVED state. */ -+ -+ENTRY(__getcontext) -+ lr %r1,%r2 -+ -+ /* rt_sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask, sigsetsize). */ -+ la %r2,SIG_BLOCK -+ slr %r3,%r3 -+ la %r4,SC_MASK(%r1) -+ lhi %r5,_NSIG8 -+ svc SYS_ify(rt_sigprocmask) -+ -+ /* Store fpu context. */ -+ stfpc SC_FPC(%r1) -+ std %f0,SC_FPRS(%r1) -+ std %f1,SC_FPRS+8(%r1) -+ std %f2,SC_FPRS+16(%r1) -+ std %f3,SC_FPRS+24(%r1) -+ std %f4,SC_FPRS+32(%r1) -+ std %f5,SC_FPRS+40(%r1) -+ std %f6,SC_FPRS+48(%r1) -+ std %f7,SC_FPRS+56(%r1) -+ std %f8,SC_FPRS+64(%r1) -+ std %f9,SC_FPRS+72(%r1) -+ std %f10,SC_FPRS+80(%r1) -+ std %f11,SC_FPRS+88(%r1) -+ std %f12,SC_FPRS+96(%r1) -+ std %f13,SC_FPRS+104(%r1) -+ std %f14,SC_FPRS+112(%r1) -+ std %f15,SC_FPRS+120(%r1) -+ -+ /* Set __getcontext return value to 0. */ -+ slr %r2,%r2 -+ -+ /* Store access registers. */ -+ stam %a0,%a15,SC_ACRS(%r1) -+ -+ /* Store general purpose registers. */ -+ stm %r0,%r15,SC_GPRS(%r1) -+ -+ /* Return. */ -+ br %r14 -+END(__getcontext) -+ -+weak_alias (__getcontext, getcontext) -+ -+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) -+/* In glibc release 2.19 a new version of getcontext was introduced, -+ but was reverted before 2.20. Thus both versions are the same function. */ -+weak_alias (__getcontext, __v1__getcontext) -+weak_alias (__getcontext, __v2__getcontext) -+versioned_symbol (libc, __v1__getcontext, getcontext, GLIBC_2_1) -+compat_symbol (libc, __v2__getcontext, getcontext, GLIBC_2_19) -+#endif -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist -@@ -1777,7 +1777,6 @@ GLIBC_2.18 - GLIBC_2.19 - GLIBC_2.19 A - __longjmp_chk F -- __setjmp F - __sigsetjmp F - _longjmp F - _setjmp F -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S -@@ -62,16 +62,8 @@ ENTRY(__setcontext) - /* Don't touch %a0, used for thread purposes. */ - lam %a1,%a15,SC_ACRS+4(%r1) - -- /* Restore the upper halfs if available. */ -- l %r2,SC_FLGS(%r1) -- tml %r2,1 /* UCONTEXT_UC_FLAGS_HIGH_GPRS */ -- jz 0f -- .machine "z900" -- .machinemode "zarch_nohighgprs" -- lmh %r0,%r15,SC_HIGHGPRS(%r1) -- - /* Load general purpose registers. */ --0: lm %r0,%r15,SC_GPRS(%r1) -+ lm %r0,%r15,SC_GPRS(%r1) - - /* Return. */ - br %r14 -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S -@@ -65,31 +65,19 @@ ENTRY(__swapcontext) - std %f14,SC_FPRS+112(%r1) - std %f15,SC_FPRS+120(%r1) - -- /* Store access registers. */ -- stam %a0,%a15,SC_ACRS(%r1) -- - /* Set __swapcontext return value to 0. */ - slr %r2,%r2 - -+ /* Store access registers. */ -+ stam %a0,%a15,SC_ACRS(%r1) -+ - /* Store general purpose registers. */ - stm %r0,%r15,SC_GPRS(%r1) - -- /* Copy uc_flags into the new ucontext_t. */ -+ /* sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL). */ -+ la %r2,SIG_BLOCK - lr %r5,%r0 -- l %r2,SC_FLGS(%r5) -- st %r2,SC_FLGS(%r1) -- -- /* Save/restore the upper halfs if necessary. */ -- tml %r2,1 /* UCONTEXT_UC_FLAGS_HIGH_GPRS */ -- jz 0f -- .machine "z900" -- .machinemode "zarch_nohighgprs" -- stmh %r0,%r15,SC_HIGHGPRS(%r1) -- lmh %r0,%r15,SC_HIGHGPRS(%r5) -- -- /* rt_sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL, sigsetsize). */ --0: la %r2,SIG_BLOCK -- la %r3,SC_MASK(%r5) -+ la %r3,SC_MASK(%r5) - slr %r4,%r4 - lhi %r5,_NSIG8 - svc SYS_ify(rt_sigprocmask) -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.sym -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-32/ucontext_i.sym -+++ /dev/null -@@ -1,26 +0,0 @@ --#include --#include --#include -- ---- -- --SIG_BLOCK --SIG_UNBLOCK --SIG_SETMASK -- --_NSIG8 (_NSIG / 8) -- --#define ucontext(member) offsetof (ucontext_t, member) --#define mcontext(member) ucontext (uc_mcontext.member) -- --SC_FLGS ucontext (uc_flags) --SC_LINK ucontext (uc_link) --SC_STCK ucontext (uc_stack.ss_sp) --SC_STSZ ucontext (uc_stack.ss_size) --SC_PSW mcontext (psw) --SC_GPRS mcontext (gregs) --SC_ACRS mcontext (aregs) --SC_FPC mcontext (fpregs.fpc) --SC_FPRS mcontext (fpregs.fprs) --SC_MASK ucontext (uc_sigmask) --SC_HIGHGPRS ucontext (uc_high_gprs) -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c -@@ -26,8 +26,8 @@ - #include - #include - #include --#include --#include -+ -+#define __longjmp ____longjmp_chk - - #define CHECK_SP(env, guard) \ - do \ -@@ -51,23 +51,4 @@ - } \ - } while (0) - -- --#if defined NOT_IN_libc --/* Build a non-versioned object for rtld-*. */ --# define __longjmp ____longjmp_chk --# include "__longjmp-common.c" -- --#else /* !NOT_IN_libc */ --# define __longjmp ____v2__longjmp_chk --# include "__longjmp-common.c" --# undef __longjmp -- --# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_11, GLIBC_2_19) --# undef __longjmp --# define __V1_JMPBUF --# define __longjmp ____v1__longjmp_chk --# include "__longjmp-common.c" --# undef __longjmp -- --# endif --#endif /* !NOT_IN_libc */ -+#include "__longjmp.c" -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-64/getcontext-common.S -+++ /dev/null -@@ -1,79 +0,0 @@ --/* Copyright (C) 2001-2014 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -- -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- The GNU C Library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, see -- . */ -- --#include --#include -- --#include "ucontext_i.h" -- --/* __getcontext (const ucontext_t *ucp) -- -- Saves the machine context in UCP such that when it is activated, -- it appears as if __getcontext() returned again. -- -- This implementation is intended to be used for *synchronous* context -- switches only. Therefore, it does not have to save anything -- other than the PRESERVED state. */ -- --ENTRY(__getcontext) -- lgr %r1,%r2 -- -- /* rt_sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask, sigsetsize). */ -- la %r2,SIG_BLOCK -- slgr %r3,%r3 -- la %r4,SC_MASK(%r1) -- lghi %r5,_NSIG8 -- svc SYS_ify(rt_sigprocmask) -- -- /* Store fpu context. */ -- stfpc SC_FPC(%r1) -- std %f0,SC_FPRS(%r1) -- std %f1,SC_FPRS+8(%r1) -- std %f2,SC_FPRS+16(%r1) -- std %f3,SC_FPRS+24(%r1) -- std %f4,SC_FPRS+32(%r1) -- std %f5,SC_FPRS+40(%r1) -- std %f6,SC_FPRS+48(%r1) -- std %f7,SC_FPRS+56(%r1) -- std %f8,SC_FPRS+64(%r1) -- std %f9,SC_FPRS+72(%r1) -- std %f10,SC_FPRS+80(%r1) -- std %f11,SC_FPRS+88(%r1) -- std %f12,SC_FPRS+96(%r1) -- std %f13,SC_FPRS+104(%r1) -- std %f14,SC_FPRS+112(%r1) -- std %f15,SC_FPRS+120(%r1) -- -- /* Set __getcontext return value to 0. */ -- slgr %r2,%r2 -- -- /* Store the version number into the uc_flags field. So far -- we do not make use of the reserved bytes so we store a zero. */ -- stg %r2,SC_FLGS(%r1) -- -- /* Store access registers. */ -- stam %a0,%a15,SC_ACRS(%r1) -- -- /* Store general purpose registers. */ -- stmg %r0,%r15,SC_GPRS(%r1) -- -- /* Return. */ -- br %r14 --END(__getcontext) -- --weak_alias (__getcontext, getcontext) -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S -@@ -0,0 +1,86 @@ -+/* Copyright (C) 2001-2014 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ -+#include -+#include -+ -+#include "ucontext_i.h" -+ -+#include -+ -+/* __getcontext (const ucontext_t *ucp) -+ -+ Saves the machine context in UCP such that when it is activated, -+ it appears as if __getcontext() returned again. -+ -+ This implementation is intended to be used for *synchronous* context -+ switches only. Therefore, it does not have to save anything -+ other than the PRESERVED state. */ -+ -+ENTRY(__getcontext) -+ lgr %r1,%r2 -+ -+ /* rt_sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask, sigsetsize). */ -+ la %r2,SIG_BLOCK -+ slgr %r3,%r3 -+ la %r4,SC_MASK(%r1) -+ lghi %r5,_NSIG8 -+ svc SYS_ify(rt_sigprocmask) -+ -+ /* Store fpu context. */ -+ stfpc SC_FPC(%r1) -+ std %f0,SC_FPRS(%r1) -+ std %f1,SC_FPRS+8(%r1) -+ std %f2,SC_FPRS+16(%r1) -+ std %f3,SC_FPRS+24(%r1) -+ std %f4,SC_FPRS+32(%r1) -+ std %f5,SC_FPRS+40(%r1) -+ std %f6,SC_FPRS+48(%r1) -+ std %f7,SC_FPRS+56(%r1) -+ std %f8,SC_FPRS+64(%r1) -+ std %f9,SC_FPRS+72(%r1) -+ std %f10,SC_FPRS+80(%r1) -+ std %f11,SC_FPRS+88(%r1) -+ std %f12,SC_FPRS+96(%r1) -+ std %f13,SC_FPRS+104(%r1) -+ std %f14,SC_FPRS+112(%r1) -+ std %f15,SC_FPRS+120(%r1) -+ -+ /* Set __getcontext return value to 0. */ -+ slgr %r2,%r2 -+ -+ /* Store access registers. */ -+ stam %a0,%a15,SC_ACRS(%r1) -+ -+ /* Store general purpose registers. */ -+ stmg %r0,%r15,SC_GPRS(%r1) -+ -+ /* Return. */ -+ br %r14 -+END(__getcontext) -+ -+weak_alias (__getcontext, getcontext) -+ -+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) -+/* In glibc release 2.19 a new version of getcontext was introduced, -+ but was reverted before 2.20. Thus both versions are the same function. */ -+weak_alias (__getcontext, __v1__getcontext) -+weak_alias (__getcontext, __v2__getcontext) -+versioned_symbol (libc, __v1__getcontext, getcontext, GLIBC_2_1) -+compat_symbol (libc, __v2__getcontext, getcontext, GLIBC_2_19) -+#endif -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist -@@ -98,7 +98,6 @@ GLIBC_2.18 - GLIBC_2.19 - GLIBC_2.19 A - __longjmp_chk F -- __setjmp F - __sigsetjmp F - _longjmp F - _setjmp F -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S -@@ -65,25 +65,21 @@ ENTRY(__swapcontext) - std %f14,SC_FPRS+112(%r1) - std %f15,SC_FPRS+120(%r1) - -+ /* Set __swapcontext return value to 0. */ -+ slgr %r2,%r2 -+ - /* Store access registers. */ - stam %a0,%a15,SC_ACRS(%r1) - -- /* Set __swapcontext return value to 0. */ -- slgr %r2,%r2 -- - /* Store general purpose registers. */ - stmg %r0,%r15,SC_GPRS(%r1) - -- /* Copy uc_flags into the new ucontext_t. */ -- lgr %r5,%r0 -- lg %r2,SC_FLGS(%r5) -- stg %r2,SC_FLGS(%r1) -- - /* rt_sigprocmask (SIG_SETMASK, &sc->sc_mask, NULL, sigsetsize). */ - la %r2,SIG_BLOCK -+ lgr %r5,%r0 - la %r3,SC_MASK(%r5) -- slgr %r4,%r4 - lghi %r5,_NSIG8 -+ slgr %r4,%r4 - svc SYS_ify(rt_sigprocmask) - - /* Load fpu context. */ -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/s390-64/ucontext_i.sym -+++ /dev/null -@@ -1,25 +0,0 @@ --#include --#include --#include -- ---- -- --SIG_BLOCK --SIG_UNBLOCK --SIG_SETMASK -- --_NSIG8 (_NSIG / 8) -- --#define ucontext(member) offsetof (ucontext_t, member) --#define mcontext(member) ucontext (uc_mcontext.member) -- --SC_FLGS ucontext (uc_flags) --SC_LINK ucontext (uc_link) --SC_STCK ucontext (uc_stack.ss_sp) --SC_STSZ ucontext (uc_stack.ss_size) --SC_PSW mcontext (psw) --SC_GPRS mcontext (gregs) --SC_ACRS mcontext (aregs) --SC_FPC mcontext (fpregs.fpc) --SC_FPRS mcontext (fpregs.fprs) --SC_MASK ucontext (uc_sigmask) -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/sys/ucontext.h -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/sys/ucontext.h -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/sys/ucontext.h -@@ -64,15 +64,6 @@ typedef struct - fpreg_t fprs[16]; - } fpregset_t; - --/* Bit is set if the uc_high_gprs field contains the upper halfs of -- the 64 bit general purpose registers. Since the uc_high_gprs field -- is only available in the 32 bit version of ucontext_t it will never -- be set for 64 bit. */ --#define UCONTEXT_UC_FLAGS_HIGH_GPRS (1UL << 0) -- --/* A new uc_flags constant will be defined when actually making use of -- the reserved space: UCONTEXT_UCFLAGS_RESERVED (1UL << 1). */ -- - /* Context to describe whole processor state. */ - typedef struct - { -@@ -90,10 +81,6 @@ struct ucontext - stack_t uc_stack; - mcontext_t uc_mcontext; - __sigset_t uc_sigmask; --#ifndef __s390x__ -- unsigned long uc_high_gprs[16]; --#endif -- char __reserved[512]; - }; - - -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/ucontext_i.sym -=================================================================== ---- /dev/null -+++ glibc-2.19/sysdeps/unix/sysv/linux/s390/ucontext_i.sym -@@ -0,0 +1,25 @@ -+#include -+#include -+#include -+ -+-- -+ -+SIG_BLOCK -+SIG_UNBLOCK -+SIG_SETMASK -+ -+_NSIG8 (_NSIG / 8) -+ -+#define ucontext(member) offsetof (ucontext_t, member) -+#define mcontext(member) ucontext (uc_mcontext.member) -+ -+SC_FLGS ucontext (uc_flags) -+SC_LINK ucontext (uc_link) -+SC_STCK ucontext (uc_stack.ss_sp) -+SC_STSZ ucontext (uc_stack.ss_size) -+SC_PSW mcontext (psw) -+SC_GPRS mcontext (gregs) -+SC_ACRS mcontext (aregs) -+SC_FPC mcontext (fpregs.fpc) -+SC_FPRS mcontext (fpregs.fprs) -+SC_MASK ucontext (uc_sigmask) -Index: glibc-2.19/sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c -=================================================================== ---- glibc-2.19.orig/sysdeps/unix/sysv/linux/s390/v1-longjmp_chk.c -+++ /dev/null -@@ -1,35 +0,0 @@ --/* Copyright (C) 2013 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 -- . -- -- This went into a separate source file since we would otherwise be -- needed to include two different versions of setjmp.h into the same -- file. */ -- --#include -- --#if !defined NOT_IN_libc && defined SHARED --# if SHLIB_COMPAT (libc, GLIBC_2_11, GLIBC_2_19) -- --# define __v1__longjmp ____v1__longjmp_chk --# define __v1__libc_siglongjmp __v1__libc_siglongjmp_chk -- --# include -- --compat_symbol (libc, __v1__libc_siglongjmp_chk, __longjmp_chk, GLIBC_2_11); -- --# endif --#endif diff --git a/setlocale-directory-traversal.patch b/setlocale-directory-traversal.patch deleted file mode 100644 index 599661c..0000000 --- a/setlocale-directory-traversal.patch +++ /dev/null @@ -1,648 +0,0 @@ -2014-07-02 Florian Weimer - - * manual/locale.texi (Locale Names): New section documenting - locale name syntax. Adjust menu and node chaining accordingly. - (Choosing Locale): Reference Locale Names, Locale Categories. - Mention setting LC_ALL=C. Reflect that name syntax is now - documented. - (Locale Categories): New section title. Reference Locale Names. - LC_ALL is an environment variable, but not a category. - (Setting the Locale): Remove "locale -a" invocation and LOCPATH - description, now in Locale Name. Reference that section. Locale - name syntax is now documented. - - [BZ #17137] - * locale/findlocale.c (name_present, valid_locale_name): New - functions. - (_nl_find_locale): Use the loc_name variable to store name - candidates. Call name_present and valid_locale_name to check and - validate locale names. Return an error if the locale is invalid. - - * localedata/tst-setlocale3.c: New file. - * localedata/Makefile (tests): Add tst-setlocale3. - (tst-setlocale3-ENV): New variable. - - * locale/setlocale.c (setlocale): Use strdup for allocating - composite name copy. - -Index: glibc-2.19/locale/findlocale.c -=================================================================== ---- glibc-2.19.orig/locale/findlocale.c -+++ glibc-2.19/locale/findlocale.c -@@ -17,6 +17,7 @@ - . */ - - #include -+#include - #include - #include - #include -@@ -57,6 +58,45 @@ struct loaded_l10nfile *_nl_locale_file_ - - const char _nl_default_locale_path[] attribute_hidden = LOCALEDIR; - -+/* Checks if the name is actually present, that is, not NULL and not -+ empty. */ -+static inline int -+name_present (const char *name) -+{ -+ return name != NULL && name[0] != '\0'; -+} -+ -+/* Checks that the locale name neither extremely long, nor contains a -+ ".." path component (to prevent directory traversal). */ -+static inline int -+valid_locale_name (const char *name) -+{ -+ /* Not set. */ -+ size_t namelen = strlen (name); -+ /* Name too long. The limit is arbitrary and prevents stack overflow -+ issues later. */ -+ if (__glibc_unlikely (namelen > 255)) -+ return 0; -+ /* Directory traversal attempt. */ -+ static const char slashdot[4] = {'/', '.', '.', '/'}; -+ if (__glibc_unlikely (memmem (name, namelen, -+ slashdot, sizeof (slashdot)) != NULL)) -+ return 0; -+ if (namelen == 2 && __glibc_unlikely (name[0] == '.' && name [1] == '.')) -+ return 0; -+ if (namelen >= 3 -+ && __glibc_unlikely (((name[0] == '.' -+ && name[1] == '.' -+ && name[2] == '/') -+ || (name[namelen - 3] == '/' -+ && name[namelen - 2] == '.' -+ && name[namelen - 1] == '.')))) -+ return 0; -+ /* If there is a slash in the name, it must start with one. */ -+ if (__glibc_unlikely (memchr (name, '/', namelen) != NULL) && name[0] != '/') -+ return 0; -+ return 1; -+} - - struct __locale_data * - internal_function -@@ -65,7 +105,7 @@ _nl_find_locale (const char *locale_path - { - int mask; - /* Name of the locale for this category. */ -- char *loc_name; -+ char *loc_name = (char *) *name; - const char *language; - const char *modifier; - const char *territory; -@@ -73,31 +113,39 @@ _nl_find_locale (const char *locale_path - const char *normalized_codeset; - struct loaded_l10nfile *locale_file; - -- if ((*name)[0] == '\0') -+ if (loc_name[0] == '\0') - { - /* The user decides which locale to use by setting environment - variables. */ -- *name = getenv ("LC_ALL"); -- if (*name == NULL || (*name)[0] == '\0') -- *name = getenv (_nl_category_names.str -+ loc_name = getenv ("LC_ALL"); -+ if (!name_present (loc_name)) -+ loc_name = getenv (_nl_category_names.str - + _nl_category_name_idxs[category]); -- if (*name == NULL || (*name)[0] == '\0') -- *name = getenv ("LANG"); -+ if (!name_present (loc_name)) -+ loc_name = getenv ("LANG"); -+ if (!name_present (loc_name)) -+ loc_name = (char *) _nl_C_name; - } - -- if (*name == NULL || (*name)[0] == '\0' -- || (__builtin_expect (__libc_enable_secure, 0) -- && strchr (*name, '/') != NULL)) -- *name = (char *) _nl_C_name; -+ /* We used to fall back to the C locale if the name contains a slash -+ character '/', but we now check for directory traversal in -+ valid_locale_name, so this is no longer necessary. */ - -- if (__builtin_expect (strcmp (*name, _nl_C_name), 1) == 0 -- || __builtin_expect (strcmp (*name, _nl_POSIX_name), 1) == 0) -+ if (__builtin_expect (strcmp (loc_name, _nl_C_name), 1) == 0 -+ || __builtin_expect (strcmp (loc_name, _nl_POSIX_name), 1) == 0) - { - /* We need not load anything. The needed data is contained in - the library itself. */ - *name = (char *) _nl_C_name; - return _nl_C[category]; - } -+ else if (!valid_locale_name (loc_name)) -+ { -+ __set_errno (EINVAL); -+ return NULL; -+ } -+ -+ *name = loc_name; - - /* We really have to load some data. First we try the archive, - but only if there was no LOCPATH environment variable specified. */ -Index: glibc-2.19/locale/setlocale.c -=================================================================== ---- glibc-2.19.orig/locale/setlocale.c -+++ glibc-2.19/locale/setlocale.c -@@ -272,6 +272,8 @@ setlocale (int category, const char *loc - of entries of the form `CATEGORY=VALUE'. */ - const char *newnames[__LC_LAST]; - struct __locale_data *newdata[__LC_LAST]; -+ /* Copy of the locale argument, for in-place splitting. */ -+ char *locale_copy = NULL; - - /* Set all name pointers to the argument name. */ - for (category = 0; category < __LC_LAST; ++category) -@@ -281,7 +283,13 @@ setlocale (int category, const char *loc - if (__builtin_expect (strchr (locale, ';') != NULL, 0)) - { - /* This is a composite name. Make a copy and split it up. */ -- char *np = strdupa (locale); -+ locale_copy = strdup (locale); -+ if (__glibc_unlikely (locale_copy == NULL)) -+ { -+ __libc_rwlock_unlock (__libc_setlocale_lock); -+ return NULL; -+ } -+ char *np = locale_copy; - char *cp; - int cnt; - -@@ -299,6 +307,7 @@ setlocale (int category, const char *loc - { - error_return: - __libc_rwlock_unlock (__libc_setlocale_lock); -+ free (locale_copy); - - /* Bogus category name. */ - ERROR_RETURN; -@@ -391,8 +400,9 @@ setlocale (int category, const char *loc - /* Critical section left. */ - __libc_rwlock_unlock (__libc_setlocale_lock); - -- /* Free the resources (the locale path variable). */ -+ /* Free the resources. */ - free (locale_path); -+ free (locale_copy); - - return composite; - } -Index: glibc-2.19/localedata/Makefile -=================================================================== ---- glibc-2.19.orig/localedata/Makefile -+++ glibc-2.19/localedata/Makefile -@@ -77,7 +77,7 @@ locale_test_suite := tst_iswalnum tst_is - - tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ - tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ -- tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 -+ tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 - tests-static = bug-setlocale1-static - tests += $(tests-static) - ifeq (yes,$(build-shared)) -@@ -292,6 +292,7 @@ bug-setlocale1-ARGS = -- $(host-test-pro - bug-setlocale1-static-ENV = $(bug-setlocale1-ENV) - bug-setlocale1-static-ARGS = $(bug-setlocale1-ARGS) - tst-setlocale2-ENV = LOCPATH=$(common-objpfx)localedata -+tst-setlocale3-ENV = LOCPATH=$(common-objpfx)localedata - - $(objdir)/iconvdata/gconv-modules: - $(MAKE) -C ../iconvdata subdir=iconvdata $@ -Index: glibc-2.19/localedata/tst-setlocale3.c -=================================================================== ---- /dev/null -+++ glibc-2.19/localedata/tst-setlocale3.c -@@ -0,0 +1,203 @@ -+/* Regression test for setlocale invalid environment variable handling. -+ Copyright (C) 2014 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 -+ . */ -+ -+#include -+#include -+#include -+#include -+ -+/* The result of setlocale may be overwritten by subsequent calls, so -+ this wrapper makes a copy. */ -+static char * -+setlocale_copy (int category, const char *locale) -+{ -+ const char *result = setlocale (category, locale); -+ if (result == NULL) -+ return NULL; -+ return strdup (result); -+} -+ -+static char *de_locale; -+ -+static void -+setlocale_fail (const char *envstring) -+{ -+ setenv ("LC_CTYPE", envstring, 1); -+ if (setlocale (LC_CTYPE, "") != NULL) -+ { -+ printf ("unexpected setlocale success for \"%s\" locale\n", envstring); -+ exit (1); -+ } -+ const char *newloc = setlocale (LC_CTYPE, NULL); -+ if (strcmp (newloc, de_locale) != 0) -+ { -+ printf ("failed setlocale call \"%s\" changed locale to \"%s\"\n", -+ envstring, newloc); -+ exit (1); -+ } -+} -+ -+static void -+setlocale_success (const char *envstring) -+{ -+ setenv ("LC_CTYPE", envstring, 1); -+ char *newloc = setlocale_copy (LC_CTYPE, ""); -+ if (newloc == NULL) -+ { -+ printf ("setlocale for \"%s\": %m\n", envstring); -+ exit (1); -+ } -+ if (strcmp (newloc, de_locale) == 0) -+ { -+ printf ("setlocale with LC_CTYPE=\"%s\" left locale at \"%s\"\n", -+ envstring, de_locale); -+ exit (1); -+ } -+ if (setlocale (LC_CTYPE, de_locale) == NULL) -+ { -+ printf ("restoring locale \"%s\" with LC_CTYPE=\"%s\": %m\n", -+ de_locale, envstring); -+ exit (1); -+ } -+ char *newloc2 = setlocale_copy (LC_CTYPE, newloc); -+ if (newloc2 == NULL) -+ { -+ printf ("restoring locale \"%s\" following \"%s\": %m\n", -+ newloc, envstring); -+ exit (1); -+ } -+ if (strcmp (newloc, newloc2) != 0) -+ { -+ printf ("representation of locale \"%s\" changed from \"%s\" to \"%s\"", -+ envstring, newloc, newloc2); -+ exit (1); -+ } -+ free (newloc); -+ free (newloc2); -+ -+ if (setlocale (LC_CTYPE, de_locale) == NULL) -+ { -+ printf ("restoring locale \"%s\" with LC_CTYPE=\"%s\": %m\n", -+ de_locale, envstring); -+ exit (1); -+ } -+} -+ -+/* Checks that a known-good locale still works if LC_ALL contains a -+ value which should be ignored. */ -+static void -+setlocale_ignore (const char *to_ignore) -+{ -+ const char *fr_locale = "fr_FR.UTF-8"; -+ setenv ("LC_CTYPE", fr_locale, 1); -+ char *expected_locale = setlocale_copy (LC_CTYPE, ""); -+ if (expected_locale == NULL) -+ { -+ printf ("setlocale with LC_CTYPE=\"%s\" failed: %m\n", fr_locale); -+ exit (1); -+ } -+ if (setlocale (LC_CTYPE, de_locale) == NULL) -+ { -+ printf ("failed to restore locale: %m\n"); -+ exit (1); -+ } -+ unsetenv ("LC_CTYPE"); -+ -+ setenv ("LC_ALL", to_ignore, 1); -+ setenv ("LC_CTYPE", fr_locale, 1); -+ const char *actual_locale = setlocale (LC_CTYPE, ""); -+ if (actual_locale == NULL) -+ { -+ printf ("setlocale with LC_ALL, LC_CTYPE=\"%s\" failed: %m\n", -+ fr_locale); -+ exit (1); -+ } -+ if (strcmp (actual_locale, expected_locale) != 0) -+ { -+ printf ("setlocale under LC_ALL failed: got \"%s\", expected \"%s\"\n", -+ actual_locale, expected_locale); -+ exit (1); -+ } -+ unsetenv ("LC_CTYPE"); -+ setlocale_success (fr_locale); -+ unsetenv ("LC_ALL"); -+ free (expected_locale); -+} -+ -+static int -+do_test (void) -+{ -+ /* The glibc test harness sets this environment variable -+ uncondionally. */ -+ unsetenv ("LC_ALL"); -+ -+ de_locale = setlocale_copy (LC_CTYPE, "de_DE.UTF-8"); -+ if (de_locale == NULL) -+ { -+ printf ("setlocale (LC_CTYPE, \"de_DE.UTF-8\"): %m\n"); -+ return 1; -+ } -+ setlocale_success ("C"); -+ setlocale_success ("en_US.UTF-8"); -+ setlocale_success ("/en_US.UTF-8"); -+ setlocale_success ("//en_US.UTF-8"); -+ setlocale_ignore (""); -+ -+ setlocale_fail ("does-not-exist"); -+ setlocale_fail ("/"); -+ setlocale_fail ("/../localedata/en_US.UTF-8"); -+ setlocale_fail ("en_US.UTF-8/"); -+ setlocale_fail ("en_US.UTF-8/.."); -+ setlocale_fail ("en_US.UTF-8/../en_US.UTF-8"); -+ setlocale_fail ("../localedata/en_US.UTF-8"); -+ { -+ size_t large_length = 1024; -+ char *large_name = malloc (large_length + 1); -+ if (large_name == NULL) -+ { -+ puts ("malloc failure"); -+ return 1; -+ } -+ memset (large_name, '/', large_length); -+ const char *suffix = "en_US.UTF-8"; -+ strcpy (large_name + large_length - strlen (suffix), suffix); -+ setlocale_fail (large_name); -+ free (large_name); -+ } -+ { -+ size_t huge_length = 64 * 1024 * 1024; -+ char *huge_name = malloc (huge_length + 1); -+ if (huge_name == NULL) -+ { -+ puts ("malloc failure"); -+ return 1; -+ } -+ memset (huge_name, 'X', huge_length); -+ huge_name[huge_length] = '\0'; -+ /* Construct a composite locale specification. */ -+ const char *prefix = "LC_CTYPE=de_DE.UTF-8;LC_TIME="; -+ memcpy (huge_name, prefix, strlen (prefix)); -+ setlocale_fail (huge_name); -+ free (huge_name); -+ } -+ -+ return 0; -+} -+ -+#define TEST_FUNCTION do_test () -+#include "../test-skeleton.c" -Index: glibc-2.19/manual/locale.texi -=================================================================== ---- glibc-2.19.orig/manual/locale.texi -+++ glibc-2.19/manual/locale.texi -@@ -29,6 +29,7 @@ will follow the conventions preferred by - * Setting the Locale:: How a program specifies the locale - with library functions. - * Standard Locales:: Locale names available on all systems. -+* Locale Names:: Format of system-specific locale names. - * Locale Information:: How to access the information for the locale. - * Formatting Numbers:: A dedicated function to format numbers. - * Yes-or-No Questions:: Check a Response against the locale. -@@ -99,14 +100,16 @@ locale named @samp{espana-castellano} to - most of Spain. - - The set of locales supported depends on the operating system you are --using, and so do their names. We can't make any promises about what --locales will exist, except for one standard locale called @samp{C} or --@samp{POSIX}. Later we will describe how to construct locales. --@comment (@pxref{Building Locale Files}). -+using, and so do their names, except that the standard locale called -+@samp{C} or @samp{POSIX} always exist. @xref{Locale Names}. -+ -+In order to force the system to always use the default locale, the -+user can set the @code{LC_ALL} environment variable to @samp{C}. - - @cindex combining locales --A user also has the option of specifying different locales for different --purposes---in effect, choosing a mixture of multiple locales. -+A user also has the option of specifying different locales for -+different purposes---in effect, choosing a mixture of multiple -+locales. @xref{Locale Categories}. - - For example, the user might specify the locale @samp{espana-castellano} - for most purposes, but specify the locale @samp{usa-english} for -@@ -120,7 +123,7 @@ which locales apply. However, the user - for a particular subset of those purposes. - - @node Locale Categories, Setting the Locale, Choosing Locale, Locales --@section Categories of Activities that Locales Affect -+@section Locale Categories - @cindex categories for locales - @cindex locale categories - -@@ -128,7 +131,11 @@ The purposes that locales serve are grou - that a user or a program can choose the locale for each category - independently. Here is a table of categories; each name is both an - environment variable that a user can set, and a macro name that you can --use as an argument to @code{setlocale}. -+use as the first argument to @code{setlocale}. -+ -+The contents of the environment variable (or the string in the second -+argument to @code{setlocale}) has to be a valid locale name. -+@xref{Locale Names}. - - @vtable @code - @comment locale.h -@@ -172,7 +179,7 @@ for affirmative and negative responses. - @comment locale.h - @comment ISO - @item LC_ALL --This is not an environment variable; it is only a macro that you can use -+This is not a category; it is only a macro that you can use - with @code{setlocale} to set a single locale for all purposes. Setting - this environment variable overwrites all selections by the other - @code{LC_*} variables or @code{LANG}. -@@ -355,13 +362,7 @@ The symbols in this section are defined - @c strndup @ascuheap @acsmem - @c strcasecmp_l ok (C locale) - The function @code{setlocale} sets the current locale for category --@var{category} to @var{locale}. A list of all the locales the system --provides can be created by running -- --@pindex locale --@smallexample -- locale -a --@end smallexample -+@var{category} to @var{locale}. - - If @var{category} is @code{LC_ALL}, this specifies the locale for all - purposes. The other possible values of @var{category} specify an -@@ -386,10 +387,9 @@ is passed in as @var{locale} parameter. - - When you read the current locale for category @code{LC_ALL}, the value - encodes the entire combination of selected locales for all categories. --In this case, the value is not just a single locale name. In fact, we --don't make any promises about what it looks like. But if you specify --the same ``locale name'' with @code{LC_ALL} in a subsequent call to --@code{setlocale}, it restores the same combination of locale selections. -+If you specify the same ``locale name'' with @code{LC_ALL} in a -+subsequent call to @code{setlocale}, it restores the same combination -+of locale selections. - - To be sure you can use the returned string encoding the currently selected - locale at a later time, you must make a copy of the string. It is not -@@ -405,20 +405,15 @@ for @var{category}. - If a nonempty string is given for @var{locale}, then the locale of that - name is used if possible. - -+The effective locale name (either the second argument to -+@code{setlocale}, or if the argument is an empty string, the name -+obtained from the process environment) must be valid locale name. -+@xref{Locale Names}. -+ - If you specify an invalid locale name, @code{setlocale} returns a null - pointer and leaves the current locale unchanged. - @end deftypefun - --The path used for finding locale data can be set using the --@code{LOCPATH} environment variable. The default path for finding --locale data is system specific. It is computed from the value given --as the prefix while configuring the C library. This value normally is --@file{/usr} or @file{/}. For the former the complete path is: -- --@smallexample --/usr/lib/locale --@end smallexample -- - Here is an example showing how you might use @code{setlocale} to - temporarily switch to a new locale. - -@@ -458,7 +453,7 @@ locale categories, and future versions o - portability, assume that any symbol beginning with @samp{LC_} might be - defined in @file{locale.h}. - --@node Standard Locales, Locale Information, Setting the Locale, Locales -+@node Standard Locales, Locale Names, Setting the Locale, Locales - @section Standard Locales - - The only locale names you can count on finding on all operating systems -@@ -492,7 +487,94 @@ with the environment, rather than trying - locale explicitly by name. Remember, different machines might have - different sets of locales installed. - --@node Locale Information, Formatting Numbers, Standard Locales, Locales -+@node Locale Names, Locale Information, Standard Locales, Locales -+@section Locale Names -+ -+The following command prints a list of locales supported by the -+system: -+ -+@pindex locale -+@smallexample -+ locale -a -+@end smallexample -+ -+@strong{Portability Note:} With the notable exception of the standard -+locale names @samp{C} and @samp{POSIX}, locale names are -+system-specific. -+ -+Most locale names follow XPG syntax and consist of up to four parts: -+ -+@smallexample -+@var{language}[_@var{territory}[.@var{codeset}]][@@@var{modifier}] -+@end smallexample -+ -+Beside the first part, all of them are allowed to be missing. If the -+full specified locale is not found, less specific ones are looked for. -+The various parts will be stripped off, in the following order: -+ -+@enumerate -+@item -+codeset -+@item -+normalized codeset -+@item -+territory -+@item -+modifier -+@end enumerate -+ -+For example, the locale name @samp{de_AT.iso885915@@euro} denotes a -+German-language locale for use in Austria, using the ISO-8859-15 -+(Latin-9) character set, and with the Euro as the currency symbol. -+ -+In addition to locale names which follow XPG syntax, systems may -+provide aliases such as @samp{german}. Both categories of names must -+not contain the slash character @samp{/}. -+ -+If the locale name starts with a slash @samp{/}, it is treated as a -+path relative to the configured locale directories; see @code{LOCPATH} -+below. The specified path must not contain a component @samp{..}, or -+the name is invalid, and @code{setlocale} will fail. -+ -+@strong{Portability Note:} POSIX suggests that if a locale name starts -+with a slash @samp{/}, it is resolved as an absolute path. However, -+@theglibc{} treats it as a relative path under the directories listed -+in @code{LOCPATH} (or the default locale directory if @code{LOCPATH} -+is unset). -+ -+Locale names which are longer than an implementation-defined limit are -+invalid and cause @code{setlocale} to fail. -+ -+As a special case, locale names used with @code{LC_ALL} can combine -+several locales, reflecting different locale settings for different -+categories. For example, you might want to use a U.S. locale with ISO -+A4 paper format, so you set @code{LANG} to @samp{en_US.UTF-8}, and -+@code{LC_PAPER} to @samp{de_DE.UTF-8}. In this case, the -+@code{LC_ALL}-style combined locale name is -+ -+@smallexample -+LC_CTYPE=en_US.UTF-8;LC_TIME=en_US.UTF-8;LC_PAPER=de_DE.UTF-8;@dots{} -+@end smallexample -+ -+followed by other category settings not shown here. -+ -+@vindex LOCPATH -+The path used for finding locale data can be set using the -+@code{LOCPATH} environment variable. This variable lists the -+directories in which to search for locale definitions, separated by a -+colon @samp{:}. -+ -+The default path for finding locale data is system specific. A typical -+value for the @code{LOCPATH} default is: -+ -+@smallexample -+/usr/share/locale -+@end smallexample -+ -+The value of @code{LOCPATH} is ignored by privileged programs for -+security reasons, and only the default directory is used. -+ -+@node Locale Information, Formatting Numbers, Locale Names, Locales - @section Accessing Locale Information - - There are several ways to access locale information. The simplest diff --git a/sin-sign.patch b/sin-sign.patch deleted file mode 100644 index 0f001c3..0000000 --- a/sin-sign.patch +++ /dev/null @@ -1,54 +0,0 @@ -Index: glibc-2.19/sysdeps/ieee754/dbl-64/s_sin.c -=================================================================== ---- glibc-2.19.orig/sysdeps/ieee754/dbl-64/s_sin.c -+++ glibc-2.19/sysdeps/ieee754/dbl-64/s_sin.c -@@ -447,19 +447,21 @@ __sin (double x) - } - else - { -+ double t; - if (a > 0) - { - m = 1; -+ t = a; - db = da; - } - else - { - m = 0; -- a = -a; -+ t = -a; - db = -da; - } -- u.x = big + a; -- y = a - (u.x - big); -+ u.x = big + t; -+ y = t - (u.x - big); - res = do_sin (u, y, db, &cor); - cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps; - retval = ((res == res + cor) ? ((m) ? res : -res) -@@ -671,19 +673,21 @@ __cos (double x) - } - else - { -+ double t; - if (a > 0) - { - m = 1; -+ t = a; - db = da; - } - else - { - m = 0; -- a = -a; -+ t = -a; - db = -da; - } -- u.x = big + a; -- y = a - (u.x - big); -+ u.x = big + t; -+ y = t - (u.x - big); - res = do_sin (u, y, db, &cor); - cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps; - retval = ((res == res + cor) ? ((m) ? res : -res)