# HG changeset patch # User Aleksej Bobylev # Date 1482741388 -7200 # Node ID 12dc3b9e499da4977ca6825e66837ba0ac67e0a7 # Parent 6b0977689017d994bcb01b60fd64b369446e08c7 glibc: fix build. diff -r 6b0977689017 -r 12dc3b9e499d glibc/receipt --- a/glibc/receipt Mon Dec 26 01:30:19 2016 +0200 +++ b/glibc/receipt Mon Dec 26 10:36:28 2016 +0200 @@ -74,6 +74,8 @@ # Glibc FHS Patch - LFS 7.10 patch -p1 -i $stuff/glibc-2.24-fhs-1.patch + # Remove restricted '\v' from po files + patch -p1 -i $stuff/glibc-po.patch { mkdir build @@ -101,7 +103,7 @@ comp_summary "$time0" "$time1" "$size0" "$size1" # If temporary toolchain was previously used, switch to regular toolchain. - if [ ! -d /tools ]; then + if [ -d /tools ]; then mv /tools/bin/ld /tools/bin/ld-old mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old mv /tools/bin/ld-new /tools/bin/ld diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-2.13-gcc_fix-1.patch --- a/glibc/stuff/glibc-2.13-gcc_fix-1.patch Mon Dec 26 01:30:19 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -Submitted By: Matt Burgess -Date: 2010-04-18 -Initial Package Version: 2.11.1 -Upstream Status: Not Submitted -Origin: http://www.eglibc.org/archives/patches/msg00073.html -Description: Fixes the following build problem with GCC-4.5.0: - -/mnt/lfs/sources/libc-build/math/s_frexp.os.dt -MT /mnt/lfs/sources/libc-build/math/s_frexp.os -./sysdeps/i386/fpu/s_frexp.S: Assembler messages: -./sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef" -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.' -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' -./sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive -./sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if" -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression -make[2]: *** [/mnt/lfs/sources/libc-build/math/s_frexp.os] Error 1 - -diff -Naur glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c ---- glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 20:10:20.000000000 +0000 -+++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-04-17 11:34:06.882681001 +0000 -@@ -45,6 +45,11 @@ - /* Embed an #include to pull in the alignment and .end directives. */ - asm ("\n#include \"defs.h\""); - -+asm ("\n#if defined __i686 && defined __ASSEMBLER__"); -+asm ("\n#undef __i686"); -+asm ("\n#define __i686 __i686"); -+asm ("\n#endif"); -+ - /* The initial common code ends here. */ - asm ("\n/*@HEADER_ENDS*/"); - -diff -Naur glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h ---- glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 20:10:20.000000000 +0000 -+++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-04-17 11:34:06.882681001 +0000 -@@ -29,6 +29,10 @@ - #include - #include - -+#if defined __i686 && defined __ASSEMBLER__ -+#undef __i686 -+#define __i686 __i686 -+#endif - - /* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-2.14-reexport-rpc-interface.patch --- a/glibc/stuff/glibc-2.14-reexport-rpc-interface.patch Mon Dec 26 01:30:19 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -diff --git a/include/libc-symbols.h b/include/libc-symbols.h -index 67e1ca2..5e7cca5 100644 ---- a/include/libc-symbols.h -+++ b/include/libc-symbols.h -@@ -635,7 +635,7 @@ for linking") - # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) - # define libc_hidden_def(name) hidden_def (name) - # define libc_hidden_weak(name) hidden_weak (name) --# define libc_hidden_nolink(name, version) hidden_nolink (name, libc, version) -+# define libc_hidden_nolink(name, version) hidden_def (name) - # define libc_hidden_ver(local, name) hidden_ver (local, name) - # define libc_hidden_data_def(name) hidden_data_def (name) - # define libc_hidden_data_weak(name) hidden_data_weak (name) -diff --git a/sunrpc/Makefile b/sunrpc/Makefile -index 5134ce9..40c73d1 100644 ---- a/sunrpc/Makefile -+++ b/sunrpc/Makefile -@@ -53,7 +53,7 @@ headers-in-tirpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \ - des_crypt.h) - headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \ - $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h --headers = rpc/netdb.h -+headers = rpc/netdb.h $(headers-in-tirpc) $(headers-not-in-tirpc) - install-others = $(inst_sysconfdir)/rpc - generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \ - $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-2.14-reinstall-nis-rpc-headers.patch --- a/glibc/stuff/glibc-2.14-reinstall-nis-rpc-headers.patch Mon Dec 26 01:30:19 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -From bdd816a366c4e5bba5de7157d948e0c0737fb4fb Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Tue, 17 May 2011 17:42:30 +0200 -Subject: [PATCH] Reinstall NIS RPC headers - ---- - nis/Makefile | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/nis/Makefile b/nis/Makefile -index b5c9609..d2934d9 100644 ---- a/nis/Makefile -+++ b/nis/Makefile -@@ -23,9 +23,9 @@ subdir := nis - - aux := nis_hash - -+headers := $(wildcard rpcsvc/*.[hx]) - distribute := nss-nis.h nss-nisplus.h nis_intern.h Banner \ -- nisplus-parser.h nis_xdr.h nss \ -- $(wildcard rpcsvc/*.[hx]) -+ nisplus-parser.h nis_xdr.h nss - - # These are the databases available for the nis (and perhaps later nisplus) - # service. This must be a superset of the services in nss. --- -1.7.5.4 - diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-2.14-revert-4768ae77.patch --- a/glibc/stuff/glibc-2.14-revert-4768ae77.patch Mon Dec 26 01:30:19 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -diff -Naur glibc-orig//resolv/res_send.c glibc/resolv/res_send.c ---- glibc-orig//resolv/res_send.c 2011-06-10 18:59:03.041436996 +1000 -+++ glibc/resolv/res_send.c 2011-06-10 19:08:09.379309323 +1000 -@@ -549,7 +549,7 @@ - ns, ansp, ansp2, nansp2, resplen2); - if (n < 0) - return (-1); -- if (n == 0 && (buf2 == NULL || *resplen2 == 0)) -+ if (n == 0) - goto next_ns; - } else { - /* Use datagrams. */ -@@ -559,7 +559,7 @@ - ansp2, nansp2, resplen2); - if (n < 0) - return (-1); -- if (n == 0 && (buf2 == NULL || *resplen2 == 0)) -+ if (n == 0) - goto next_ns; - if (v_circuit) - // XXX Check whether both requests failed or -@@ -1275,14 +1275,10 @@ - (*thisresplenp > *thisanssizp) - ? *thisanssizp : *thisresplenp); - -- if (recvresp1 || (buf2 != NULL && recvresp2)) { -- *resplen2 = 0; -+ if (recvresp1 || (buf2 != NULL && recvresp2)) - return resplen; -- } - if (buf2 != NULL) - { -- /* No data from the first reply. */ -- resplen = 0; - /* We are waiting for a possible second reply. */ - if (hp->id == anhp->id) - recvresp1 = 1; diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-2.14.1-CVE-2015-0235.patch --- a/glibc/stuff/glibc-2.14.1-CVE-2015-0235.patch Mon Dec 26 01:30:19 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -CVE-2015-0235 GHOST -From https://sourceware.org/git/?p=glibc.git;a=commit;h=d5dd6189d506068ed11c8bfa1e1e9bffde04decd ---- glibc-2.14.1/nss/digits_dots.c -+++ glibc-2.14.1/nss/digits_dots.c -@@ -47,7 +47,10 @@ - { - if (h_errnop) - *h_errnop = NETDB_INTERNAL; -- *result = NULL; -+ if (buffer_size == NULL) -+ *status = NSS_STATUS_TRYAGAIN; -+ else -+ *result = NULL; - return -1; - } - -@@ -84,14 +87,16 @@ - } - - size_needed = (sizeof (*host_addr) -- + sizeof (*h_addr_ptrs) + strlen (name) + 1); -+ + sizeof (*h_addr_ptrs) -+ + sizeof (*h_alias_ptr) + strlen (name) + 1); - - if (buffer_size == NULL) - { - if (buflen < size_needed) - { -+ *status = NSS_STATUS_TRYAGAIN; - if (h_errnop != NULL) -- *h_errnop = TRY_AGAIN; -+ *h_errnop = NETDB_INTERNAL; - __set_errno (ERANGE); - goto done; - } -@@ -110,7 +115,7 @@ - *buffer_size = 0; - __set_errno (save); - if (h_errnop != NULL) -- *h_errnop = TRY_AGAIN; -+ *h_errnop = NETDB_INTERNAL; - *result = NULL; - goto done; - } -@@ -150,7 +155,9 @@ - if (! ok) - { - *h_errnop = HOST_NOT_FOUND; -- if (buffer_size) -+ if (buffer_size == NULL) -+ *status = NSS_STATUS_NOTFOUND; -+ else - *result = NULL; - goto done; - } -@@ -202,15 +209,6 @@ - - if ((isxdigit (name[0]) && strchr (name, ':') != NULL) || name[0] == ':') - { -- const char *cp; -- char *hostname; -- typedef unsigned char host_addr_t[16]; -- host_addr_t *host_addr; -- typedef char *host_addr_list_t[2]; -- host_addr_list_t *h_addr_ptrs; -- size_t size_needed; -- int addr_size; -- - switch (af) - { - default: -@@ -226,7 +224,10 @@ - /* This is not possible. We cannot represent an IPv6 address - in an `struct in_addr' variable. */ - *h_errnop = HOST_NOT_FOUND; -- *result = NULL; -+ if (buffer_size == NULL) -+ *status = NSS_STATUS_NOTFOUND; -+ else -+ *result = NULL; - goto done; - - case AF_INET6: -@@ -234,42 +235,6 @@ - break; - } - -- size_needed = (sizeof (*host_addr) -- + sizeof (*h_addr_ptrs) + strlen (name) + 1); -- -- if (buffer_size == NULL && buflen < size_needed) -- { -- if (h_errnop != NULL) -- *h_errnop = TRY_AGAIN; -- __set_errno (ERANGE); -- goto done; -- } -- else if (buffer_size != NULL && *buffer_size < size_needed) -- { -- char *new_buf; -- *buffer_size = size_needed; -- new_buf = realloc (*buffer, *buffer_size); -- -- if (new_buf == NULL) -- { -- save = errno; -- free (*buffer); -- __set_errno (save); -- *buffer = NULL; -- *buffer_size = 0; -- *result = NULL; -- goto done; -- } -- *buffer = new_buf; -- } -- -- memset (*buffer, '\0', size_needed); -- -- host_addr = (host_addr_t *) *buffer; -- h_addr_ptrs = (host_addr_list_t *) -- ((char *) host_addr + sizeof (*host_addr)); -- hostname = (char *) h_addr_ptrs + sizeof (*h_addr_ptrs); -- - for (cp = name;; ++cp) - { - if (!*cp) -@@ -282,7 +247,9 @@ - if (inet_pton (AF_INET6, name, host_addr) <= 0) - { - *h_errnop = HOST_NOT_FOUND; -- if (buffer_size) -+ if (buffer_size == NULL) -+ *status = NSS_STATUS_NOTFOUND; -+ else - *result = NULL; - goto done; - } ---- glibc-2.14.1/nss/getXXbyYY_r.c -+++ glibc-2.14.1/nss/getXXbyYY_r.c -@@ -180,6 +180,9 @@ - case -1: - return errno; - case 1: -+#ifdef NEED_H_ERRNO -+ any_service = true; -+#endif - goto done; - } - #endif diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-2.14.1-fixes-1.patch --- a/glibc/stuff/glibc-2.14.1-fixes-1.patch Mon Dec 26 01:30:19 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -Submitted By: Matt Burgess -Date: 2011-10-07 -Initial Package Version: 2.14.1 -Upstream Status: From upstream -Origin: Matt Burgess -Description: Fixes Firefox crashes and a bug when programs link to - SDL. - -diff -Naur glibc-2.14.1.orig/elf/dl-close.c glibc-2.14.1/elf/dl-close.c ---- glibc-2.14.1.orig/elf/dl-close.c 2011-10-07 09:48:55.000000000 +0000 -+++ glibc-2.14.1/elf/dl-close.c 2011-10-07 19:43:10.346411120 +0000 -@@ -119,17 +119,8 @@ - if (map->l_direct_opencount > 0 || map->l_type != lt_loaded - || dl_close_state != not_pending) - { -- if (map->l_direct_opencount == 0) -- { -- if (map->l_type == lt_loaded) -- dl_close_state = rerun; -- else if (map->l_type == lt_library) -- { -- struct link_map **oldp = map->l_initfini; -- map->l_initfini = map->l_orig_initfini; -- _dl_scope_free (oldp); -- } -- } -+ if (map->l_direct_opencount == 0 && map->l_type == lt_loaded) -+ dl_close_state = rerun; - - /* There are still references to this object. Do nothing more. */ - if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)) -diff -Naur glibc-2.14.1.orig/elf/dl-deps.c glibc-2.14.1/elf/dl-deps.c ---- glibc-2.14.1.orig/elf/dl-deps.c 2011-10-07 09:48:55.000000000 +0000 -+++ glibc-2.14.1/elf/dl-deps.c 2011-10-07 19:43:10.348432639 +0000 -@@ -478,6 +478,7 @@ - nneeded * sizeof needed[0]); - atomic_write_barrier (); - l->l_initfini = l_initfini; -+ l->l_free_initfini = 1; - } - - /* If we have no auxiliary objects just go on to the next map. */ -@@ -678,6 +679,7 @@ - l_initfini[nlist] = NULL; - atomic_write_barrier (); - map->l_initfini = l_initfini; -+ map->l_free_initfini = 1; - if (l_reldeps != NULL) - { - atomic_write_barrier (); -@@ -686,7 +688,7 @@ - _dl_scope_free (old_l_reldeps); - } - if (old_l_initfini != NULL) -- map->l_orig_initfini = old_l_initfini; -+ _dl_scope_free (old_l_initfini); - - if (errno_reason) - _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname, -diff -Naur glibc-2.14.1.orig/elf/dl-libc.c glibc-2.14.1/elf/dl-libc.c ---- glibc-2.14.1.orig/elf/dl-libc.c 2011-10-07 09:48:55.000000000 +0000 -+++ glibc-2.14.1/elf/dl-libc.c 2011-10-07 19:43:10.352411141 +0000 -@@ -279,6 +279,10 @@ - if (! old->dont_free) - free (old); - } -+ -+ /* Free the initfini dependency list. */ -+ if (l->l_free_initfini) -+ free (l->l_initfini); - } - - if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0 -diff -Naur glibc-2.14.1.orig/elf/rtld.c glibc-2.14.1/elf/rtld.c ---- glibc-2.14.1.orig/elf/rtld.c 2011-10-07 09:48:55.000000000 +0000 -+++ glibc-2.14.1/elf/rtld.c 2011-10-07 19:43:10.355406263 +0000 -@@ -2263,6 +2263,7 @@ - lnp->dont_free = 1; - lnp = lnp->next; - } -+ l->l_free_initfini = 0; - - if (l != &GL(dl_rtld_map)) - _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0, -diff -Naur glibc-2.14.1.orig/include/link.h glibc-2.14.1/include/link.h ---- glibc-2.14.1.orig/include/link.h 2011-10-07 09:48:55.000000000 +0000 -+++ glibc-2.14.1/include/link.h 2011-10-07 19:43:10.357462703 +0000 -@@ -192,6 +192,9 @@ - during LD_TRACE_PRELINKING=1 - contains any DT_SYMBOLIC - libraries. */ -+ unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be -+ freed, ie. not allocated with -+ the dummy malloc in ld.so. */ - - /* Collected information about own RPATH directories. */ - struct r_search_path_struct l_rpath_dirs; -@@ -240,9 +243,6 @@ - - /* List of object in order of the init and fini calls. */ - struct link_map **l_initfini; -- /* The init and fini list generated at startup, saved when the -- object is also loaded dynamically. */ -- struct link_map **l_orig_initfini; - - /* List of the dependencies introduced through symbol binding. */ - struct link_map_reldeps -diff -Naur glibc-2.14.1.orig/resolv/res_query.c glibc-2.14.1/resolv/res_query.c ---- glibc-2.14.1.orig/resolv/res_query.c 2011-10-07 09:48:55.000000000 +0000 -+++ glibc-2.14.1/resolv/res_query.c 2011-10-07 19:43:10.361412711 +0000 -@@ -122,6 +122,7 @@ - int *resplen2) - { - HEADER *hp = (HEADER *) answer; -+ HEADER *hp2; - int n, use_malloc = 0; - u_int oflags = statp->_flags; - -@@ -239,26 +240,25 @@ - /* __libc_res_nsend might have reallocated the buffer. */ - hp = (HEADER *) *answerp; - -- /* We simplify the following tests by assigning HP to HP2. It -- is easy to verify that this is the same as ignoring all -- tests of HP2. */ -- HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp; -- -- if (n < (int) sizeof (HEADER) && answerp2 != NULL -- && *resplen2 > (int) sizeof (HEADER)) -+ /* We simplify the following tests by assigning HP to HP2 or -+ vice versa. It is easy to verify that this is the same as -+ ignoring all tests of HP or HP2. */ -+ if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER)) - { -- /* Special case of partial answer. */ -- assert (hp != hp2); -- hp = hp2; -+ hp2 = hp; - } -- else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER) -- && n > (int) sizeof (HEADER)) -+ else - { -- /* Special case of partial answer. */ -- assert (hp != hp2); -- hp2 = hp; -+ hp2 = (HEADER *) *answerp2; -+ if (n < (int) sizeof (HEADER)) -+ { -+ hp = hp2; -+ } - } - -+ /* Make sure both hp and hp2 are defined */ -+ assert((hp != NULL) && (hp2 != NULL)); -+ - if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0) - && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) { - #ifdef DEBUG diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-2.14.1-gcc_fix-1.patch --- a/glibc/stuff/glibc-2.14.1-gcc_fix-1.patch Mon Dec 26 01:30:19 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -Submitted By: Matt Burgess -Date: 2010-04-18 -Initial Package Version: 2.11.1 -Upstream Status: Not Submitted -Origin: http://www.eglibc.org/archives/patches/msg00073.html -Description: Fixes the following build problem with GCC-4.5.0: - -/mnt/lfs/sources/libc-build/math/s_frexp.os.dt -MT /mnt/lfs/sources/libc-build/math/s_frexp.os -./sysdeps/i386/fpu/s_frexp.S: Assembler messages: -./sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef" -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.' -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1' -./sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive -./sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if" -./sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression -make[2]: *** [/mnt/lfs/sources/libc-build/math/s_frexp.os] Error 1 - -diff -Naur glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c ---- glibc-2.11.1.orig/nptl/sysdeps/pthread/pt-initfini.c 2009-12-08 20:10:20.000000000 +0000 -+++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c 2010-04-17 11:34:06.882681001 +0000 -@@ -45,6 +45,11 @@ - /* Embed an #include to pull in the alignment and .end directives. */ - asm ("\n#include \"defs.h\""); - -+asm ("\n#if defined __i686 && defined __ASSEMBLER__"); -+asm ("\n#undef __i686"); -+asm ("\n#define __i686 __i686"); -+asm ("\n#endif"); -+ - /* The initial common code ends here. */ - asm ("\n/*@HEADER_ENDS*/"); - -diff -Naur glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h ---- glibc-2.11.1.orig/sysdeps/unix/sysv/linux/i386/sysdep.h 2009-12-08 20:10:20.000000000 +0000 -+++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h 2010-04-17 11:34:06.882681001 +0000 -@@ -29,6 +29,10 @@ - #include - #include - -+#if defined __i686 && defined __ASSEMBLER__ -+#undef __i686 -+#define __i686 __i686 -+#endif - - /* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-2.14.1-sort-1.patch --- a/glibc/stuff/glibc-2.14.1-sort-1.patch Mon Dec 26 01:30:19 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,273 +0,0 @@ -Submitted By: Bruce Dubbs -Date: 2012-02-24 -Initial Package Version: 2.14.1 -Upstream Status: From upstream -Origin: Upstream -Description: Sort objects by dependency before relocation. - Fixes segfault in dlopen for several programs. - -diff --git a/Makeconfig b/Makeconfig -index 2db2821..68547b2 100644 ---- a/Makeconfig -+++ b/Makeconfig -@@ -938,6 +938,12 @@ libdl = - endif - endif - -+ifeq ($(build-shared),yes) -+libm = $(common-objpfx)math/libm.so$(libm.so-version) -+else -+libm = $(common-objpfx)math/libm.a -+endif -+ - # These are the subdirectories containing the library source. The order - # is more or less arbitrary. The sorting step will take care of the - # dependencies. -diff --git a/elf/Makefile b/elf/Makefile -index 052e763..3f1772a 100644 ---- a/elf/Makefile -+++ b/elf/Makefile -@@ -124,7 +124,8 @@ distribute := rtld-Rules \ - tst-initordera1.c tst-initordera2.c tst-initorderb1.c \ - tst-initorderb2.c tst-initordera3.c tst-initordera4.c \ - tst-initorder.c \ -- tst-initorder2.c -+ tst-initorder2.c \ -+ tst-relsort1.c tst-relsort1mod1.c tst-relsort1mod2.c - - CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables - CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables -@@ -227,7 +228,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ - tst-audit1 tst-audit2 \ - tst-stackguard1 tst-addr1 tst-thrlock \ - tst-unique1 tst-unique2 tst-unique3 tst-unique4 \ -- tst-initorder tst-initorder2 -+ tst-initorder tst-initorder2 tst-relsort1 - # reldep9 - test-srcs = tst-pathopt - selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null) -@@ -290,7 +291,9 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ - tst-initordera1 tst-initorderb1 \ - tst-initordera2 tst-initorderb2 \ - tst-initordera3 tst-initordera4 \ -- tst-initorder2a tst-initorder2b tst-initorder2c tst-initorder2d -+ tst-initorder2a tst-initorder2b tst-initorder2c \ -+ tst-initorder2d \ -+ tst-relsort1mod1 tst-relsort1mod2 - ifeq (yes,$(have-initfini-array)) - modules-names += tst-array2dep tst-array5dep - endif -@@ -1195,3 +1198,9 @@ CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS) - CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS) - CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS) - endif -+ -+$(objpfx)tst-relsort1: $(libdl) -+$(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so -+$(objpfx)tst-relsort1mod2.so: $(libm) -+$(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \ -+ $(objpfx)tst-relsort1mod2.so -diff --git a/elf/dl-open.c b/elf/dl-open.c -index a0b5c50..a56bdc1 100644 ---- a/elf/dl-open.c -+++ b/elf/dl-open.c -@@ -1,5 +1,5 @@ - /* Load a shared object at runtime, relocate it, and run its initializer. -- Copyright (C) 1996-2007, 2009, 2010, 2011 Free Software Foundation, Inc. -+ Copyright (C) 1996-2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or -@@ -303,45 +303,109 @@ dl_open_worker (void *a) - if (GLRO(dl_lazy)) - reloc_mode |= mode & RTLD_LAZY; - -- /* Relocate the objects loaded. We do this in reverse order so that copy -- relocs of earlier objects overwrite the data written by later objects. */ -- -+ /* Sort the objects by dependency for the relocation process. This -+ allows IFUNC relocations to work and it also means copy -+ relocation of dependencies are if necessary overwritten. */ -+ size_t nmaps = 0; - struct link_map *l = new; -- while (l->l_next) -- l = l->l_next; -- while (1) -+ do -+ { -+ if (! l->l_real->l_relocated) -+ ++nmaps; -+ l = l->l_next; -+ } -+ while (l != NULL); -+ struct link_map *maps[nmaps]; -+ nmaps = 0; -+ l = new; -+ do - { - if (! l->l_real->l_relocated) -+ maps[nmaps++] = l; -+ l = l->l_next; -+ } -+ while (l != NULL); -+ if (nmaps > 1) -+ { -+ char seen[nmaps]; -+ memset (seen, '\0', nmaps); -+ size_t i = 0; -+ while (1) - { --#ifdef SHARED -- if (__builtin_expect (GLRO(dl_profile) != NULL, 0)) -+ ++seen[i]; -+ struct link_map *thisp = maps[i]; -+ -+ /* Find the last object in the list for which the current one is -+ a dependency and move the current object behind the object -+ with the dependency. */ -+ size_t k = nmaps - 1; -+ while (k > i) - { -- /* If this here is the shared object which we want to profile -- make sure the profile is started. We can find out whether -- this is necessary or not by observing the `_dl_profile_map' -- variable. If was NULL but is not NULL afterwars we must -- start the profiling. */ -- struct link_map *old_profile_map = GL(dl_profile_map); -+ struct link_map **runp = maps[k]->l_initfini; -+ if (runp != NULL) -+ /* Look through the dependencies of the object. */ -+ while (*runp != NULL) -+ if (__builtin_expect (*runp++ == thisp, 0)) -+ { -+ /* Move the current object to the back past the last -+ object with it as the dependency. */ -+ memmove (&maps[i], &maps[i + 1], -+ (k - i) * sizeof (maps[0])); -+ maps[k] = thisp; -+ -+ if (seen[i + 1] > 1) -+ { -+ ++i; -+ goto next_clear; -+ } -+ -+ char this_seen = seen[i]; -+ memmove (&seen[i], &seen[i + 1], -+ (k - i) * sizeof (seen[0])); -+ seen[k] = this_seen; -+ -+ goto next; -+ } -+ -+ --k; -+ } - -- _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1); -+ if (++i == nmaps) -+ break; -+ next_clear: -+ memset (&seen[i], 0, (nmaps - i) * sizeof (seen[0])); -+ next:; -+ } -+ } - -- if (old_profile_map == NULL && GL(dl_profile_map) != NULL) -- { -- /* We must prepare the profiling. */ -- _dl_start_profile (); -+ for (size_t i = nmaps; i-- > 0; ) -+ { -+ l = maps[i]; - -- /* Prevent unloading the object. */ -- GL(dl_profile_map)->l_flags_1 |= DF_1_NODELETE; -- } -+#ifdef SHARED -+ if (__builtin_expect (GLRO(dl_profile) != NULL, 0)) -+ { -+ /* If this here is the shared object which we want to profile -+ make sure the profile is started. We can find out whether -+ this is necessary or not by observing the `_dl_profile_map' -+ variable. If it was NULL but is not NULL afterwars we must -+ start the profiling. */ -+ struct link_map *old_profile_map = GL(dl_profile_map); -+ -+ _dl_relocate_object (l, l->l_scope, reloc_mode | RTLD_LAZY, 1); -+ -+ if (old_profile_map == NULL && GL(dl_profile_map) != NULL) -+ { -+ /* We must prepare the profiling. */ -+ _dl_start_profile (); -+ -+ /* Prevent unloading the object. */ -+ GL(dl_profile_map)->l_flags_1 |= DF_1_NODELETE; - } -- else --#endif -- _dl_relocate_object (l, l->l_scope, reloc_mode, 0); - } -- -- if (l == new) -- break; -- l = l->l_prev; -+ else -+#endif -+ _dl_relocate_object (l, l->l_scope, reloc_mode, 0); - } - - /* If the file is not loaded now as a dependency, add the search -diff --git a/elf/tst-relsort1.c b/elf/tst-relsort1.c -new file mode 100644 -index 0000000..972100c ---- /dev/null -+++ b/elf/tst-relsort1.c -@@ -0,0 +1,19 @@ -+#include -+#include -+ -+ -+static int -+do_test () -+{ -+ const char lib[] = "$ORIGIN/tst-relsort1mod1.so"; -+ void *h = dlopen (lib, RTLD_NOW); -+ if (h == NULL) -+ { -+ puts (dlerror ()); -+ return 1; -+ } -+ return 0; -+} -+ -+#define TEST_FUNCTION do_test () -+#include "../test-skeleton.c" -diff --git a/elf/tst-relsort1mod1.c b/elf/tst-relsort1mod1.c -new file mode 100644 -index 0000000..9e4a943 ---- /dev/null -+++ b/elf/tst-relsort1mod1.c -@@ -0,0 +1,7 @@ -+extern int foo (double); -+ -+int -+bar (void) -+{ -+ return foo (1.2); -+} -diff --git a/elf/tst-relsort1mod2.c b/elf/tst-relsort1mod2.c -new file mode 100644 -index 0000000..a2c3e55 ---- /dev/null -+++ b/elf/tst-relsort1mod2.c -@@ -0,0 +1,7 @@ -+#include -+ -+int -+foo (double d) -+{ -+ return floor (d) != 0.0; -+} --- -1.7.3.4 - diff -r 6b0977689017 -r 12dc3b9e499d glibc/stuff/glibc-po.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glibc/stuff/glibc-po.patch Mon Dec 26 10:36:28 2016 +0200 @@ -0,0 +1,249 @@ +warning: internationalized messages should not contain the '\v' escape sequence + +--- a/po/cs.po ++++ b/po/cs.po +@@ -153,7 +153,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Generuje katalog zpráv.\vJe-li VSTUPNÍ_SOUBOR -, vstup bude načten ze standardního vstupu.\n" ++"Generuje katalog zpráv.\n" ++"Je-li VSTUPNÍ_SOUBOR -, vstup bude načten ze standardního vstupu.\n" + "Je-li VÝSTUPNÍ_SOUBOR -, výstup bude zapsán na standardní výstup.\n" + + #: catgets/gencat.c:123 +--- a/po/da.po ++++ b/po/da.po +@@ -131,7 +131,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Generér meddelelseskatalog.\vHvis INDFIL er '-' læses inddata fra standard ind.\n" ++"Generér meddelelseskatalog.\n" ++"Hvis INDFIL er '-' læses inddata fra standard ind.\n" + "Hvis UDFIL er '-' skrives uddata til standard ud.\n" + + #: catgets/gencat.c:123 +--- a/po/de.po ++++ b/po/de.po +@@ -131,7 +131,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Einen Message-Katalog generieren.\vWenn als INPUT-FILE - angegeben wird, wird\n" ++"Einen Message-Katalog generieren.\n" ++"Wenn als INPUT-FILE - angegeben wird, wird\n" + "von der Standardeingabe gelesen. Wenn die OUTPUT-FILE - ist, wird auf die\n" + "Standardausgabe geschrieben.\n" + +--- a/po/en_GB.po ++++ b/po/en_GB.po +@@ -1878,11 +1878,12 @@ + + #: catgets/gencat.c:116 + msgid "" +-"Generate message catalog.\\vIf INPUT-FILE is -, input is read from standard " ++"Generate message catalog.\vIf INPUT-FILE is -, input is read from standard " + "input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Generate message catalogue.\\vIf INPUT-FILE is -, input is read from standard " ++"Generate message catalogue.\n" ++"If INPUT-FILE is -, input is read from standard " + "input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + +--- a/po/eo.po ++++ a/po/eo.po +@@ -138,7 +138,8 @@ + "is -, output is written to standard output.\n" + msgstr "" + " \n" +-"Generas mesaĝan katalogon.\vSe ENIGDOSIERO estas «-», ĉefenigujo legiĝas. Se ELIGDOSIERO estas «-», la eligo skribiĝas al ĉefeligujo.\n" ++"Generas mesaĝan katalogon.\n" ++"Se ENIGDOSIERO estas «-», ĉefenigujo legiĝas. Se ELIGDOSIERO estas «-», la eligo skribiĝas al ĉefeligujo.\n" + + #: catgets/gencat.c:123 + msgid "" +--- a/po/es.po ++++ b/po/es.po +@@ -151,7 +151,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Genera un catálogo de mensajes.\vSi FICHERO-ENTRADA es -, la entrada\n" ++"Genera un catálogo de mensajes.\n" ++"Si FICHERO-ENTRADA es -, la entrada\n" + "se lee de la entrada estándar. Si FICHERO-SALIDA es -, el resultado se\n" + "escribe en la salida estándar.\n" + +--- a/po/fi.po ++++ b/po/fi.po +@@ -151,7 +151,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Luo viestikatalogi.\vJos SYÖTETIEDOSTO on -, syöte luetaan vakiosyötteestä. Jos TULOSTIEDOSTO\n" ++"Luo viestikatalogi.\n" ++"Jos SYÖTETIEDOSTO on -, syöte luetaan vakiosyötteestä. Jos TULOSTIEDOSTO\n" + "on -, tuloste kirjoitetaan vakiotulosteeseen.\n" + + #: catgets/gencat.c:123 +--- a/po/fr.po ++++ b/po/fr.po +@@ -136,7 +136,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Génère le catalogue de messages.\vSi le FICHIER_D_ENTRÉE est -, l'entrée est lue depuis l'entrée standard.\n" ++"Génère le catalogue de messages.\n" ++"Si le FICHIER_D_ENTRÉE est -, l'entrée est lue depuis l'entrée standard.\n" + "Si le FICHIER_DE_SORTIE est -, la sortie est dirigée sur la sortie standard.\n" + + #: catgets/gencat.c:123 +--- a/po/hr.po ++++ b/po/hr.po +@@ -132,7 +132,9 @@ + msgid "" + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" +-msgstr "Napravi katalog poruka.\vAko je ULAZNA-DATOTEKA -, ulaz se čita sa standardnog ulaza. Ako je IZLAZNA-DATOTEKA -, izlaz se ispisuje na standardni izlaz.\n" ++msgstr "" ++"Napravi katalog poruka.\n" ++"Ako je ULAZNA-DATOTEKA -, ulaz se čita sa standardnog ulaza. Ako je IZLAZNA-DATOTEKA -, izlaz se ispisuje na standardni izlaz.\n" + + #: catgets/gencat.c:123 + msgid "" +--- a/po/hu.po ++++ b/po/hu.po +@@ -132,7 +132,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Üzenetkatalógus előállítása\v Ha a BEMENETIFÁJL a -, akkor a szabványos bemenetet olvassa. Ha a \n" ++"Üzenetkatalógus előállítása\n" ++"Ha a BEMENETIFÁJL a -, akkor a szabványos bemenetet olvassa. Ha a \n" + "KIMENETIFÁJL a -, akkor a szabványos kimenetre ír.\n" + + #: catgets/gencat.c:123 +--- a/po/ia.po ++++ b/po/ia.po +@@ -131,7 +131,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Generar un catalogo de messages.\vSi FILE-INPUT es -, le entrata se lege del input standard.\n" ++"Generar un catalogo de messages.\n" ++"Si FILE-INPUT es -, le entrata se lege del input standard.\n" + "Si FILE-OUTPUT es -, le resultato se scribe al output standard.\n" + + #: catgets/gencat.c:123 +--- a/po/it.po ++++ b/po/it.po +@@ -143,7 +143,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Genera un catalogo di messaggi.\vSe FILE-INPUT è -, l'input è letto dallo standard input.\n" ++"Genera un catalogo di messaggi.\n" ++"Se FILE-INPUT è -, l'input è letto dallo standard input.\n" + "Se FILE-OUTPUT è -, l'output è scritto sullo standard output.\n" + + #: catgets/gencat.c:123 +--- a/po/nl.po ++++ b/po/nl.po +@@ -145,7 +145,8 @@ + "is -, output is written to standard output.\n" + msgstr "" + " \n" +-"Een berichtencatalogus genereren.\vAls INVOERBESTAND '-' is, wordt van standaardinvoer gelezen.\n" ++"Een berichtencatalogus genereren.\n" ++"Als INVOERBESTAND '-' is, wordt van standaardinvoer gelezen.\n" + "Als UITVOERBESTAND '-' is, wordt naar standaarduitvoer geschreven.\n" + + #: catgets/gencat.c:123 +--- a/po/pl.po ++++ b/po/pl.po +@@ -131,7 +131,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Generowanie katalogu komunikatów.\vJeśli PLIK-WE to -, dane są czytane ze standardowego wejścia. Jeśli PLIK-WY\n" ++"Generowanie katalogu komunikatów.\n" ++"Jeśli PLIK-WE to -, dane są czytane ze standardowego wejścia. Jeśli PLIK-WY\n" + "to -, dane są zapisywane na standardowe wyjście.\n" + + #: catgets/gencat.c:123 +--- a/po/ru.po ++++ b/po/ru.po +@@ -138,7 +138,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Генерирует каталог сообщений.\vЕсли ВХОДНОЙ-ФАЙЛ задан как -, читает стандартный ввод. Если\n" ++"Генерирует каталог сообщений.\n" ++"Если ВХОДНОЙ-ФАЙЛ задан как -, читает стандартный ввод. Если\n" + "ВЫХОДНОЙ-ФАЙЛ задан как -, результат печатается на стандартный вывод.\n" + + #: catgets/gencat.c:123 +--- a/po/sl.po ++++ b/po/sl.po +@@ -131,7 +131,9 @@ + msgid "" + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" +-msgstr "Ustvari katalog sporočil.\vČe je VHODNA_DATOTEKA enaka -, se vhod bere s standardnega vhoda. Če je IZHODNA_DATOTEKA enaka -, se izhod zapisuje na standardni izhod.\n" ++msgstr "" ++"Ustvari katalog sporočil.\n" ++"Če je VHODNA_DATOTEKA enaka -, se vhod bere s standardnega vhoda. Če je IZHODNA_DATOTEKA enaka -, se izhod zapisuje na standardni izhod.\n" + + #: catgets/gencat.c:123 + msgid "" +--- a/po/sv.po ++++ b/po/sv.po +@@ -131,7 +131,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Skapa meddelandekatalog.\vOm INFIL är - så läses standard in. Om UTFIL\n" ++"Skapa meddelandekatalog.\n" ++"Om INFIL är - så läses standard in. Om UTFIL\n" + "är - så skrivs resultatet till standard ut.\n" + + #: catgets/gencat.c:123 +--- a/po/uk.po ++++ b/po/uk.po +@@ -133,7 +133,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"Створити каталог повідомлень.\vЯкщо як файл ВХІДНИЙ-ФАЙЛ\n" ++"Створити каталог повідомлень.\n" ++"Якщо як файл ВХІДНИЙ-ФАЙЛ\n" + "вказано -, вивід відбуватиметься у стандартний вивід.\n" + + #: catgets/gencat.c:123 +--- a/po/zh_CN.po ++++ b/po/zh_CN.po +@@ -137,7 +137,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"产生消息 catelog。\\v如果输入文件名是 -, 将从标准输入读取输入。\n" ++"产生消息 catelog。\n" ++"如果输入文件名是 -, 将从标准输入读取输入。\n" + "如果输出文件名是 -, 则输出将写到标准输出去。\n" + + #: catgets/gencat.c:123 +--- a/po/zh_TW.po ++++ b/po/zh_TW.po +@@ -134,7 +134,8 @@ + "Generate message catalog.\vIf INPUT-FILE is -, input is read from standard input. If OUTPUT-FILE\n" + "is -, output is written to standard output.\n" + msgstr "" +-"產生訊息 catelog。\\v如果輸入檔名是 -, 將從標準輸入讀取輸入。\n" ++"產生訊息 catelog。\n" ++"如果輸入檔名是 -, 將從標準輸入讀取輸入。\n" + "如果輸出檔名是 -, 則輸出將寫到標準輸出去。\n" + + #: catgets/gencat.c:123