Merge remote-tracking branch 'origin/glibc-2.20' into staging

This commit is contained in:
Eelco Dolstra 2014-11-16 22:17:36 +01:00
commit a0f3faf34e
42 changed files with 235 additions and 1089 deletions

View File

@ -0,0 +1,15 @@
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212740
--- a/gcc/sched-deps.c 2014/07/17 07:48:49 212739
+++ b/gcc/sched-deps.c 2014/07/17 07:49:44 212740
@@ -2744,7 +2744,8 @@
Consider for instance a volatile asm that changes the fpu rounding
mode. An insn should not be moved across this even if it only uses
pseudo-regs because it might give an incorrectly rounded result. */
- if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
+ if ((code != ASM_OPERANDS || MEM_VOLATILE_P (x))
+ && !DEBUG_INSN_P (insn))
reg_pending_barrier = TRUE_BARRIER;
/* For all ASM_OPERANDS, we must traverse the vector of input operands.

View File

@ -61,7 +61,7 @@ let version = "4.8.3";
enableParallelBuilding = true; enableParallelBuilding = true;
patches = [] patches = [ ./bug-61801.patch ]
++ optional enableParallelBuilding ./parallel-bconfig.patch ++ optional enableParallelBuilding ./parallel-bconfig.patch
++ optional (cross != null) ./libstdc++-target.patch ++ optional (cross != null) ./libstdc++-target.patch
++ optional noSysDirs ./no-sys-dirs.patch ++ optional noSysDirs ./no-sys-dirs.patch

View File

@ -21,6 +21,8 @@ stdenv.mkDerivation {
dontDisableStatic = true; dontDisableStatic = true;
NIX_CFLAGS_COMPILE = "-D__USE_BSD";
meta = { meta = {
homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm; homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm;
license = "LGPL"; license = "LGPL";

View File

@ -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 @@
<http://www.gnu.org/licenses/>. */
#include <assert.h>
+#include <errno.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
@@ -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. */

View File

@ -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 <fweimer@redhat.com>
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 <fweimer@redhat.com>
[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;
}

View File

@ -1,336 +0,0 @@
From: Siddhesh Poyarekar <siddhesh@redhat.com>
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

View File

@ -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)"; \

View File

@ -46,10 +46,6 @@ postInstall() {
ln -s lib $out/lib64 ln -s lib $out/lib64
fi fi
# This file, that should not remain in the glibc derivation,
# may have not been created during the preInstall
rm -f $out/lib/libgcc_s.so.1
# Get rid of more unnecessary stuff. # Get rid of more unnecessary stuff.
rm -rf $out/var $out/sbin/sln rm -rf $out/var $out/sbin/sln
} }

View File

@ -13,7 +13,7 @@ cross:
let let
version = "2.19"; version = "2.20";
in in
@ -56,14 +56,6 @@ stdenv.mkDerivation ({
"/bin:/usr/bin", which is inappropriate on NixOS machines. This "/bin:/usr/bin", which is inappropriate on NixOS machines. This
patch extends the search path by "/run/current-system/sw/bin". */ patch extends the search path by "/run/current-system/sw/bin". */
./fix_path_attribute_in_getconf.patch ./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 = postPatch =
@ -77,8 +69,11 @@ stdenv.mkDerivation ({
+ '' + ''
echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
'' ''
# Replace the date and time in nscd by $out. # Replace the date and time in nscd by a prefix of $out.
# It is used as a protocol compatibility check. # It is used as a protocol compatibility check.
# Note: the size of the struct changes, but using only a part
# would break hash-rewriting. When receiving stats it does check
# that the struct sizes match and can't cause overflow or something.
+ '' + ''
cat ${./glibc-remove-datetime-from-nscd.patch} \ cat ${./glibc-remove-datetime-from-nscd.patch} \
| sed "s,@out@,$out," | patch -p1 | sed "s,@out@,$out," | patch -p1
@ -155,7 +150,7 @@ stdenv.mkDerivation ({
} }
else fetchurl { else fetchurl {
url = "mirror://gnu/glibc/glibc-${version}.tar.gz"; url = "mirror://gnu/glibc/glibc-${version}.tar.gz";
sha256 = "15n7x9mmzhd7w6s5hd9srx0h23b32gwb306x98k9ss940yvnvb8q"; sha256 = "1g6ysvk15arpi7c1f1fpx5slgfr2k3dqd5xr0yvijajp1m0xxq9p";
}; };
# Remove absolute paths from `configure' & co.; build out-of-tree. # Remove absolute paths from `configure' & co.; build out-of-tree.

View File

@ -35,7 +35,7 @@ in
preInstall = '' preInstall = ''
if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then
mkdir -p $out/lib mkdir -p $out/lib
ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1 cp ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
fi fi
''; '';

View File

@ -1,12 +1,12 @@
diff -rupN a/elf/rtld.c b/elf/rtld.c diff -ru glibc-2.20-orig/elf/rtld.c glibc-2.20/elf/rtld.c
--- a/elf/rtld.c 2013-08-11 00:52:55.000000001 +0200 --- glibc-2.20-orig/elf/rtld.c 2014-09-07 10:09:09.000000000 +0200
+++ b/elf/rtld.c 2014-02-18 13:56:19.000000001 +0100 +++ glibc-2.20/elf/rtld.c 2014-10-27 11:32:25.203043157 +0100
@@ -1639,7 +1639,7 @@ ERROR: ld.so: object '%s' cannot be load @@ -1513,7 +1513,7 @@
open(). So we do this first. If it succeeds we do almost twice 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 the work but this does not matter, since it is not for production
use. */ use. */
- static const char preload_file[] = "/etc/ld.so.preload"; - static const char preload_file[] = "/etc/ld.so.preload";
+ static const char preload_file[] = "/etc/ld-nix.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. */ /* Read the contents of the file. */

View File

@ -5,7 +5,7 @@
/* We use this to make sure the receiver is the same. */ /* We use this to make sure the receiver is the same. */
-static const char compilation[21] = __DATE__ " " __TIME__; -static const char compilation[21] = __DATE__ " " __TIME__;
+static const char compilation[21] = "@out@"; +static const char compilation[] = "@out@";
/* Statistic data for one database. */ /* Statistic data for one database. */
struct dbstat struct dbstat

View File

@ -28,8 +28,8 @@ build null {
mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
# Hack to allow building of the locales (needed since glibc-2.12) # Hack to allow building of the locales (needed since glibc-2.12)
sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \ sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile
/library-path/d ../glibc-2*/localedata/Makefile
${if allLocales then "" else ${if allLocales then "" else
"echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"} "echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"}

View File

@ -0,0 +1,16 @@
Allow BusyBox to be invoked as "<something>-busybox". This is
necessary when it's run from the Nix store as <hash>-busybox during
stdenv bootstrap.
diff -ru -x '*~' busybox-1.22.1-orig/libbb/appletlib.c busybox-1.22.1/libbb/appletlib.c
--- busybox-1.22.1-orig/libbb/appletlib.c 2014-01-09 19:15:44.000000000 +0100
+++ busybox-1.22.1/libbb/appletlib.c 2014-10-29 09:53:01.232052068 +0100
@@ -764,7 +764,7 @@
int applet = find_applet_by_name(name);
if (applet >= 0)
run_applet_no_and_exit(applet, argv);
- if (strncmp(name, "busybox", 7) == 0)
+ if (strstr(name, "busybox") != 0)
exit(busybox_main(argv));
}

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, enableStatic ? false, extraConfig ? ""}: { lib, stdenv, uclibc, fetchurl, enableStatic ? false, enableMinimal ? false, useUclibc ? false, extraConfig ? "" }:
let let
configParser = '' configParser = ''
@ -7,14 +7,7 @@ let
NAME=`echo "$LINE" | cut -d \ -f 1` NAME=`echo "$LINE" | cut -d \ -f 1`
OPTION=`echo "$LINE" | cut -d \ -f 2` OPTION=`echo "$LINE" | cut -d \ -f 2`
if test -z "$NAME"; then if ! [[ "$NAME" =~ ^CONFIG_ ]]; then continue; fi
continue
fi
if test "$NAME" == "CLEAR"; then
echo "parseconfig: CLEAR"
echo > .config
fi
echo "parseconfig: removing $NAME" echo "parseconfig: removing $NAME"
sed -i /$NAME'\(=\| \)'/d .config sed -i /$NAME'\(=\| \)'/d .config
@ -25,19 +18,6 @@ let
} }
''; '';
nixConfig = ''
CONFIG_PREFIX "$out"
CONFIG_INSTALL_NO_USR y
# Use the external mount.cifs program.
CONFIG_FEATURE_MOUNT_CIFS n
CONFIG_FEATURE_MOUNT_HELPERS y
'';
staticConfig = stdenv.lib.optionalString enableStatic ''
CONFIG_STATIC y
'';
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -48,17 +28,34 @@ stdenv.mkDerivation rec {
sha256 = "12v7nri79v8gns3inmz4k24q7pcnwi00hybs0wddfkcy1afh42xf"; sha256 = "12v7nri79v8gns3inmz4k24q7pcnwi00hybs0wddfkcy1afh42xf";
}; };
patches = [ ./busybox-in-store.patch ];
configurePhase = '' configurePhase = ''
export KCONFIG_NOTIMESTAMP=1 export KCONFIG_NOTIMESTAMP=1
make defconfig make ${if enableMinimal then "allnoconfig" else "defconfig"}
${configParser} ${configParser}
cat << EOF | parseconfig cat << EOF | parseconfig
${staticConfig}
${nixConfig} CONFIG_PREFIX "$out"
CONFIG_INSTALL_NO_USR y
${lib.optionalString enableStatic ''
CONFIG_STATIC y
''}
# Use the external mount.cifs program.
CONFIG_FEATURE_MOUNT_CIFS n
CONFIG_FEATURE_MOUNT_HELPERS y
${extraConfig} ${extraConfig}
$extraCrossConfig $extraCrossConfig
EOF EOF
make oldconfig make oldconfig
'' + lib.optionalString useUclibc ''
makeFlagsArray+=("CC=gcc -isystem ${uclibc}/include -B${uclibc}/lib -L${uclibc}/lib")
''; '';
crossAttrs = { crossAttrs = {
@ -75,8 +72,8 @@ stdenv.mkDerivation rec {
meta = { meta = {
description = "Tiny versions of common UNIX utilities in a single small executable"; description = "Tiny versions of common UNIX utilities in a single small executable";
homepage = http://busybox.net/; homepage = http://busybox.net/;
license = stdenv.lib.licenses.gpl2; license = lib.licenses.gpl2;
maintainers = with stdenv.lib.maintainers; [viric]; maintainers = [ lib.maintainers.viric ];
platforms = with stdenv.lib.platforms; linux; platforms = lib.platforms.linux;
}; };
} }

View File

@ -1,12 +0,0 @@
diff --git a/include/libbb.h b/include/libbb.h
index f12800f..e7806c2 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -40,6 +40,7 @@
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>

View File

@ -11,20 +11,10 @@ stdenv.mkDerivation {
sha256 = "8dd3de546aeb1ae42fb05409aeb724a145fe9aa1dbe1115441c2297c9d48cf31"; sha256 = "8dd3de546aeb1ae42fb05409aeb724a145fe9aa1dbe1115441c2297c9d48cf31";
}; };
configureFlags = configureFlags ="--enable-dynamic-e2fsck --enable-elf-shlibs";
if stdenv ? isDietLibC
then ""
else "--enable-dynamic-e2fsck --enable-elf-shlibs";
buildInputs = [gettext]; buildInputs = [gettext];
preInstall = "installFlagsArray=('LN=ln -s')"; preInstall = "installFlagsArray=('LN=ln -s')";
postInstall = "make install-libs"; postInstall = "make install-libs";
NIX_CFLAGS_COMPILE =
if stdenv ? isDietLibC then
"-UHAVE_SYS_PRCTL_H " +
(if stdenv.system == "x86_64-linux" then "-DHAVE_LSEEK64_PROTOTYPE=1 -Dstat64=stat" else "")
else "";
} }
#note that ext3cow requires the ext3cow kernel patch !!!! #note that ext3cow requires the ext3cow kernel patch !!!!

View File

@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux;
let let
version = "3.12.6"; version = "3.12.32";
kernelHeadersBaseConfig = kernelHeadersBaseConfig =
if cross == null if cross == null
@ -17,8 +17,8 @@ stdenv.mkDerivation {
name = "linux-headers-${version}"; name = "linux-headers-${version}";
src = fetchurl { src = fetchurl {
url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.bz2"; url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
sha256 = "1qh6f1az0flfrbkdjx1i9r7yf31ad0gxigax91nd33z2jmd6h4df"; sha256 = "1hzws2bf267hfk81ywqcxspkyi1lg56x63izdc0pv1338xcfas53";
}; };
targetConfig = if cross != null then cross.config else null; targetConfig = if cross != null then cross.config else null;

View File

@ -26,10 +26,6 @@ stdenv.mkDerivation {
postInstall = "rm $out/sbin/insmod.static"; # don't need it postInstall = "rm $out/sbin/insmod.static"; # don't need it
# We don't want bash (and therefore glibc) in the closure of the
# output, since we want to put this in a initrd.
dontPatchShebangs = stdenv ? isDietLibC;
meta = { meta = {
homepage = http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/; homepage = http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/;
description = "Tools for loading and managing Linux kernel modules"; description = "Tools for loading and managing Linux kernel modules";

View File

@ -16,11 +16,6 @@ let
continue continue
fi fi
if test "$NAME" == "CLEAR"; then
echo "parseconfig: CLEAR"
echo > .config
fi
echo "parseconfig: removing $NAME" echo "parseconfig: removing $NAME"
sed -i /^$NAME=/d .config sed -i /^$NAME=/d .config
@ -51,13 +46,14 @@ let
''; '';
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "uclibc-0.9.33.2" + stdenv.lib.optionalString (cross != null) name = "uclibc-0.9.34-pre-20141029" + stdenv.lib.optionalString (cross != null)
("-" + cross.config); ("-" + cross.config);
src = fetchurl { src = fetchurl {
url = http://www.uclibc.org/downloads/uClibc-0.9.33.2.tar.bz2; url = http://www.uclibc.org/downloads/snapshots/uClibc-20141029.tar.bz2;
sha256 = "0qhngsbzj2s6nz92b1s2p0dmvwk8xiqpy58j7ljzw186grvjr3cq"; sha256 = "018r3bhw1jyyihmm5xxq1psl3r5yx02a57p8qxvay3vvzxn2cvzm";
}; };
# 'ftw' needed to build acl, a coreutils dependency # 'ftw' needed to build acl, a coreutils dependency
@ -80,6 +76,8 @@ stdenv.mkDerivation {
buildInputs = stdenv.lib.optional (gccCross != null) gccCross; buildInputs = stdenv.lib.optional (gccCross != null) gccCross;
enableParallelBuilding = true;
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
make PREFIX=$out VERBOSE=1 install ${crossMakeFlag} make PREFIX=$out VERBOSE=1 install ${crossMakeFlag}
@ -92,7 +90,7 @@ stdenv.mkDerivation {
# Derivations may check for the existance of this attribute, to know what to link to. # Derivations may check for the existance of this attribute, to know what to link to.
inherit libiconv; inherit libiconv;
}; };
meta = { meta = {
homepage = http://www.uclibc.org/; homepage = http://www.uclibc.org/;
description = "A small implementation of the C library"; description = "A small implementation of the C library";

View File

@ -194,6 +194,11 @@ in
"--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.d" "--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.d"
"--with-udev-rules-dir=$(out)/lib/udev/rules.d" "--with-udev-rules-dir=$(out)/lib/udev/rules.d"
]; ];
patches = [( args.fetchpatch {
url = "http://cgit.freedesktop.org/xorg/driver/xf86-input-vmmouse/patch/"
+ "?id=1cbbc03c4b37d57760c57bd2e0b0f89d744a5795";
sha256 = "1qkhwj2yal0cz15lv9557d10ylvxlq05ibq43pm2rrvqdg3mb6h4";
})];
}; };
xf86videoati = attrs: attrs // { xf86videoati = attrs: attrs // {
@ -209,6 +214,11 @@ in
xf86videovmware = attrs: attrs // { xf86videovmware = attrs: attrs // {
buildInputs = attrs.buildInputs ++ [ args.mesa_drivers ]; # for libxatracker buildInputs = attrs.buildInputs ++ [ args.mesa_drivers ]; # for libxatracker
patches = [( args.fetchpatch {
url = "http://cgit.freedesktop.org/xorg/driver/xf86-video-vmware/patch/"
+ "?id=4664412d7a5266d2b392957406b34abc5db95e48";
sha256 = "1gix83f1is91iq1zd66nj4k72jm24jjjd9s9l0bzpzhgc8smqdk2";
})];
}; };
xf86videoqxl = attrs: attrs // { xf86videoqxl = attrs: attrs // {

View File

@ -29,63 +29,6 @@ rec {
overrideSetup = stdenv: setupScript: stdenv.override { inherit setupScript; }; overrideSetup = stdenv: setupScript: stdenv.override { inherit setupScript; };
# Return a modified stdenv that uses dietlibc to create small
# statically linked binaries.
useDietLibC = stdenv: stdenv //
{ mkDerivation = args: stdenv.mkDerivation (args // {
NIX_CFLAGS_LINK = "-static";
# libcompat.a contains some commonly used functions.
NIX_LDFLAGS = "-lcompat";
# These are added *after* the command-line flags, so we'll
# always optimise for size.
NIX_CFLAGS_COMPILE =
args.NIX_CFLAGS_COMPILE or ""
+ " -Os -s -D_BSD_SOURCE=1";
configureFlags =
args.configureFlags or ""
+ " --disable-shared"; # brrr...
NIX_GCC = import ../build-support/gcc-wrapper {
inherit stdenv;
libc = pkgs.dietlibc;
inherit (stdenv.gcc) gcc binutils nativeTools nativePrefix;
nativeLibc = false;
};
});
isDietLibC = true;
};
# Return a modified stdenv that uses klibc to create small
# statically linked binaries.
useKlibc = stdenv: klibc: stdenv //
{ mkDerivation = args: stdenv.mkDerivation (args // {
NIX_CFLAGS_LINK = "-static";
# These are added *after* the command-line flags, so we'll
# always optimise for size.
NIX_CFLAGS_COMPILE =
args.NIX_CFLAGS_COMPILE or "" + " -Os -s";
configureFlags =
args.configureFlags or "" + " --disable-shared"; # brrr...
NIX_GCC = pkgs.runCommand "klibc-wrapper" {} ''
mkdir -p $out/bin
ln -s ${klibc}/bin/klcc $out/bin/gcc
ln -s ${klibc}/bin/klcc $out/bin/cc
mkdir -p $out/nix-support
echo 'PATH=$PATH:${stdenv.gcc.binutils}/bin' > $out/nix-support/setup-hook
'';
});
isKlibc = true;
isStatic = true;
};
# Return a modified stdenv that tries to build statically linked # Return a modified stdenv that tries to build statically linked
# binaries. # binaries.
makeStaticBinaries = stdenv: stdenv // makeStaticBinaries = stdenv: stdenv //

View File

@ -1,39 +1,12 @@
let {
busybox = import <nix/fetchurl.nix> {
fetch = { file, sha256 }: import <nix/fetchurl.nix> { url = http://tarballs.nixos.org/stdenv-linux/i686/73b75f6157db79fc899154a497823e82e409e76d/busybox;
url = "http://tarballs.nixos.org/stdenv-linux/i686/r24519/${file}"; sha256 = "159208615405938d9830634f15d38adf5a9c33643926845c44499dbe6dd62042";
inherit sha256;
executable = true; executable = true;
}; };
in { bootstrapTools = import <nix/fetchurl.nix> {
sh = fetch { url = http://tarballs.nixos.org/stdenv-linux/i686/73b75f6157db79fc899154a497823e82e409e76d/bootstrap-tools.tar.xz;
file = "sh"; sha256 = "68c430b84dbeac0bd1bea4cdd3159dce44a76445e07860caed1972b4608c42ca";
sha256 = "1l6sdhyqjlh4m5gj3pfpi8aisp1m012lpwxfcc4v1x8g429mflmy";
};
bzip2 = fetch {
file = "bzip2";
sha256 = "1p5nkrdn52jm6rsx8x3wwjpsh83f2qsjl1qckkgnkplwhj23zjp7";
};
mkdir = fetch {
file = "mkdir";
sha256 = "02ff7i9ph9ahiapsg2v9c3pwr7sl73sk4n7ic112ljkrgwkail33";
};
cpio = fetch {
file = "cpio";
sha256 = "046if3aqqramyhrn2yxrjf4bfkl8x1bcqxhvi7ml9nrv9smx8irg";
};
curl = fetch {
file = "curl.bz2";
sha256 = "1v0yfb4gcdyqpl2fxlxjh337r28c23iqm7vwck4p4643xd55di7q";
};
bootstrapTools = {
url = http://tarballs.nixos.org/stdenv-linux/i686/r24519/bootstrap-tools.cpio.bz2;
sha256 = "0imypaxy6piwbk8ff2y1nr7yk49pqmdgdbv6g8miq1zs5yfip6ij";
}; };
} }

View File

@ -1,10 +1,9 @@
# Use the static tools for i686-linux. They work on x86_64-linux # Use busybox for i686-linux since it works on x86_64-linux as well.
# machines as well.
(import ./i686.nix) // (import ./i686.nix) //
{ {
bootstrapTools = { bootstrapTools = import <nix/fetchurl.nix> {
url = http://tarballs.nixos.org/stdenv-linux/x86_64/r23302/bootstrap-tools.cpio.bz2; url = http://tarballs.nixos.org/stdenv-linux/x86_64/73b75f6157db79fc899154a497823e82e409e76d/bootstrap-tools.tar.xz;
sha256 = "0w89kqhx47yl0jifp2vffp073pyrqha5f312kp971smi4h41drna"; sha256 = "e29d47a5dc9f1ff10c3fbaacbd03a3cca0c784299df09fcdd9e25797ec6414ad";
}; };
} }

View File

@ -40,20 +40,15 @@ rec {
bootstrapTools = derivation { bootstrapTools = derivation {
name = "bootstrap-tools"; name = "bootstrap-tools";
builder = bootstrapFiles.sh; builder = bootstrapFiles.busybox;
args = args =
if system == "armv5tel-linux" || system == "armv6l-linux" if system == "armv5tel-linux" || system == "armv6l-linux"
|| system == "armv7l-linux" || system == "armv7l-linux"
then [ ./scripts/unpack-bootstrap-tools-arm.sh ] then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
else [ ./scripts/unpack-bootstrap-tools.sh ]; else [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
# FIXME: get rid of curl. tarball = bootstrapFiles.bootstrapTools;
inherit (bootstrapFiles) bzip2 mkdir curl cpio;
tarball = import <nix/fetchurl.nix> {
inherit (bootstrapFiles.bootstrapTools) url sha256;
};
inherit system; inherit system;

View File

@ -1,4 +1,4 @@
{system ? builtins.currentSystem}: { system ? builtins.currentSystem }:
with import ../../top-level/all-packages.nix {inherit system;}; with import ../../top-level/all-packages.nix {inherit system;};
@ -6,84 +6,32 @@ rec {
# We want coreutils without ACL support. # We want coreutils without ACL support.
coreutils_ = coreutils.override (args: { coreutilsMinimal = coreutils.override (args: {
aclSupport = false; aclSupport = false;
}); });
# bzip2 wants utime.h, a header 'legacy' in uclibc curlMinimal = curl.override {
uclibcForBzip2 = uclibc.override {
extraConfig = ''
UCLIBC_SUSV3_LEGACY y
UCLIBC_SUSV4_LEGACY y
'';
};
gccLinkStatic = wrapGCCWith (import ../../build-support/gcc-wrapper) uclibcForBzip2
stdenv.gcc.gcc;
stdenvLinkStatic = overrideGCC stdenv gccLinkStatic;
curlStatic = import ../../tools/networking/curl {
stdenv = stdenvLinkStatic;
inherit fetchurl;
zlibSupport = false; zlibSupport = false;
sslSupport = false; sslSupport = false;
linkStatic = true; scpSupport = false;
}; };
busyboxMinimal = busybox.override {
bzip2Static = import ../../tools/compression/bzip2 { useUclibc = true;
stdenv = stdenvLinkStatic; enableStatic = true;
inherit fetchurl; enableMinimal = true;
linkStatic = true;
};
#gccNoShared = wrapGCC ( gcc.gcc.override { enableShared = false; } );
busyboxStaticSh = busybox.override {
extraConfig = '' extraConfig = ''
CLEAR
CONFIG_STATIC y
CONFIG_ASH y CONFIG_ASH y
CONFIG_BASH_COMPAT y
CONFIG_ASH_ALIAS y
CONFIG_ASH_GETOPTS y
CONFIG_ASH_CMDCMD y
CONFIG_ASH_JOB_CONTROL y
CONFIG_ASH_BUILTIN_ECHO y CONFIG_ASH_BUILTIN_ECHO y
CONFIG_ASH_BUILTIN_PRINTF y
CONFIG_ASH_BUILTIN_TEST y CONFIG_ASH_BUILTIN_TEST y
''; CONFIG_ASH_OPTIMIZE_FOR_SIZE y
};
busyboxStaticLn = busybox.override {
extraConfig = ''
CLEAR
CONFIG_STATIC y
CONFIG_LN y
'';
};
busyboxStaticMkdir = busybox.override {
extraConfig = ''
CLEAR
CONFIG_STATIC y
CONFIG_MKDIR y CONFIG_MKDIR y
CONFIG_TAR y
CONFIG_UNXZ y
''; '';
}; };
busyboxStaticCpio = busybox.override { build =
extraConfig = ''
CLEAR
CONFIG_STATIC y
CONFIG_CPIO y
# (shlevy) Are these necessary?
CONFIG_FEATURE_CPIO_O y
CONFIG_FEATURE_CPIO_P y
'';
};
build =
stdenv.mkDerivation { stdenv.mkDerivation {
name = "build"; name = "build";
@ -91,7 +39,7 @@ rec {
buildInputs = [nukeReferences cpio]; buildInputs = [nukeReferences cpio];
buildCommand = '' buildCommand = ''
set -x set -x
mkdir -p $out/bin $out/lib $out/libexec mkdir -p $out/bin $out/lib $out/libexec
# Copy what we need of Glibc. # Copy what we need of Glibc.
@ -105,26 +53,26 @@ rec {
cp -d ${glibc}/lib/libnsl*.so* $out/lib cp -d ${glibc}/lib/libnsl*.so* $out/lib
cp -d ${glibc}/lib/libutil*.so* $out/lib cp -d ${glibc}/lib/libutil*.so* $out/lib
cp -d ${glibc}/lib/crt?.o $out/lib cp -d ${glibc}/lib/crt?.o $out/lib
cp -rL ${glibc}/include $out cp -rL ${glibc}/include $out
chmod -R u+w $out/include chmod -R u+w $out/include
# Hopefully we won't need these. # Hopefully we won't need these.
rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video
find $out/include -name .install -exec rm {} \; find $out/include -name .install -exec rm {} \;
find $out/include -name ..install.cmd -exec rm {} \; find $out/include -name ..install.cmd -exec rm {} \;
mv $out/include $out/include-glibc mv $out/include $out/include-glibc
# Copy coreutils, bash, etc. # Copy coreutils, bash, etc.
cp ${coreutils_}/bin/* $out/bin cp ${coreutilsMinimal}/bin/* $out/bin
(cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users) (cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users)
cp ${bash}/bin/bash $out/bin cp ${bash}/bin/bash $out/bin
cp ${findutils}/bin/find $out/bin cp ${findutils}/bin/find $out/bin
cp ${findutils}/bin/xargs $out/bin cp ${findutils}/bin/xargs $out/bin
cp -d ${diffutils}/bin/* $out/bin cp -d ${diffutils}/bin/* $out/bin
cp -d ${gnused}/bin/* $out/bin cp -d ${gnused}/bin/* $out/bin
cp -d ${gnugrep}/bin/* $out/bin cp -d ${gnugrep}/bin/grep $out/bin
cp ${gawk}/bin/gawk $out/bin cp ${gawk}/bin/gawk $out/bin
cp -d ${gawk}/bin/awk $out/bin cp -d ${gawk}/bin/awk $out/bin
cp ${gnutar}/bin/tar $out/bin cp ${gnutar}/bin/tar $out/bin
@ -133,9 +81,11 @@ rec {
cp -d ${gnumake}/bin/* $out/bin cp -d ${gnumake}/bin/* $out/bin
cp -d ${patch}/bin/* $out/bin cp -d ${patch}/bin/* $out/bin
cp ${patchelf}/bin/* $out/bin cp ${patchelf}/bin/* $out/bin
cp ${curlMinimal}/bin/curl $out/bin
cp -d ${curlMinimal}/lib/libcurl* $out/lib
cp -d ${gnugrep.pcre}/lib/libpcre*.so* $out/lib # needed by grep cp -d ${gnugrep.pcre}/lib/libpcre*.so* $out/lib # needed by grep
# Copy what we need of GCC. # Copy what we need of GCC.
cp -d ${gcc.gcc}/bin/gcc $out/bin cp -d ${gcc.gcc}/bin/gcc $out/bin
cp -d ${gcc.gcc}/bin/cpp $out/bin cp -d ${gcc.gcc}/bin/cpp $out/bin
@ -151,6 +101,8 @@ rec {
rm -rf $out/lib/gcc/*/*/plugin rm -rf $out/lib/gcc/*/*/plugin
#rm -f $out/lib/gcc/*/*/*.a #rm -f $out/lib/gcc/*/*/*.a
cp -rd ${gcc.gcc}/libexec/* $out/libexec cp -rd ${gcc.gcc}/libexec/* $out/libexec
chmod -R u+w $out/libexec
rm -rf $out/libexec/gcc/*/*/plugin
mkdir $out/include mkdir $out/include
cp -rd ${gcc.gcc}/include/c++ $out/include cp -rd ${gcc.gcc}/include/c++ $out/include
chmod -R u+w $out/include chmod -R u+w $out/include
@ -159,19 +111,18 @@ rec {
cp -d ${gmpxx}/lib/libgmp*.so* $out/lib cp -d ${gmpxx}/lib/libgmp*.so* $out/lib
cp -d ${mpfr}/lib/libmpfr*.so* $out/lib cp -d ${mpfr}/lib/libmpfr*.so* $out/lib
cp -d ${ppl}/lib/libppl*.so* $out/lib
cp -d ${cloogppl}/lib/libcloog*.so* $out/lib
cp -d ${mpc}/lib/libmpc*.so* $out/lib cp -d ${mpc}/lib/libmpc*.so* $out/lib
cp -d ${zlib}/lib/libz.so* $out/lib cp -d ${zlib}/lib/libz.so* $out/lib
cp -d ${libelf}/lib/libelf.so* $out/lib cp -d ${libelf}/lib/libelf.so* $out/lib
# Copy binutils. # Copy binutils.
for i in as ld ar ranlib nm strip readelf objdump; do for i in as ld ar ranlib nm strip readelf objdump; do
cp ${binutils}/bin/$i $out/bin cp ${binutils}/bin/$i $out/bin
done done
cp -d ${binutils}/lib/lib*.so* $out/lib
chmod -R u+w $out chmod -R u+w $out
# Strip executables even further. # Strip executables even further.
for i in $out/bin/* $out/libexec/gcc/*/*/*; do for i in $out/bin/* $out/libexec/gcc/*/*/*; do
if test -x $i -a ! -L $i; then if test -x $i -a ! -L $i; then
@ -189,19 +140,10 @@ rec {
mv $out/.pack $out/pack mv $out/.pack $out/pack
mkdir $out/on-server mkdir $out/on-server
(cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2 tar cvfJ $out/on-server/bootstrap-tools.tar.xz -C $out/pack .
cp ${busyboxMinimal}/bin/busybox $out/on-server
mkdir $out/in-nixpkgs chmod u+w $out/on-server/busybox
cp ${busyboxStaticSh}/bin/busybox $out/in-nixpkgs/sh nuke-refs $out/on-server/busybox
cp ${busyboxStaticCpio}/bin/busybox $out/in-nixpkgs/cpio
cp ${busyboxStaticMkdir}/bin/busybox $out/in-nixpkgs/mkdir
cp ${busyboxStaticLn}/bin/busybox $out/in-nixpkgs/ln
cp ${curlStatic}/bin/curl $out/in-nixpkgs
cp ${bzip2Static}/bin/bzip2 $out/in-nixpkgs
chmod u+w $out/in-nixpkgs/*
strip $out/in-nixpkgs/*
nuke-refs $out/in-nixpkgs/*
bzip2 $out/in-nixpkgs/curl
''; # */ ''; # */
# The result should not contain any references (store paths) so # The result should not contain any references (store paths) so
@ -210,22 +152,33 @@ rec {
allowedReferences = []; allowedReferences = [];
}; };
unpack = unpack =
stdenv.mkDerivation { derivation {
name = "unpack"; name = "unpack";
inherit system;
builder = "${build}/on-server/busybox";
args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ];
buildCommand = '' buildCommand = ''
${build}/in-nixpkgs/mkdir $out export PATH=${build}/on-server:$out/bin
${build}/in-nixpkgs/bzip2 -d < ${build}/on-server/bootstrap-tools.cpio.bz2 | (cd $out && ${build}/in-nixpkgs/cpio -v -i)
busybox mkdir $out
< ${build}/on-server/bootstrap-tools.tar.xz busybox unxz | busybox tar x -C $out
for i in $out/bin/* $out/libexec/gcc/*/*/*; do for i in $out/bin/* $out/libexec/gcc/*/*/*; do
echo patching $i if [ -L "$i" ]; then continue; fi
if ! test -L $i; then if [ -z "''${i##*/liblto*}" ]; then continue; fi
LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \ echo patching "$i"
$out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.2 --set-rpath $out/lib --force-rpath $i LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \
fi $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.2 --set-rpath $out/lib --force-rpath "$i"
done
for i in $out/lib/libpcre*; do
if [ -L "$i" ]; then continue; fi
echo patching "$i"
$out/bin/patchelf --set-rpath $out/lib --force-rpath "$i"
done done
# Fix the libc linker script. # Fix the libc linker script.
@ -241,11 +194,12 @@ rec {
test = test =
stdenv.mkDerivation { derivation {
name = "test"; name = "test";
inherit system;
builder = "${build}/on-server/busybox";
args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ];
realBuilder = "${unpack}/bin/bash";
buildCommand = '' buildCommand = ''
export PATH=${unpack}/bin export PATH=${unpack}/bin
ls -l ls -l
@ -259,23 +213,22 @@ rec {
awk --version awk --version
grep --version grep --version
gcc --version gcc --version
curl --version
${build}/in-nixpkgs/sh -c 'echo Hello World'
ldlinux=$(echo ${unpack}/lib/ld-linux*.so.2) ldlinux=$(echo ${unpack}/lib/ld-linux*.so.2)
export CPP="cpp -idirafter ${unpack}/include-glibc -B${unpack}" export CPP="cpp -idirafter ${unpack}/include-glibc -B${unpack}"
export CC="gcc -idirafter ${unpack}/include-glibc -B${unpack} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${unpack}/lib" export CC="gcc -idirafter ${unpack}/include-glibc -B${unpack} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${unpack}/lib"
export CXX="g++ -idirafter ${unpack}/include-glibc -B${unpack} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${unpack}/lib" export CXX="g++ -idirafter ${unpack}/include-glibc -B${unpack} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${unpack}/lib"
echo '#include <stdio.h>' >> foo.c echo '#include <stdio.h>' >> foo.c
echo '#include <limits.h>' >> foo.c echo '#include <limits.h>' >> foo.c
echo 'int main() { printf("Hello World\n"); return 0; }' >> foo.c echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c
$CC -o $out/bin/foo foo.c $CC -o $out/bin/foo foo.c
$out/bin/foo $out/bin/foo
echo '#include <iostream>' >> bar.cc echo '#include <iostream>' >> bar.cc
echo 'int main() { std::cout << "Hello World\n"; }' >> bar.cc echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc
$CXX -v -o $out/bin/bar bar.cc $CXX -v -o $out/bin/bar bar.cc
$out/bin/bar $out/bin/bar
@ -286,5 +239,5 @@ rec {
make install make install
''; # */ ''; # */
}; };
} }

View File

@ -1,9 +1,7 @@
set -e
# Unpack the bootstrap tools tarball. # Unpack the bootstrap tools tarball.
echo Unpacking the bootstrap tools... echo Unpacking the bootstrap tools...
$mkdir $out $builder mkdir $out
$bzip2 -d < $tarball | (cd $out && $cpio -i) < $tarball $builder unxz | $builder tar x -C $out
# Set the ELF interpreter / RPATH in the bootstrap binaries. # Set the ELF interpreter / RPATH in the bootstrap binaries.
echo Patching the bootstrap tools... echo Patching the bootstrap tools...
@ -21,32 +19,17 @@ fi
LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/cp $out/bin/patchelf . LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/cp $out/bin/patchelf .
for i in $out/bin/* $out/libexec/gcc/*/*/*; do for i in $out/bin/* $out/libexec/gcc/*/*/*; do
echo patching $i if [ -L "$i" ]; then continue; fi
if ! test -L $i; then if [ -z "${i##*/liblto*}" ]; then continue; fi
LD_LIBRARY_PATH=$out/lib $LD_BINARY \ echo patching "$i"
$out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \
LD_LIBRARY_PATH=$out/lib $LD_BINARY \ $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i"
$out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i
fi
done
for i in $out/lib/librt* ; do
echo patching $i
if ! test -L $i; then
LD_LIBRARY_PATH=$out/lib $LD_BINARY \
$out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i
LD_LIBRARY_PATH=$out/lib $LD_BINARY \
$out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i
fi
done done
for i in $out/lib/libgmp* $out/lib/libppl* $out/lib/libcloog* $out/lib/libmpc* $out/lib/libpcre* $out/lib/libstdc++*.so.*[0-9]; do for i in $out/lib/libpcre*; do
echo trying to patch $i if [ -L "$i" ]; then continue; fi
if test -f $i -a ! -L $i; then echo patching "$i"
LD_LIBRARY_PATH=$out/lib $LD_BINARY \ $out/bin/patchelf --set-rpath $out/lib --force-rpath "$i"
$out/bin/patchelf --set-rpath $out/lib --force-rpath $i
LD_LIBRARY_PATH=$out/lib $LD_BINARY \
$out/bin/patchelf --set-rpath $out/lib --force-rpath $i
fi
done done
# Fix the libc linker script. # Fix the libc linker script.
@ -60,13 +43,21 @@ mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so
ln -s bash $out/bin/sh ln -s bash $out/bin/sh
ln -s bzip2 $out/bin/bunzip2 ln -s bzip2 $out/bin/bunzip2
# Mimic the gunzip script as in gzip installations # Provide a gunzip script.
cat > $out/bin/gunzip <<EOF cat > $out/bin/gunzip <<EOF
#!$out/bin/sh #!$out/bin/sh
exec $out/bin/gzip -d "\$@" exec $out/bin/gzip -d "\$@"
EOF EOF
chmod +x $out/bin/gunzip chmod +x $out/bin/gunzip
# fetchurl needs curl. # Provide fgrep/egrep.
bzip2 -d < $curl > $out/bin/curl echo "#! $out/bin/sh" > $out/bin/egrep
chmod +x $out/bin/curl echo "exec $out/bin/grep -E \"\$@\"" >> $out/bin/egrep
echo "#! $out/bin/sh" > $out/bin/fgrep
echo "exec $out/bin/grep -F \"\$@\"" >> $out/bin/fgrep
# Provide xz (actually only xz -d will work).
echo "#! $out/bin/sh" > $out/bin/xz
echo "exec $builder unxz \"\$@\"" >> $out/bin/xz
chmod +x $out/bin/egrep $out/bin/fgrep $out/bin/xz

View File

@ -24,7 +24,7 @@ stdenv.mkDerivation {
}; };
sharedLibrary = sharedLibrary =
!stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic; !stdenv.isDarwin && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic;
patchPhase = stdenv.lib.optionalString stdenv.isDarwin "substituteInPlace Makefile --replace 'CC=gcc' 'CC=clang'"; patchPhase = stdenv.lib.optionalString stdenv.isDarwin "substituteInPlace Makefile --replace 'CC=gcc' 'CC=clang'";

View File

@ -12,8 +12,6 @@ stdenv.mkDerivation rec {
buildInputs = [ zlib xz ]; buildInputs = [ zlib xz ];
preBuild = "cd squashfs-tools"; preBuild = "cd squashfs-tools";
NIX_LDFLAGS = "-lgcc_s"; # for pthread_cancel
installFlags = "INSTALL_DIR=\${out}/bin"; installFlags = "INSTALL_DIR=\${out}/bin";

View File

@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
-e "s|/usr/src/unifont.bdf|$PWD/unifont.bdf|g" -e "s|/usr/src/unifont.bdf|$PWD/unifont.bdf|g"
''; '';
patches = [ ./fix-bash-completion.patch ]; patches = [ ./fix-bash-completion.patch ./glibc-2.20.patch ];
configureFlags = optional zfsSupport "--enable-libzfs" configureFlags = optional zfsSupport "--enable-libzfs"
++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystems.${stdenv.system}.target}" "--program-prefix=" ]; ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystems.${stdenv.system}.target}" "--program-prefix=" ];

View File

@ -0,0 +1,29 @@
* grub-core/kern/emu/hostfs.c: squahes below warning
warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use
_DEFAULT_SOURCE"
Signed-off-by: Khem Raj <address@hidden>
Upstream-Status: Submitted
---
grub-core/kern/emu/hostfs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/grub-core/kern/emu/hostfs.c b/grub-core/kern/emu/hostfs.c
index 7e725f6..823116d 100644
--- a/grub-core/kern/emu/hostfs.c
+++ b/grub-core/kern/emu/hostfs.c
@@ -19,7 +19,11 @@
#include <config-util.h>
+/* Legacy feature macro.*/
#define _BSD_SOURCE
+/* New feature macro that provides everything _BSD_SOURCE and
+ * _SVID_SOURCE provided and possibly more. */
+#define _DEFAULT_SOURCE
#include <grub/fs.h>
#include <grub/file.h>
#include <grub/disk.h>
--
2.1.0

View File

@ -43,7 +43,6 @@ stdenv.mkDerivation rec {
dontDisableStatic = linkStatic; dontDisableStatic = linkStatic;
CFLAGS = if stdenv ? isDietLibC then "-DHAVE_INET_NTOA_R_2_ARGS=1" else "";
LDFLAGS = if linkStatic then "-static" else ""; LDFLAGS = if linkStatic then "-static" else "";
CXX = "g++"; CXX = "g++";
CXXCPP = "g++ -E"; CXXCPP = "g++ -E";

View File

@ -4,7 +4,6 @@
, scpSupport ? false, libssh2 ? null , scpSupport ? false, libssh2 ? null
, gssSupport ? false, gss ? null , gssSupport ? false, gss ? null
, c-aresSupport ? false, c-ares ? null , c-aresSupport ? false, c-ares ? null
, linkStatic ? false
}: }:
assert zlibSupport -> zlib != null; assert zlibSupport -> zlib != null;
@ -41,30 +40,18 @@ stdenv.mkDerivation rec {
( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" ) ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" )
] ]
++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}" ++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}"
++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}" ++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}";
++ stdenv.lib.optionals linkStatic [ "--enable-static" "--disable-shared" ]
;
dontDisableStatic = linkStatic;
CFLAGS = if stdenv ? isDietLibC then "-DHAVE_INET_NTOA_R_2_ARGS=1" else "";
LDFLAGS = if linkStatic then "-static" else "";
CXX = "g++"; CXX = "g++";
CXXCPP = "g++ -E"; CXXCPP = "g++ -E";
# libtool hack to get a static binary. Notice that to 'configure' I passed
# other LDFLAGS, because it doesn't use libtool for linking in the tests.
makeFlags = if linkStatic then "LDFLAGS=-all-static" else "";
crossAttrs = { crossAttrs = {
# We should refer to the cross built openssl # We should refer to the cross built openssl
# For the 'urandom', maybe it should be a cross-system option # For the 'urandom', maybe it should be a cross-system option
configureFlags = [ configureFlags = [
( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" ) ( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" )
"--with-random /dev/urandom" "--with-random /dev/urandom"
] ];
++ stdenv.lib.optionals linkStatic [ "--enable-static" "--disable-shared" ]
;
}; };
passthru = { passthru = {

View File

@ -5178,7 +5178,7 @@ let
glfw2 = callPackage ../development/libraries/glfw/2.x.nix { }; glfw2 = callPackage ../development/libraries/glfw/2.x.nix { };
glfw3 = callPackage ../development/libraries/glfw/3.x.nix { }; glfw3 = callPackage ../development/libraries/glfw/3.x.nix { };
glibc = callPackage ../development/libraries/glibc/2.19 { glibc = callPackage ../development/libraries/glibc {
kernelHeaders = linuxHeaders; kernelHeaders = linuxHeaders;
installLocales = config.glibc.locales or false; installLocales = config.glibc.locales or false;
machHeaders = null; machHeaders = null;
@ -5186,13 +5186,13 @@ let
gccCross = null; gccCross = null;
}; };
glibc_memusage = callPackage ../development/libraries/glibc/2.19 { glibc_memusage = callPackage ../development/libraries/glibc {
kernelHeaders = linuxHeaders; kernelHeaders = linuxHeaders;
installLocales = false; installLocales = false;
withGd = true; withGd = true;
}; };
glibcCross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.19) glibcCross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc)
(let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu"; (let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
in { in {
inherit stdenv fetchurl; inherit stdenv fetchurl;
@ -5220,11 +5220,11 @@ let
installLocales = config.glibc.locales or false; installLocales = config.glibc.locales or false;
}; };
glibcLocales = callPackage ../development/libraries/glibc/2.19/locales.nix { }; glibcLocales = callPackage ../development/libraries/glibc/locales.nix { };
glibcInfo = callPackage ../development/libraries/glibc/2.19/info.nix { }; glibcInfo = callPackage ../development/libraries/glibc/info.nix { };
glibc_multi = callPackage ../development/libraries/glibc/2.19/multi.nix { glibc_multi = callPackage ../development/libraries/glibc/multi.nix {
inherit glibc; inherit glibc;
glibc32 = (import ./all-packages.nix {system = "i686-linux";}).glibc; glibc32 = (import ./all-packages.nix {system = "i686-linux";}).glibc;
}; };
@ -8073,7 +8073,7 @@ let
# -- Linux kernel expressions ------------------------------------------------ # -- Linux kernel expressions ------------------------------------------------
linuxHeaders = linuxHeaders_3_7; linuxHeaders = linuxHeaders_3_12;
linuxHeaders24Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.4.nix { linuxHeaders24Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.4.nix {
inherit stdenv fetchurl perl; inherit stdenv fetchurl perl;
@ -8085,7 +8085,7 @@ let
cross = assert crossSystem != null; crossSystem; cross = assert crossSystem != null; crossSystem;
}); });
linuxHeaders_3_7 = callPackage ../os-specific/linux/kernel-headers/3.7.nix { }; linuxHeaders_3_12 = callPackage ../os-specific/linux/kernel-headers/3.12.nix { };
linuxHeaders_3_14 = callPackage ../os-specific/linux/kernel-headers/3.14.nix { }; linuxHeaders_3_14 = callPackage ../os-specific/linux/kernel-headers/3.14.nix { };