From dac591aae6b56c5036b050fb017ccdfe4ed33f2d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 17:54:47 +0100 Subject: [PATCH] glibc: Update to 2.20 --- pkgs/development/libraries/glibc/common.nix | 12 +- .../libraries/glibc/cve-2014-0475.patch | 170 --------- .../libraries/glibc/cve-2014-5119.patch | 206 ----------- .../glibc/dont-use-system-ld-so-preload.patch | 10 +- .../libraries/glibc/fix-math.patch | 336 ------------------ ...-remove-date-from-compilation-banner.patch | 12 - pkgs/development/libraries/glibc/locales.nix | 4 +- 7 files changed, 9 insertions(+), 741 deletions(-) delete mode 100644 pkgs/development/libraries/glibc/cve-2014-0475.patch delete mode 100644 pkgs/development/libraries/glibc/cve-2014-5119.patch delete mode 100644 pkgs/development/libraries/glibc/fix-math.patch delete mode 100644 pkgs/development/libraries/glibc/glibc-remove-date-from-compilation-banner.patch diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 23efc01a3975..2559dea26539 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -13,7 +13,7 @@ cross: let - version = "2.19"; + version = "2.20"; in @@ -56,14 +56,6 @@ stdenv.mkDerivation ({ "/bin:/usr/bin", which is inappropriate on NixOS machines. This patch extends the search path by "/run/current-system/sw/bin". */ ./fix_path_attribute_in_getconf.patch - - ./fix-math.patch - - ./cve-2014-0475.patch - ./cve-2014-5119.patch - - /* Remove references to the compilation date. */ - ./glibc-remove-date-from-compilation-banner.patch ]; postPatch = @@ -155,7 +147,7 @@ stdenv.mkDerivation ({ } else fetchurl { url = "mirror://gnu/glibc/glibc-${version}.tar.gz"; - sha256 = "15n7x9mmzhd7w6s5hd9srx0h23b32gwb306x98k9ss940yvnvb8q"; + sha256 = "1g6ysvk15arpi7c1f1fpx5slgfr2k3dqd5xr0yvijajp1m0xxq9p"; }; # Remove absolute paths from `configure' & co.; build out-of-tree. diff --git a/pkgs/development/libraries/glibc/cve-2014-0475.patch b/pkgs/development/libraries/glibc/cve-2014-0475.patch deleted file mode 100644 index a4f983de8f6c..000000000000 --- a/pkgs/development/libraries/glibc/cve-2014-0475.patch +++ /dev/null @@ -1,170 +0,0 @@ -Picked from upstream commits, but excluding changes to news and tests: -d183645616b0533 and 4e8f95a0df7c2 -Also see https://sourceware.org/bugzilla/show_bug.cgi?id=17137 - -diff --git a/locale/setlocale.c b/locale/setlocale.c -index 9458468..6455b8b 100644 ---- a/locale/setlocale.c -+++ b/locale/setlocale.c -@@ -272,6 +272,8 @@ setlocale (int category, const char *locale) - 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 *locale) - if (__glibc_unlikely (strchr (locale, ';') != NULL)) - { - /* 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 *locale) - { - 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 *locale) - /* 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; - } -diff --git a/locale/findlocale.c b/locale/findlocale.c -index bbaf708..22e8b53 100644 ---- a/locale/findlocale.c -+++ b/locale/findlocale.c -@@ -17,6 +17,7 @@ - . */ - - #include -+#include - #include - #include - #include -@@ -57,6 +58,45 @@ struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST]; - - 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, size_t locale_path_len, - { - 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, size_t locale_path_len, - 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. */ diff --git a/pkgs/development/libraries/glibc/cve-2014-5119.patch b/pkgs/development/libraries/glibc/cve-2014-5119.patch deleted file mode 100644 index cbae03425eb9..000000000000 --- a/pkgs/development/libraries/glibc/cve-2014-5119.patch +++ /dev/null @@ -1,206 +0,0 @@ -http://anonscm.debian.org/viewvc/pkg-glibc/glibc-package/trunk/debian/patches/any/cvs-CVE-2014-5119.diff?revision=6248&view=co - -commit a1a6a401ab0a3c9f15fb7eaebbdcee24192254e8 -Author: Florian Weimer -Date: Tue Aug 26 19:38:59 2014 +0200 - - __gconv_translit_find: Disable function [BZ #17187] - - This functionality has never worked correctly, and the implementation - contained a security vulnerability (CVE-2014-5119). - -2014-08-26 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. - ---- a/iconv/gconv_trans.c -+++ b/iconv/gconv_trans.c -@@ -238,181 +238,12 @@ __gconv_transliterate (struct __gconv_step *step, - 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; -+ /* Transliteration module loading has been removed because it never -+ worked as intended and suffered from a security vulnerability. -+ Consequently, this function always fails. */ -+ return 1; - } diff --git a/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch b/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch index fabb6c3ec5e1..894e2a11cf87 100644 --- a/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch +++ b/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch @@ -1,12 +1,12 @@ -diff -rupN a/elf/rtld.c b/elf/rtld.c ---- a/elf/rtld.c 2013-08-11 00:52:55.000000001 +0200 -+++ b/elf/rtld.c 2014-02-18 13:56:19.000000001 +0100 -@@ -1639,7 +1639,7 @@ ERROR: ld.so: object '%s' cannot be load +diff -ru glibc-2.20-orig/elf/rtld.c glibc-2.20/elf/rtld.c +--- glibc-2.20-orig/elf/rtld.c 2014-09-07 10:09:09.000000000 +0200 ++++ glibc-2.20/elf/rtld.c 2014-10-27 11:32:25.203043157 +0100 +@@ -1513,7 +1513,7 @@ open(). So we do this first. If it succeeds we do almost twice the work but this does not matter, since it is not for production use. */ - static const char preload_file[] = "/etc/ld.so.preload"; + static const char preload_file[] = "/etc/ld-nix.so.preload"; - if (__builtin_expect (__access (preload_file, R_OK) == 0, 0)) + if (__glibc_unlikely (__access (preload_file, R_OK) == 0)) { /* Read the contents of the file. */ diff --git a/pkgs/development/libraries/glibc/fix-math.patch b/pkgs/development/libraries/glibc/fix-math.patch deleted file mode 100644 index 516f53954ddd..000000000000 --- a/pkgs/development/libraries/glibc/fix-math.patch +++ /dev/null @@ -1,336 +0,0 @@ -From: Siddhesh Poyarekar -Date: Thu, 27 Feb 2014 15:42:09 +0000 (+0530) -Subject: Fix sign of input to bsloww1 (BZ #16623) -X-Git-Url: http://repo.or.cz/w/glibc.git/commitdiff_plain/1cadc85813d736f7682fa2eeadae639ab6b66c65 - -Fix sign of input to bsloww1 (BZ #16623) - -In 84ba214c, I removed some redundant sign computations and in the -process, I incorrectly got rid of a temporary variable, thus passing -the absolute value of the input to bsloww1. This caused #16623. - -This fix undoes the incorrect change. - -[nix]: drop docs update (wouldn't apply) ---- - -diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in -index ac5348f..fafe96f 100644 ---- a/math/auto-libm-test-in -+++ b/math/auto-libm-test-in -@@ -594,6 +594,7 @@ cos 0x1.0000010b239a9p0 - cos 0x1.00000162a932bp0 - cos 0x1.000002d452a10p0 - cos 0x1.000005bc7d86dp0 -+cos 0x1.200145a975ce6p32 - cos 1 - cos 2 - cos 3 -@@ -1748,6 +1749,7 @@ sin 7 - sin 8 - sin 9 - sin 10 -+sin 0x1.2001469775ce6p32 - - sincos 0 - sincos -0 -diff --git a/math/auto-libm-test-out b/math/auto-libm-test-out -index 8f79359..59c08a7 100644 ---- a/math/auto-libm-test-out -+++ b/math/auto-libm-test-out -@@ -74446,6 +74446,75 @@ cos 0x1.000005bc7d86dp0 - = cos tonearest ldbl-128ibm 0x1.000005bc7d86dp+0L : 0x8.a513ba9f703d3ffffffcb92354p-4L : inexact-ok - = cos towardzero ldbl-128ibm 0x1.000005bc7d86dp+0L : 0x8.a513ba9f703d3ffffffcb92354p-4L : inexact-ok - = cos upward ldbl-128ibm 0x1.000005bc7d86dp+0L : 0x8.a513ba9f703d3ffffffcb92358p-4L : inexact-ok -+cos 0x1.200145a975ce6p32 -+= cos downward flt-32 0x1.200146p+32f : -0xf.74fbep-4f : inexact-ok -+= cos tonearest flt-32 0x1.200146p+32f : -0xf.74fbdp-4f : inexact-ok -+= cos towardzero flt-32 0x1.200146p+32f : -0xf.74fbdp-4f : inexact-ok -+= cos upward flt-32 0x1.200146p+32f : -0xf.74fbdp-4f : inexact-ok -+= cos downward dbl-64 0x1.200146p+32 : -0xf.74fbd5498fe5p-4 : inexact-ok -+= cos tonearest dbl-64 0x1.200146p+32 : -0xf.74fbd5498fe5p-4 : inexact-ok -+= cos towardzero dbl-64 0x1.200146p+32 : -0xf.74fbd5498fe48p-4 : inexact-ok -+= cos upward dbl-64 0x1.200146p+32 : -0xf.74fbd5498fe48p-4 : inexact-ok -+= cos downward ldbl-96-intel 0x1.200146p+32L : -0xf.74fbd5498fe4c0dp-4L : inexact-ok -+= cos tonearest ldbl-96-intel 0x1.200146p+32L : -0xf.74fbd5498fe4c0cp-4L : inexact-ok -+= cos towardzero ldbl-96-intel 0x1.200146p+32L : -0xf.74fbd5498fe4c0cp-4L : inexact-ok -+= cos upward ldbl-96-intel 0x1.200146p+32L : -0xf.74fbd5498fe4c0cp-4L : inexact-ok -+= cos downward ldbl-96-m68k 0x1.200146p+32L : -0xf.74fbd5498fe4c0dp-4L : inexact-ok -+= cos tonearest ldbl-96-m68k 0x1.200146p+32L : -0xf.74fbd5498fe4c0cp-4L : inexact-ok -+= cos towardzero ldbl-96-m68k 0x1.200146p+32L : -0xf.74fbd5498fe4c0cp-4L : inexact-ok -+= cos upward ldbl-96-m68k 0x1.200146p+32L : -0xf.74fbd5498fe4c0cp-4L : inexact-ok -+= cos downward ldbl-128 0x1.200146p+32L : -0xf.74fbd5498fe4c0c71bd9e4ef59e8p-4L : inexact-ok -+= cos tonearest ldbl-128 0x1.200146p+32L : -0xf.74fbd5498fe4c0c71bd9e4ef59e8p-4L : inexact-ok -+= cos towardzero ldbl-128 0x1.200146p+32L : -0xf.74fbd5498fe4c0c71bd9e4ef59ep-4L : inexact-ok -+= cos upward ldbl-128 0x1.200146p+32L : -0xf.74fbd5498fe4c0c71bd9e4ef59ep-4L : inexact-ok -+= cos downward ldbl-128ibm 0x1.200146p+32L : -0xf.74fbd5498fe4c0c71bd9e4ef5cp-4L : inexact-ok -+= cos tonearest ldbl-128ibm 0x1.200146p+32L : -0xf.74fbd5498fe4c0c71bd9e4ef58p-4L : inexact-ok -+= cos towardzero ldbl-128ibm 0x1.200146p+32L : -0xf.74fbd5498fe4c0c71bd9e4ef58p-4L : inexact-ok -+= cos upward ldbl-128ibm 0x1.200146p+32L : -0xf.74fbd5498fe4c0c71bd9e4ef58p-4L : inexact-ok -+= cos downward flt-32 0x1.200144p+32f : 0xf.bc96cp-4f : inexact-ok -+= cos tonearest flt-32 0x1.200144p+32f : 0xf.bc96dp-4f : inexact-ok -+= cos towardzero flt-32 0x1.200144p+32f : 0xf.bc96cp-4f : inexact-ok -+= cos upward flt-32 0x1.200144p+32f : 0xf.bc96dp-4f : inexact-ok -+= cos downward dbl-64 0x1.200144p+32 : 0xf.bc96ca2c658a8p-4 : inexact-ok -+= cos tonearest dbl-64 0x1.200144p+32 : 0xf.bc96ca2c658a8p-4 : inexact-ok -+= cos towardzero dbl-64 0x1.200144p+32 : 0xf.bc96ca2c658a8p-4 : inexact-ok -+= cos upward dbl-64 0x1.200144p+32 : 0xf.bc96ca2c658bp-4 : inexact-ok -+= cos downward ldbl-96-intel 0x1.200144p+32L : 0xf.bc96ca2c658abf5p-4L : inexact-ok -+= cos tonearest ldbl-96-intel 0x1.200144p+32L : 0xf.bc96ca2c658abf6p-4L : inexact-ok -+= cos towardzero ldbl-96-intel 0x1.200144p+32L : 0xf.bc96ca2c658abf5p-4L : inexact-ok -+= cos upward ldbl-96-intel 0x1.200144p+32L : 0xf.bc96ca2c658abf6p-4L : inexact-ok -+= cos downward ldbl-96-m68k 0x1.200144p+32L : 0xf.bc96ca2c658abf5p-4L : inexact-ok -+= cos tonearest ldbl-96-m68k 0x1.200144p+32L : 0xf.bc96ca2c658abf6p-4L : inexact-ok -+= cos towardzero ldbl-96-m68k 0x1.200144p+32L : 0xf.bc96ca2c658abf5p-4L : inexact-ok -+= cos upward ldbl-96-m68k 0x1.200144p+32L : 0xf.bc96ca2c658abf6p-4L : inexact-ok -+= cos downward ldbl-128 0x1.200144p+32L : 0xf.bc96ca2c658abf5ace7b886a8fbp-4L : inexact-ok -+= cos tonearest ldbl-128 0x1.200144p+32L : 0xf.bc96ca2c658abf5ace7b886a8fbp-4L : inexact-ok -+= cos towardzero ldbl-128 0x1.200144p+32L : 0xf.bc96ca2c658abf5ace7b886a8fbp-4L : inexact-ok -+= cos upward ldbl-128 0x1.200144p+32L : 0xf.bc96ca2c658abf5ace7b886a8fb8p-4L : inexact-ok -+= cos downward ldbl-128ibm 0x1.200144p+32L : 0xf.bc96ca2c658abf5ace7b886a8cp-4L : inexact-ok -+= cos tonearest ldbl-128ibm 0x1.200144p+32L : 0xf.bc96ca2c658abf5ace7b886a9p-4L : inexact-ok -+= cos towardzero ldbl-128ibm 0x1.200144p+32L : 0xf.bc96ca2c658abf5ace7b886a8cp-4L : inexact-ok -+= cos upward ldbl-128ibm 0x1.200144p+32L : 0xf.bc96ca2c658abf5ace7b886a9p-4L : inexact-ok -+= cos downward dbl-64 0x1.200145a975ce6p+32 : -0x6.568e7ed3dffdp-4 : inexact-ok -+= cos tonearest dbl-64 0x1.200145a975ce6p+32 : -0x6.568e7ed3dffccp-4 : inexact-ok -+= cos towardzero dbl-64 0x1.200145a975ce6p+32 : -0x6.568e7ed3dffccp-4 : inexact-ok -+= cos upward dbl-64 0x1.200145a975ce6p+32 : -0x6.568e7ed3dffccp-4 : inexact-ok -+= cos downward ldbl-96-intel 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe8p-4L : inexact-ok -+= cos tonearest ldbl-96-intel 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfep-4L : inexact-ok -+= cos towardzero ldbl-96-intel 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfep-4L : inexact-ok -+= cos upward ldbl-96-intel 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfep-4L : inexact-ok -+= cos downward ldbl-96-m68k 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe8p-4L : inexact-ok -+= cos tonearest ldbl-96-m68k 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfep-4L : inexact-ok -+= cos towardzero ldbl-96-m68k 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfep-4L : inexact-ok -+= cos upward ldbl-96-m68k 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfep-4L : inexact-ok -+= cos downward ldbl-128 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe227fd726840e8p-4L : inexact-ok -+= cos tonearest ldbl-128 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe227fd726840e4p-4L : inexact-ok -+= cos towardzero ldbl-128 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe227fd726840e4p-4L : inexact-ok -+= cos upward ldbl-128 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe227fd726840e4p-4L : inexact-ok -+= cos downward ldbl-128ibm 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe227fd726842p-4L : inexact-ok -+= cos tonearest ldbl-128ibm 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe227fd72684p-4L : inexact-ok -+= cos towardzero ldbl-128ibm 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe227fd72684p-4L : inexact-ok -+= cos upward ldbl-128ibm 0x1.200145a975ce6p+32L : -0x6.568e7ed3dffcdfe227fd72684p-4L : inexact-ok - cos 1 - = cos downward flt-32 0x1p+0f : 0x8.a514p-4f : inexact-ok - = cos tonearest flt-32 0x1p+0f : 0x8.a514p-4f : inexact-ok -@@ -157744,6 +157813,75 @@ sin 10 - = sin tonearest ldbl-128ibm 0xap+0L : -0x8.b44f7af9a7a92ce7fb22be025p-4L : inexact-ok - = sin towardzero ldbl-128ibm 0xap+0L : -0x8.b44f7af9a7a92ce7fb22be024cp-4L : inexact-ok - = sin upward ldbl-128ibm 0xap+0L : -0x8.b44f7af9a7a92ce7fb22be024cp-4L : inexact-ok -+sin 0x1.2001469775ce6p32 -+= sin downward flt-32 0x1.200148p+32f : -0x5.595d8p-4f : inexact-ok -+= sin tonearest flt-32 0x1.200148p+32f : -0x5.595d8p-4f : inexact-ok -+= sin towardzero flt-32 0x1.200148p+32f : -0x5.595d78p-4f : inexact-ok -+= sin upward flt-32 0x1.200148p+32f : -0x5.595d78p-4f : inexact-ok -+= sin downward dbl-64 0x1.200148p+32 : -0x5.595d7e536fe38p-4 : inexact-ok -+= sin tonearest dbl-64 0x1.200148p+32 : -0x5.595d7e536fe34p-4 : inexact-ok -+= sin towardzero dbl-64 0x1.200148p+32 : -0x5.595d7e536fe34p-4 : inexact-ok -+= sin upward dbl-64 0x1.200148p+32 : -0x5.595d7e536fe34p-4 : inexact-ok -+= sin downward ldbl-96-intel 0x1.200148p+32L : -0x5.595d7e536fe35eep-4L : inexact-ok -+= sin tonearest ldbl-96-intel 0x1.200148p+32L : -0x5.595d7e536fe35ed8p-4L : inexact-ok -+= sin towardzero ldbl-96-intel 0x1.200148p+32L : -0x5.595d7e536fe35ed8p-4L : inexact-ok -+= sin upward ldbl-96-intel 0x1.200148p+32L : -0x5.595d7e536fe35ed8p-4L : inexact-ok -+= sin downward ldbl-96-m68k 0x1.200148p+32L : -0x5.595d7e536fe35eep-4L : inexact-ok -+= sin tonearest ldbl-96-m68k 0x1.200148p+32L : -0x5.595d7e536fe35ed8p-4L : inexact-ok -+= sin towardzero ldbl-96-m68k 0x1.200148p+32L : -0x5.595d7e536fe35ed8p-4L : inexact-ok -+= sin upward ldbl-96-m68k 0x1.200148p+32L : -0x5.595d7e536fe35ed8p-4L : inexact-ok -+= sin downward ldbl-128 0x1.200148p+32L : -0x5.595d7e536fe35edbe2ad0df9d944p-4L : inexact-ok -+= sin tonearest ldbl-128 0x1.200148p+32L : -0x5.595d7e536fe35edbe2ad0df9d94p-4L : inexact-ok -+= sin towardzero ldbl-128 0x1.200148p+32L : -0x5.595d7e536fe35edbe2ad0df9d94p-4L : inexact-ok -+= sin upward ldbl-128 0x1.200148p+32L : -0x5.595d7e536fe35edbe2ad0df9d94p-4L : inexact-ok -+= sin downward ldbl-128ibm 0x1.200148p+32L : -0x5.595d7e536fe35edbe2ad0df9dap-4L : inexact-ok -+= sin tonearest ldbl-128ibm 0x1.200148p+32L : -0x5.595d7e536fe35edbe2ad0df9dap-4L : inexact-ok -+= sin towardzero ldbl-128ibm 0x1.200148p+32L : -0x5.595d7e536fe35edbe2ad0df9d8p-4L : inexact-ok -+= sin upward ldbl-128ibm 0x1.200148p+32L : -0x5.595d7e536fe35edbe2ad0df9d8p-4L : inexact-ok -+= sin downward flt-32 0x1.200146p+32f : 0x4.220ffp-4f : inexact-ok -+= sin tonearest flt-32 0x1.200146p+32f : 0x4.220ffp-4f : inexact-ok -+= sin towardzero flt-32 0x1.200146p+32f : 0x4.220ffp-4f : inexact-ok -+= sin upward flt-32 0x1.200146p+32f : 0x4.220ff8p-4f : inexact-ok -+= sin downward dbl-64 0x1.200146p+32 : 0x4.220ff25f5cfp-4 : inexact-ok -+= sin tonearest dbl-64 0x1.200146p+32 : 0x4.220ff25f5cf04p-4 : inexact-ok -+= sin towardzero dbl-64 0x1.200146p+32 : 0x4.220ff25f5cfp-4 : inexact-ok -+= sin upward dbl-64 0x1.200146p+32 : 0x4.220ff25f5cf04p-4 : inexact-ok -+= sin downward ldbl-96-intel 0x1.200146p+32L : 0x4.220ff25f5cf02a4p-4L : inexact-ok -+= sin tonearest ldbl-96-intel 0x1.200146p+32L : 0x4.220ff25f5cf02a48p-4L : inexact-ok -+= sin towardzero ldbl-96-intel 0x1.200146p+32L : 0x4.220ff25f5cf02a4p-4L : inexact-ok -+= sin upward ldbl-96-intel 0x1.200146p+32L : 0x4.220ff25f5cf02a48p-4L : inexact-ok -+= sin downward ldbl-96-m68k 0x1.200146p+32L : 0x4.220ff25f5cf02a4p-4L : inexact-ok -+= sin tonearest ldbl-96-m68k 0x1.200146p+32L : 0x4.220ff25f5cf02a48p-4L : inexact-ok -+= sin towardzero ldbl-96-m68k 0x1.200146p+32L : 0x4.220ff25f5cf02a4p-4L : inexact-ok -+= sin upward ldbl-96-m68k 0x1.200146p+32L : 0x4.220ff25f5cf02a48p-4L : inexact-ok -+= sin downward ldbl-128 0x1.200146p+32L : 0x4.220ff25f5cf02a464dbb3a679ccp-4L : inexact-ok -+= sin tonearest ldbl-128 0x1.200146p+32L : 0x4.220ff25f5cf02a464dbb3a679ccp-4L : inexact-ok -+= sin towardzero ldbl-128 0x1.200146p+32L : 0x4.220ff25f5cf02a464dbb3a679ccp-4L : inexact-ok -+= sin upward ldbl-128 0x1.200146p+32L : 0x4.220ff25f5cf02a464dbb3a679cc4p-4L : inexact-ok -+= sin downward ldbl-128ibm 0x1.200146p+32L : 0x4.220ff25f5cf02a464dbb3a679cp-4L : inexact-ok -+= sin tonearest ldbl-128ibm 0x1.200146p+32L : 0x4.220ff25f5cf02a464dbb3a679cp-4L : inexact-ok -+= sin towardzero ldbl-128ibm 0x1.200146p+32L : 0x4.220ff25f5cf02a464dbb3a679cp-4L : inexact-ok -+= sin upward ldbl-128ibm 0x1.200146p+32L : 0x4.220ff25f5cf02a464dbb3a679ep-4L : inexact-ok -+= sin downward dbl-64 0x1.2001469775ce6p+32 : -0x6.444fda50019fcp-4 : inexact-ok -+= sin tonearest dbl-64 0x1.2001469775ce6p+32 : -0x6.444fda50019f8p-4 : inexact-ok -+= sin towardzero dbl-64 0x1.2001469775ce6p+32 : -0x6.444fda50019f8p-4 : inexact-ok -+= sin upward dbl-64 0x1.2001469775ce6p+32 : -0x6.444fda50019f8p-4 : inexact-ok -+= sin downward ldbl-96-intel 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f6p-4L : inexact-ok -+= sin tonearest ldbl-96-intel 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f58p-4L : inexact-ok -+= sin towardzero ldbl-96-intel 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f58p-4L : inexact-ok -+= sin upward ldbl-96-intel 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f58p-4L : inexact-ok -+= sin downward ldbl-96-m68k 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f6p-4L : inexact-ok -+= sin tonearest ldbl-96-m68k 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f58p-4L : inexact-ok -+= sin towardzero ldbl-96-m68k 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f58p-4L : inexact-ok -+= sin upward ldbl-96-m68k 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f58p-4L : inexact-ok -+= sin downward ldbl-128 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f5ba3779ca70604p-4L : inexact-ok -+= sin tonearest ldbl-128 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f5ba3779ca706p-4L : inexact-ok -+= sin towardzero ldbl-128 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f5ba3779ca706p-4L : inexact-ok -+= sin upward ldbl-128 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f5ba3779ca706p-4L : inexact-ok -+= sin downward ldbl-128ibm 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f5ba3779ca708p-4L : inexact-ok -+= sin tonearest ldbl-128ibm 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f5ba3779ca706p-4L : inexact-ok -+= sin towardzero ldbl-128ibm 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f5ba3779ca706p-4L : inexact-ok -+= sin upward ldbl-128ibm 0x1.2001469775ce6p+32L : -0x6.444fda50019f9f5ba3779ca706p-4L : inexact-ok - sincos 0 - = sincos downward flt-32 0x0p+0f : 0x0p+0f 0x1p+0f : inexact-ok - = sincos tonearest flt-32 0x0p+0f : 0x0p+0f 0x1p+0f : inexact-ok -diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c -index 6105e9f..50109b8 100644 ---- a/sysdeps/ieee754/dbl-64/s_sin.c -+++ b/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) -diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps -index f3980f8..544f1c7 100644 ---- a/sysdeps/x86_64/fpu/libm-test-ulps -+++ b/sysdeps/x86_64/fpu/libm-test-ulps -@@ -10900,6 +10900,14 @@ idouble: 1 - Test "cos_downward (0x1.0c152382d7365p+0)": - double: 1 - idouble: 1 -+Test "cos_downward (0x1.200145a975ce6p+32)": -+double: 1 -+idouble: 1 -+ildouble: 1 -+ldouble: 1 -+Test "cos_downward (0x1.200146p+32)": -+ildouble: 1 -+ldouble: 1 - Test "cos_downward (0x1.921fb4p+0)": - ildouble: 1 - ldouble: 1 -@@ -11126,6 +11134,9 @@ idouble: 1 - Test "cos_towardzero (0x1.0c152382d7365p+0)": - double: 1 - idouble: 1 -+Test "cos_towardzero (0x1.200146p+32)": -+double: 1 -+idouble: 1 - Test "cos_towardzero (0x1.921fb4p+0)": - ildouble: 1 - ldouble: 1 -@@ -11258,6 +11269,17 @@ idouble: 1 - Test "cos_upward (0x1.0c1524p+0)": - double: 1 - idouble: 1 -+Test "cos_upward (0x1.200144p+32)": -+double: 1 -+idouble: 1 -+Test "cos_upward (0x1.200145a975ce6p+32)": -+ildouble: 1 -+ldouble: 1 -+Test "cos_upward (0x1.200146p+32)": -+double: 1 -+idouble: 1 -+ildouble: 1 -+ldouble: 1 - Test "cos_upward (0x1.921fb4p+0)": - double: 1 - idouble: 1 -@@ -15155,6 +15177,19 @@ double: 1 - idouble: 1 - ildouble: 1 - ldouble: 1 -+Test "sin_downward (0x1.2001469775ce6p+32)": -+double: 1 -+idouble: 1 -+ildouble: 1 -+ldouble: 1 -+Test "sin_downward (0x1.200146p+32)": -+double: 1 -+idouble: 1 -+Test "sin_downward (0x1.200148p+32)": -+double: 1 -+idouble: 1 -+ildouble: 1 -+ldouble: 1 - Test "sin_downward (0x1.921fb54442d18468p+0)": - ildouble: 1 - ldouble: 1 -@@ -15383,6 +15418,9 @@ double: 1 - idouble: 1 - ildouble: 1 - ldouble: 1 -+Test "sin_towardzero (0x1.200146p+32)": -+double: 1 -+idouble: 1 - Test "sin_towardzero (0x1.921fb54442d18468p+0)": - ildouble: 1 - ldouble: 1 -@@ -15532,6 +15570,12 @@ ldouble: 1 - Test "sin_upward (-0x8.60a92p-4)": - ildouble: 1 - ldouble: 1 -+Test "sin_upward (0x1.2001469775ce6p+32)": -+ildouble: 1 -+ldouble: 1 -+Test "sin_upward (0x1.200148p+32)": -+ildouble: 1 -+ldouble: 1 - Test "sin_upward (0x1.921fb4p+0)": - double: 1 - idouble: 1 diff --git a/pkgs/development/libraries/glibc/glibc-remove-date-from-compilation-banner.patch b/pkgs/development/libraries/glibc/glibc-remove-date-from-compilation-banner.patch deleted file mode 100644 index 5d0b1a51762e..000000000000 --- a/pkgs/development/libraries/glibc/glibc-remove-date-from-compilation-banner.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur glibc-2.17.orig/csu/Makefile glibc-2.17/csu/Makefile ---- glibc-2.17.orig/csu/Makefile 2012-12-25 04:02:13.000000000 +0100 -+++ glibc-2.17/csu/Makefile 2013-08-19 16:01:57.132378550 +0200 -@@ -172,7 +172,7 @@ - os=Linux; \ - fi; \ - printf '"Compiled on a %s %s system on %s.\\n"\n' \ -- "$$os" "$$version" "`date +%Y-%m-%d`";; \ -+ "$$os" "$$version";; \ - *) ;; \ - esac; \ - files="$(all-Banner-files)"; \ diff --git a/pkgs/development/libraries/glibc/locales.nix b/pkgs/development/libraries/glibc/locales.nix index 9f9fb86a396d..1dd15832f5b6 100644 --- a/pkgs/development/libraries/glibc/locales.nix +++ b/pkgs/development/libraries/glibc/locales.nix @@ -28,8 +28,8 @@ build null { mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" # Hack to allow building of the locales (needed since glibc-2.12) - sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \ - /library-path/d ../glibc-2*/localedata/Makefile + sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile + ${if allLocales then "" else "echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"}