From 1b55b07eeb43ba41470eed1ce21991df96110e70 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Oct 2014 11:34:38 +0100 Subject: [PATCH 01/26] glibc/2.19 -> glibc We only have one version of Glibc so no need for a separate directory. --- .../libraries/glibc/{2.19 => }/builder.sh | 0 .../libraries/glibc/{2.19 => }/common.nix | 0 .../libraries/glibc/{2.19 => }/cve-2014-0475.patch | 0 .../libraries/glibc/{2.19 => }/cve-2014-5119.patch | 0 .../libraries/glibc/{2.19 => }/default.nix | 0 .../{2.19 => }/dont-use-system-ld-so-cache.patch | 0 .../{2.19 => }/dont-use-system-ld-so-preload.patch | 0 .../libraries/glibc/{2.19 => }/fix-math.patch | 0 .../{2.19 => }/fix_path_attribute_in_getconf.patch | 0 .../glibc/{2.19 => }/glibc-crypt-blowfish.patch | 0 .../glibc-remove-date-from-compilation-banner.patch | 0 .../{2.19 => }/glibc-remove-datetime-from-nscd.patch | 0 pkgs/development/libraries/glibc/{2.19 => }/info.nix | 0 .../libraries/glibc/{2.19 => }/locales-builder.sh | 0 .../libraries/glibc/{2.19 => }/locales.nix | 0 .../development/libraries/glibc/{2.19 => }/multi.nix | 0 .../glibc/{2.19 => }/nix-locale-archive.patch | 0 .../libraries/glibc/{2.19 => }/rpcgen-path.patch | 0 pkgs/top-level/all-packages.nix | 12 ++++++------ 19 files changed, 6 insertions(+), 6 deletions(-) rename pkgs/development/libraries/glibc/{2.19 => }/builder.sh (100%) rename pkgs/development/libraries/glibc/{2.19 => }/common.nix (100%) rename pkgs/development/libraries/glibc/{2.19 => }/cve-2014-0475.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/cve-2014-5119.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/default.nix (100%) rename pkgs/development/libraries/glibc/{2.19 => }/dont-use-system-ld-so-cache.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/dont-use-system-ld-so-preload.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/fix-math.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/fix_path_attribute_in_getconf.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/glibc-crypt-blowfish.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/glibc-remove-date-from-compilation-banner.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/glibc-remove-datetime-from-nscd.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/info.nix (100%) rename pkgs/development/libraries/glibc/{2.19 => }/locales-builder.sh (100%) rename pkgs/development/libraries/glibc/{2.19 => }/locales.nix (100%) rename pkgs/development/libraries/glibc/{2.19 => }/multi.nix (100%) rename pkgs/development/libraries/glibc/{2.19 => }/nix-locale-archive.patch (100%) rename pkgs/development/libraries/glibc/{2.19 => }/rpcgen-path.patch (100%) diff --git a/pkgs/development/libraries/glibc/2.19/builder.sh b/pkgs/development/libraries/glibc/builder.sh similarity index 100% rename from pkgs/development/libraries/glibc/2.19/builder.sh rename to pkgs/development/libraries/glibc/builder.sh diff --git a/pkgs/development/libraries/glibc/2.19/common.nix b/pkgs/development/libraries/glibc/common.nix similarity index 100% rename from pkgs/development/libraries/glibc/2.19/common.nix rename to pkgs/development/libraries/glibc/common.nix diff --git a/pkgs/development/libraries/glibc/2.19/cve-2014-0475.patch b/pkgs/development/libraries/glibc/cve-2014-0475.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/cve-2014-0475.patch rename to pkgs/development/libraries/glibc/cve-2014-0475.patch diff --git a/pkgs/development/libraries/glibc/2.19/cve-2014-5119.patch b/pkgs/development/libraries/glibc/cve-2014-5119.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/cve-2014-5119.patch rename to pkgs/development/libraries/glibc/cve-2014-5119.patch diff --git a/pkgs/development/libraries/glibc/2.19/default.nix b/pkgs/development/libraries/glibc/default.nix similarity index 100% rename from pkgs/development/libraries/glibc/2.19/default.nix rename to pkgs/development/libraries/glibc/default.nix diff --git a/pkgs/development/libraries/glibc/2.19/dont-use-system-ld-so-cache.patch b/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/dont-use-system-ld-so-cache.patch rename to pkgs/development/libraries/glibc/dont-use-system-ld-so-cache.patch diff --git a/pkgs/development/libraries/glibc/2.19/dont-use-system-ld-so-preload.patch b/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/dont-use-system-ld-so-preload.patch rename to pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch diff --git a/pkgs/development/libraries/glibc/2.19/fix-math.patch b/pkgs/development/libraries/glibc/fix-math.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/fix-math.patch rename to pkgs/development/libraries/glibc/fix-math.patch diff --git a/pkgs/development/libraries/glibc/2.19/fix_path_attribute_in_getconf.patch b/pkgs/development/libraries/glibc/fix_path_attribute_in_getconf.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/fix_path_attribute_in_getconf.patch rename to pkgs/development/libraries/glibc/fix_path_attribute_in_getconf.patch diff --git a/pkgs/development/libraries/glibc/2.19/glibc-crypt-blowfish.patch b/pkgs/development/libraries/glibc/glibc-crypt-blowfish.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/glibc-crypt-blowfish.patch rename to pkgs/development/libraries/glibc/glibc-crypt-blowfish.patch diff --git a/pkgs/development/libraries/glibc/2.19/glibc-remove-date-from-compilation-banner.patch b/pkgs/development/libraries/glibc/glibc-remove-date-from-compilation-banner.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/glibc-remove-date-from-compilation-banner.patch rename to pkgs/development/libraries/glibc/glibc-remove-date-from-compilation-banner.patch diff --git a/pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch b/pkgs/development/libraries/glibc/glibc-remove-datetime-from-nscd.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/glibc-remove-datetime-from-nscd.patch rename to pkgs/development/libraries/glibc/glibc-remove-datetime-from-nscd.patch diff --git a/pkgs/development/libraries/glibc/2.19/info.nix b/pkgs/development/libraries/glibc/info.nix similarity index 100% rename from pkgs/development/libraries/glibc/2.19/info.nix rename to pkgs/development/libraries/glibc/info.nix diff --git a/pkgs/development/libraries/glibc/2.19/locales-builder.sh b/pkgs/development/libraries/glibc/locales-builder.sh similarity index 100% rename from pkgs/development/libraries/glibc/2.19/locales-builder.sh rename to pkgs/development/libraries/glibc/locales-builder.sh diff --git a/pkgs/development/libraries/glibc/2.19/locales.nix b/pkgs/development/libraries/glibc/locales.nix similarity index 100% rename from pkgs/development/libraries/glibc/2.19/locales.nix rename to pkgs/development/libraries/glibc/locales.nix diff --git a/pkgs/development/libraries/glibc/2.19/multi.nix b/pkgs/development/libraries/glibc/multi.nix similarity index 100% rename from pkgs/development/libraries/glibc/2.19/multi.nix rename to pkgs/development/libraries/glibc/multi.nix diff --git a/pkgs/development/libraries/glibc/2.19/nix-locale-archive.patch b/pkgs/development/libraries/glibc/nix-locale-archive.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/nix-locale-archive.patch rename to pkgs/development/libraries/glibc/nix-locale-archive.patch diff --git a/pkgs/development/libraries/glibc/2.19/rpcgen-path.patch b/pkgs/development/libraries/glibc/rpcgen-path.patch similarity index 100% rename from pkgs/development/libraries/glibc/2.19/rpcgen-path.patch rename to pkgs/development/libraries/glibc/rpcgen-path.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 37237470c9b..f586b260422 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5072,7 +5072,7 @@ let glfw2 = callPackage ../development/libraries/glfw/2.x.nix { }; glfw3 = callPackage ../development/libraries/glfw/3.x.nix { }; - glibc = callPackage ../development/libraries/glibc/2.19 { + glibc = callPackage ../development/libraries/glibc { kernelHeaders = linuxHeaders; installLocales = config.glibc.locales or false; machHeaders = null; @@ -5080,13 +5080,13 @@ let gccCross = null; }; - glibc_memusage = callPackage ../development/libraries/glibc/2.19 { + glibc_memusage = callPackage ../development/libraries/glibc { kernelHeaders = linuxHeaders; installLocales = false; 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"; in { inherit stdenv fetchurl; @@ -5114,11 +5114,11 @@ let 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; glibc32 = (import ./all-packages.nix {system = "i686-linux";}).glibc; }; From 54e727133a5a1d599d5e4ecdbb3b2ae01bcb42bd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Oct 2014 12:31:53 +0100 Subject: [PATCH 02/26] Remove tabs/whitespace --- pkgs/stdenv/linux/make-bootstrap-tools.nix | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 9116b222569..820fc978bda 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -83,7 +83,7 @@ rec { ''; }; - build = + build = stdenv.mkDerivation { name = "build"; @@ -91,7 +91,7 @@ rec { buildInputs = [nukeReferences cpio]; buildCommand = '' - set -x + set -x mkdir -p $out/bin $out/lib $out/libexec # Copy what we need of Glibc. @@ -105,20 +105,20 @@ rec { cp -d ${glibc}/lib/libnsl*.so* $out/lib cp -d ${glibc}/lib/libutil*.so* $out/lib cp -d ${glibc}/lib/crt?.o $out/lib - + cp -rL ${glibc}/include $out chmod -R u+w $out/include - + # Hopefully we won't need these. 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.cmd -exec rm {} \; mv $out/include $out/include-glibc - + # Copy coreutils, bash, etc. cp ${coreutils_}/bin/* $out/bin (cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users) - + cp ${bash}/bin/bash $out/bin cp ${findutils}/bin/find $out/bin cp ${findutils}/bin/xargs $out/bin @@ -135,7 +135,7 @@ rec { cp ${patchelf}/bin/* $out/bin cp -d ${gnugrep.pcre}/lib/libpcre*.so* $out/lib # needed by grep - + # Copy what we need of GCC. cp -d ${gcc.gcc}/bin/gcc $out/bin cp -d ${gcc.gcc}/bin/cpp $out/bin @@ -164,14 +164,14 @@ rec { cp -d ${mpc}/lib/libmpc*.so* $out/lib cp -d ${zlib}/lib/libz.so* $out/lib cp -d ${libelf}/lib/libelf.so* $out/lib - + # Copy binutils. for i in as ld ar ranlib nm strip readelf objdump; do cp ${binutils}/bin/$i $out/bin done chmod -R u+w $out - + # Strip executables even further. for i in $out/bin/* $out/libexec/gcc/*/*/*; do if test -x $i -a ! -L $i; then @@ -210,9 +210,9 @@ rec { allowedReferences = []; }; - + unpack = - + stdenv.mkDerivation { name = "unpack"; @@ -245,7 +245,7 @@ rec { name = "test"; realBuilder = "${unpack}/bin/bash"; - + buildCommand = '' export PATH=${unpack}/bin ls -l @@ -267,7 +267,7 @@ rec { 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 CXX="g++ -idirafter ${unpack}/include-glibc -B${unpack} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${unpack}/lib" - + echo '#include ' >> foo.c echo '#include ' >> foo.c echo 'int main() { printf("Hello World\n"); return 0; }' >> foo.c @@ -286,5 +286,5 @@ rec { make install ''; # */ }; - + } From 5b50f0cbc597005d555c18bb75206db4fb3a389d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 09:40:44 +0100 Subject: [PATCH 03/26] busybox: Remove unused patch --- .../include-missing-sys-resource-header.patch | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch diff --git a/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch b/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch deleted file mode 100644 index 8163a86e3cd..00000000000 --- a/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch +++ /dev/null @@ -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 - #include - #include -+#include - #include - #include - #include From 937e1280c0b3f9bc21c33e70475c76ec3e8e97d5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 11:23:12 +0100 Subject: [PATCH 04/26] Rename badly named linuxHeaders_3_7 (it's actually 3.12) --- pkgs/os-specific/linux/kernel-headers/{3.7.nix => 3.12.nix} | 0 pkgs/top-level/all-packages.nix | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename pkgs/os-specific/linux/kernel-headers/{3.7.nix => 3.12.nix} (100%) diff --git a/pkgs/os-specific/linux/kernel-headers/3.7.nix b/pkgs/os-specific/linux/kernel-headers/3.12.nix similarity index 100% rename from pkgs/os-specific/linux/kernel-headers/3.7.nix rename to pkgs/os-specific/linux/kernel-headers/3.12.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f586b260422..3b3ad79ffa4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7836,7 +7836,7 @@ let # -- Linux kernel expressions ------------------------------------------------ - linuxHeaders = linuxHeaders_3_7; + linuxHeaders = linuxHeaders_3_12; linuxHeaders24Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.4.nix { inherit stdenv fetchurl perl; @@ -7848,7 +7848,7 @@ let 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 { }; From 5cc92eb0d8b859b76b6f3ce0900a5e51af81d49f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 11:54:17 +0100 Subject: [PATCH 05/26] Remove obsolete useDietLibC stdenv adapter --- pkgs/os-specific/linux/e3cfsprogs/default.nix | 12 +------- .../linux/module-init-tools/default.nix | 4 --- pkgs/stdenv/adapters.nix | 30 ------------------- pkgs/tools/compression/bzip2/default.nix | 2 +- pkgs/tools/networking/curl/7.15.nix | 1 - pkgs/tools/networking/curl/default.nix | 1 - 6 files changed, 2 insertions(+), 48 deletions(-) diff --git a/pkgs/os-specific/linux/e3cfsprogs/default.nix b/pkgs/os-specific/linux/e3cfsprogs/default.nix index 89d5ad5158c..ef25d59a9df 100644 --- a/pkgs/os-specific/linux/e3cfsprogs/default.nix +++ b/pkgs/os-specific/linux/e3cfsprogs/default.nix @@ -11,20 +11,10 @@ stdenv.mkDerivation { sha256 = "8dd3de546aeb1ae42fb05409aeb724a145fe9aa1dbe1115441c2297c9d48cf31"; }; - configureFlags = - if stdenv ? isDietLibC - then "" - else "--enable-dynamic-e2fsck --enable-elf-shlibs"; + configureFlags ="--enable-dynamic-e2fsck --enable-elf-shlibs"; buildInputs = [gettext]; preInstall = "installFlagsArray=('LN=ln -s')"; 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 !!!! diff --git a/pkgs/os-specific/linux/module-init-tools/default.nix b/pkgs/os-specific/linux/module-init-tools/default.nix index 240150b09dd..c83bd28d243 100644 --- a/pkgs/os-specific/linux/module-init-tools/default.nix +++ b/pkgs/os-specific/linux/module-init-tools/default.nix @@ -23,10 +23,6 @@ stdenv.mkDerivation { 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 = { homepage = http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/; description = "Tools for loading and managing Linux kernel modules"; diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index d223cf1708c..2f1db703ed2 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -29,36 +29,6 @@ rec { 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 // diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix index 55fca6ca3cb..e00c4e504ce 100644 --- a/pkgs/tools/compression/bzip2/default.nix +++ b/pkgs/tools/compression/bzip2/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation { }; sharedLibrary = - !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic; + !stdenv.isDarwin && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin" && !linkStatic; preConfigure = "substituteInPlace Makefile --replace '$(PREFIX)/man' '$(PREFIX)/share/man'"; diff --git a/pkgs/tools/networking/curl/7.15.nix b/pkgs/tools/networking/curl/7.15.nix index 0a87eaa944c..47ac790e2ad 100644 --- a/pkgs/tools/networking/curl/7.15.nix +++ b/pkgs/tools/networking/curl/7.15.nix @@ -43,7 +43,6 @@ stdenv.mkDerivation rec { dontDisableStatic = linkStatic; - CFLAGS = if stdenv ? isDietLibC then "-DHAVE_INET_NTOA_R_2_ARGS=1" else ""; LDFLAGS = if linkStatic then "-static" else ""; CXX = "g++"; CXXCPP = "g++ -E"; diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index e12db01ae72..6766415c8b1 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -47,7 +47,6 @@ stdenv.mkDerivation rec { dontDisableStatic = linkStatic; - CFLAGS = if stdenv ? isDietLibC then "-DHAVE_INET_NTOA_R_2_ARGS=1" else ""; LDFLAGS = if linkStatic then "-static" else ""; CXX = "g++"; CXXCPP = "g++ -E"; From d135422009991d9fb7602892abf77dcdb1e42cad Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 11:55:23 +0100 Subject: [PATCH 06/26] Remove obsolete useKlibc stdenv adapter --- pkgs/stdenv/adapters.nix | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 2f1db703ed2..e2561258b7d 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -29,33 +29,6 @@ rec { overrideSetup = stdenv: setupScript: stdenv.override { inherit setupScript; }; - # 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 # binaries. makeStaticBinaries = stdenv: stdenv // From dc0d68ffc30d2b446f416eff4ed974eeafcf8224 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 12:06:27 +0100 Subject: [PATCH 07/26] curl: Remove static link support We only needed this for the stdenv bootstrap, but not anymore. --- pkgs/tools/networking/curl/default.nix | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 6766415c8b1..883d21e4da1 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -4,7 +4,6 @@ , scpSupport ? false, libssh2 ? null , gssSupport ? false, gss ? null , c-aresSupport ? false, c-ares ? null -, linkStatic ? false }: assert zlibSupport -> zlib != null; @@ -41,29 +40,18 @@ stdenv.mkDerivation rec { ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" ) ] ++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}" - ++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}" - ++ stdenv.lib.optionals linkStatic [ "--enable-static" "--disable-shared" ] - ; + ++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}"; - dontDisableStatic = linkStatic; - - LDFLAGS = if linkStatic then "-static" else ""; CXX = "g++"; 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 = { # We should refer to the cross built openssl # For the 'urandom', maybe it should be a cross-system option configureFlags = [ ( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" ) "--with-random /dev/urandom" - ] - ++ stdenv.lib.optionals linkStatic [ "--enable-static" "--disable-shared" ] - ; + ]; }; passthru = { From 423e923182d966e2315fdd405f1e0efbd1dcb18a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 13:32:40 +0100 Subject: [PATCH 08/26] busybox: Enable building a minimal configuration This starts with "make allnoconfig" rather than "make defconfig", making it easier to turn on only the needed features. Also, fix broken .config generation (the presence of "#" lines confused parseconfig). --- pkgs/os-specific/linux/busybox/default.nix | 43 +++++++++------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index 34eb19380d4..da1d2dc2ed0 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, enableStatic ? false, extraConfig ? ""}: +{ stdenv, fetchurl, enableStatic ? false, enableMinimal ? false, extraConfig ? "" }: let configParser = '' @@ -7,14 +7,7 @@ let NAME=`echo "$LINE" | cut -d \ -f 1` OPTION=`echo "$LINE" | cut -d \ -f 2` - if test -z "$NAME"; then - continue - fi - - if test "$NAME" == "CLEAR"; then - echo "parseconfig: CLEAR" - echo > .config - fi + if ! [[ "$NAME" =~ ^CONFIG_ ]]; then continue; fi echo "parseconfig: removing $NAME" 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 stdenv.mkDerivation rec { @@ -50,14 +30,27 @@ stdenv.mkDerivation rec { configurePhase = '' export KCONFIG_NOTIMESTAMP=1 - make defconfig + make ${if enableMinimal then "allnoconfig" else "defconfig"} + ${configParser} + cat << EOF | parseconfig - ${staticConfig} - ${nixConfig} + + CONFIG_PREFIX "$out" + CONFIG_INSTALL_NO_USR y + + ${stdenv.lib.optionalString enableStatic '' + CONFIG_STATIC y + ''} + + # Use the external mount.cifs program. + CONFIG_FEATURE_MOUNT_CIFS n + CONFIG_FEATURE_MOUNT_HELPERS y + ${extraConfig} $extraCrossConfig EOF + make oldconfig ''; From 3b2177b7696c23df8d378c175a2db0ab81062106 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 13:34:46 +0100 Subject: [PATCH 09/26] busybox: Allow running from within the Nix store This enables running the busybox program directly from the Nix store (i.e. as /nix/store/-busybox). We need this for the stdenv bootstrap. --- .../linux/busybox/busybox-in-store.patch | 16 ++++++++++++++++ pkgs/os-specific/linux/busybox/default.nix | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/os-specific/linux/busybox/busybox-in-store.patch diff --git a/pkgs/os-specific/linux/busybox/busybox-in-store.patch b/pkgs/os-specific/linux/busybox/busybox-in-store.patch new file mode 100644 index 00000000000..ea245a49259 --- /dev/null +++ b/pkgs/os-specific/linux/busybox/busybox-in-store.patch @@ -0,0 +1,16 @@ +Allow BusyBox to be invoked as "-busybox". This is +necessary when it's run from the Nix store as -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)); + } + diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index da1d2dc2ed0..6073692c70a 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -28,6 +28,8 @@ stdenv.mkDerivation rec { sha256 = "12v7nri79v8gns3inmz4k24q7pcnwi00hybs0wddfkcy1afh42xf"; }; + patches = [ ./busybox-in-store.patch ]; + configurePhase = '' export KCONFIG_NOTIMESTAMP=1 make ${if enableMinimal then "allnoconfig" else "defconfig"} From e8992c5084e31198af3fa2c624655203391ecd60 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 13:36:03 +0100 Subject: [PATCH 10/26] Update the stdenv bootstrap tools generator The static curl program is gone, replaced by curl inside of the bootstrap tools tarball. Also, we generate a .tar.xz archive rather than .cpio.bz2, making the download smaller. The separate {sh,cpio,mkdir,ln,bzip2} programs have been replaced by a single busybox program. --- pkgs/stdenv/linux/make-bootstrap-tools.nix | 142 +++++++-------------- 1 file changed, 47 insertions(+), 95 deletions(-) diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 820fc978bda..651ccee74fd 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -1,4 +1,4 @@ -{system ? builtins.currentSystem}: +{ system ? builtins.currentSystem }: with import ../../top-level/all-packages.nix {inherit system;}; @@ -6,80 +6,27 @@ rec { # We want coreutils without ACL support. - coreutils_ = coreutils.override (args: { + coreutilsMinimal = coreutils.override (args: { aclSupport = false; }); - # bzip2 wants utime.h, a header 'legacy' in uclibc - 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; + curlMinimal = curl.override { zlibSupport = false; sslSupport = false; - linkStatic = true; + scpSupport = false; }; - - bzip2Static = import ../../tools/compression/bzip2 { - stdenv = stdenvLinkStatic; - inherit fetchurl; - linkStatic = true; - }; - - #gccNoShared = wrapGCC ( gcc.gcc.override { enableShared = false; } ); - - busyboxStaticSh = busybox.override { + busyboxMinimal = busybox.override { + enableStatic = true; + enableMinimal = true; extraConfig = '' - CLEAR - CONFIG_STATIC 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_PRINTF y CONFIG_ASH_BUILTIN_TEST y - ''; - }; - - busyboxStaticLn = busybox.override { - extraConfig = '' - CLEAR - CONFIG_STATIC y - CONFIG_LN y - ''; - }; - - busyboxStaticMkdir = busybox.override { - extraConfig = '' - CLEAR - CONFIG_STATIC y + CONFIG_ASH_OPTIMIZE_FOR_SIZE y CONFIG_MKDIR y - ''; - }; - - busyboxStaticCpio = busybox.override { - extraConfig = '' - CLEAR - CONFIG_STATIC y - CONFIG_CPIO y - # (shlevy) Are these necessary? - CONFIG_FEATURE_CPIO_O y - CONFIG_FEATURE_CPIO_P y + CONFIG_TAR y + CONFIG_UNXZ y ''; }; @@ -116,7 +63,7 @@ rec { mv $out/include $out/include-glibc # 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) cp ${bash}/bin/bash $out/bin @@ -124,7 +71,7 @@ rec { cp ${findutils}/bin/xargs $out/bin cp -d ${diffutils}/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 -d ${gawk}/bin/awk $out/bin cp ${gnutar}/bin/tar $out/bin @@ -133,6 +80,8 @@ rec { cp -d ${gnumake}/bin/* $out/bin cp -d ${patch}/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 @@ -151,6 +100,8 @@ rec { rm -rf $out/lib/gcc/*/*/plugin #rm -f $out/lib/gcc/*/*/*.a cp -rd ${gcc.gcc}/libexec/* $out/libexec + chmod -R u+w $out/libexec + rm -rf $out/libexec/gcc/*/*/plugin mkdir $out/include cp -rd ${gcc.gcc}/include/c++ $out/include chmod -R u+w $out/include @@ -159,8 +110,6 @@ rec { cp -d ${gmpxx}/lib/libgmp*.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 ${zlib}/lib/libz.so* $out/lib cp -d ${libelf}/lib/libelf.so* $out/lib @@ -169,6 +118,7 @@ rec { for i in as ld ar ranlib nm strip readelf objdump; do cp ${binutils}/bin/$i $out/bin done + cp -d ${binutils}/lib/lib*.so* $out/lib chmod -R u+w $out @@ -189,19 +139,10 @@ rec { mv $out/.pack $out/pack mkdir $out/on-server - (cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2 - - mkdir $out/in-nixpkgs - cp ${busyboxStaticSh}/bin/busybox $out/in-nixpkgs/sh - 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 + tar cvfJ $out/on-server/bootstrap-tools.tar.xz -C $out/pack . + cp ${busyboxMinimal}/bin/busybox $out/on-server + chmod u+w $out/on-server/busybox + nuke-refs $out/on-server/busybox ''; # */ # The result should not contain any references (store paths) so @@ -213,19 +154,30 @@ rec { unpack = - stdenv.mkDerivation { + derivation { name = "unpack"; + inherit system; + builder = "${build}/on-server/busybox"; + args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ]; buildCommand = '' - ${build}/in-nixpkgs/mkdir $out - ${build}/in-nixpkgs/bzip2 -d < ${build}/on-server/bootstrap-tools.cpio.bz2 | (cd $out && ${build}/in-nixpkgs/cpio -v -i) + export PATH=${build}/on-server:$out/bin + + 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 - echo patching $i - if ! test -L $i; then - LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \ - $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.2 --set-rpath $out/lib --force-rpath $i - fi + if [ -L "$i" ]; then continue; fi + if [ -z "''${i##*/liblto*}" ]; then continue; fi + echo patching "$i" + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \ + $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 # Fix the libc linker script. @@ -241,10 +193,11 @@ rec { test = - stdenv.mkDerivation { + derivation { name = "test"; - - realBuilder = "${unpack}/bin/bash"; + inherit system; + builder = "${build}/on-server/busybox"; + args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ]; buildCommand = '' export PATH=${unpack}/bin @@ -259,8 +212,7 @@ rec { awk --version grep --version gcc --version - - ${build}/in-nixpkgs/sh -c 'echo Hello World' + curl --version ldlinux=$(echo ${unpack}/lib/ld-linux*.so.2) @@ -270,12 +222,12 @@ rec { echo '#include ' >> foo.c echo '#include ' >> 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 $out/bin/foo echo '#include ' >> 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 $out/bin/bar From c77b30e3fbe61fa775ce874ba336819ff4f263f7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 14:18:00 +0100 Subject: [PATCH 11/26] uclibc: Fix building against recent kernel headers --- pkgs/os-specific/linux/uclibc/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix index a0df3d526f5..dadae487cd2 100644 --- a/pkgs/os-specific/linux/uclibc/default.nix +++ b/pkgs/os-specific/linux/uclibc/default.nix @@ -16,11 +16,6 @@ let continue fi - if test "$NAME" == "CLEAR"; then - echo "parseconfig: CLEAR" - echo > .config - fi - echo "parseconfig: removing $NAME" sed -i /^$NAME=/d .config @@ -60,6 +55,13 @@ stdenv.mkDerivation { sha256 = "0qhngsbzj2s6nz92b1s2p0dmvwk8xiqpy58j7ljzw186grvjr3cq"; }; + patches = + [ (fetchurl { + url = https://dev.openwrt.org/export/37939/trunk/toolchain/uClibc/patches-0.9.33.2/970-add___kernel_long_and___kernel_ulong.patch; + sha256 = "1d1bfjpw0qla5zr32wk32s1y3wl2576zidbmvqsmqf0359bxhxrg"; + }) + ]; + # 'ftw' needed to build acl, a coreutils dependency configurePhase = '' make defconfig ${archMakeFlag} @@ -80,6 +82,8 @@ stdenv.mkDerivation { buildInputs = stdenv.lib.optional (gccCross != null) gccCross; + enableParallelBuilding = true; + installPhase = '' mkdir -p $out make PREFIX=$out VERBOSE=1 install ${crossMakeFlag} @@ -92,7 +96,7 @@ stdenv.mkDerivation { # Derivations may check for the existance of this attribute, to know what to link to. inherit libiconv; }; - + meta = { homepage = http://www.uclibc.org/; description = "A small implementation of the C library"; From 41a479b15f2f26fde3952e384d1aff37bde7186b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 14:44:56 +0100 Subject: [PATCH 12/26] busybox: Optionally use uclibc --- pkgs/os-specific/linux/busybox/default.nix | 12 +++++++----- pkgs/stdenv/linux/make-bootstrap-tools.nix | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index 6073692c70a..47f9fb9a5a4 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, enableStatic ? false, enableMinimal ? false, extraConfig ? "" }: +{ lib, stdenv, uclibc, fetchurl, enableStatic ? false, enableMinimal ? false, useUclibc ? false, extraConfig ? "" }: let configParser = '' @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { CONFIG_PREFIX "$out" CONFIG_INSTALL_NO_USR y - ${stdenv.lib.optionalString enableStatic '' + ${lib.optionalString enableStatic '' CONFIG_STATIC y ''} @@ -54,6 +54,8 @@ stdenv.mkDerivation rec { EOF make oldconfig + '' + lib.optionalString useUclibc '' + makeFlagsArray+=("CC=gcc -isystem ${uclibc}/include -B${uclibc}/lib -L${uclibc}/lib") ''; crossAttrs = { @@ -70,8 +72,8 @@ stdenv.mkDerivation rec { meta = { description = "Tiny versions of common UNIX utilities in a single small executable"; homepage = http://busybox.net/; - license = stdenv.lib.licenses.gpl2; - maintainers = with stdenv.lib.maintainers; [viric]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.gpl2; + maintainers = [ lib.maintainers.viric ]; + platforms = lib.platforms.linux; }; } diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 651ccee74fd..e202f691fa8 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -17,6 +17,7 @@ rec { }; busyboxMinimal = busybox.override { + useUclibc = true; enableStatic = true; enableMinimal = true; extraConfig = '' From ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 14:55:04 +0100 Subject: [PATCH 13/26] uclibc: Update to the latest prerelease This resolves a segfault in busybox. --- pkgs/os-specific/linux/uclibc/default.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix index dadae487cd2..16973311205 100644 --- a/pkgs/os-specific/linux/uclibc/default.nix +++ b/pkgs/os-specific/linux/uclibc/default.nix @@ -46,22 +46,16 @@ let ''; in + 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); src = fetchurl { - url = http://www.uclibc.org/downloads/uClibc-0.9.33.2.tar.bz2; - sha256 = "0qhngsbzj2s6nz92b1s2p0dmvwk8xiqpy58j7ljzw186grvjr3cq"; + url = http://www.uclibc.org/downloads/snapshots/uClibc-20141029.tar.bz2; + sha256 = "018r3bhw1jyyihmm5xxq1psl3r5yx02a57p8qxvay3vvzxn2cvzm"; }; - patches = - [ (fetchurl { - url = https://dev.openwrt.org/export/37939/trunk/toolchain/uClibc/patches-0.9.33.2/970-add___kernel_long_and___kernel_ulong.patch; - sha256 = "1d1bfjpw0qla5zr32wk32s1y3wl2576zidbmvqsmqf0359bxhxrg"; - }) - ]; - # 'ftw' needed to build acl, a coreutils dependency configurePhase = '' make defconfig ${archMakeFlag} From 119ce1ab03d0b3250e9e350f0686e095060014b0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 17:26:29 +0100 Subject: [PATCH 14/26] Update the stdenv-linux bootstrap tools --- pkgs/stdenv/linux/bootstrap/i686.nix | 41 +++------------ pkgs/stdenv/linux/bootstrap/x86_64.nix | 9 ++-- pkgs/stdenv/linux/default.nix | 11 ++-- .../linux/scripts/unpack-bootstrap-tools.sh | 50 +++++++------------ 4 files changed, 32 insertions(+), 79 deletions(-) diff --git a/pkgs/stdenv/linux/bootstrap/i686.nix b/pkgs/stdenv/linux/bootstrap/i686.nix index 7b6b3ee8034..04712360d15 100644 --- a/pkgs/stdenv/linux/bootstrap/i686.nix +++ b/pkgs/stdenv/linux/bootstrap/i686.nix @@ -1,39 +1,12 @@ -let - - fetch = { file, sha256 }: import { - url = "http://tarballs.nixos.org/stdenv-linux/i686/r24519/${file}"; - inherit sha256; +{ + busybox = import { + url = http://tarballs.nixos.org/stdenv-linux/i686/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/busybox; + sha256 = "0314dskcp6gp0jpy87phpjz1r13zh0grb40yvdl9s4l2rxzgzr2v"; executable = true; }; -in { - sh = fetch { - file = "sh"; - 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"; + bootstrapTools = import { + url = http://tarballs.nixos.org/stdenv-linux/i686/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/bootstrap-tools.tar.xz; + sha256 = "025r3vifkqlw0i5nvlkmfrvbn0v73r1pr6jkqckgs585y7nmsjhz"; }; } diff --git a/pkgs/stdenv/linux/bootstrap/x86_64.nix b/pkgs/stdenv/linux/bootstrap/x86_64.nix index 71961e6961e..2950e42ae0a 100644 --- a/pkgs/stdenv/linux/bootstrap/x86_64.nix +++ b/pkgs/stdenv/linux/bootstrap/x86_64.nix @@ -1,10 +1,9 @@ -# Use the static tools for i686-linux. They work on x86_64-linux -# machines as well. +# Use busybox for i686-linux since it works on x86_64-linux as well. (import ./i686.nix) // { - bootstrapTools = { - url = http://tarballs.nixos.org/stdenv-linux/x86_64/r23302/bootstrap-tools.cpio.bz2; - sha256 = "0w89kqhx47yl0jifp2vffp073pyrqha5f312kp971smi4h41drna"; + bootstrapTools = import { + url = http://tarballs.nixos.org/stdenv-linux/x86_64/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/bootstrap-tools.tar.xz; + sha256 = "01485vvwxb7fsx8c8il5hip0bhh4xy2gg76sj4zc98gl4v1jbfq9"; }; } diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 0467b60ca47..a5d8f5ba726 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -40,20 +40,15 @@ rec { bootstrapTools = derivation { name = "bootstrap-tools"; - builder = bootstrapFiles.sh; + builder = bootstrapFiles.busybox; args = if system == "armv5tel-linux" || system == "armv6l-linux" || system == "armv7l-linux" 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. - inherit (bootstrapFiles) bzip2 mkdir curl cpio; - - tarball = import { - inherit (bootstrapFiles.bootstrapTools) url sha256; - }; + tarball = bootstrapFiles.bootstrapTools; inherit system; diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh index 422dc6dd5fe..9db5d2c88e5 100644 --- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh @@ -1,9 +1,7 @@ -set -e - # Unpack the bootstrap tools tarball. echo Unpacking the bootstrap tools... -$mkdir $out -$bzip2 -d < $tarball | (cd $out && $cpio -i) +$builder mkdir $out +< $tarball $builder unxz | $builder tar x -C $out # Set the ELF interpreter / RPATH in the bootstrap binaries. echo Patching the bootstrap tools... @@ -21,32 +19,17 @@ fi LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/cp $out/bin/patchelf . for i in $out/bin/* $out/libexec/gcc/*/*/*; 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 -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 + if [ -L "$i" ]; then continue; fi + if [ -z "${i##*/liblto*}" ]; then continue; fi + echo patching "$i" + LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \ + $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i" 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 - echo trying to patch $i - if test -f $i -a ! -L $i; then - LD_LIBRARY_PATH=$out/lib $LD_BINARY \ - $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 +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 # Fix the libc linker script. @@ -60,13 +43,16 @@ mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so ln -s bash $out/bin/sh ln -s bzip2 $out/bin/bunzip2 -# Mimic the gunzip script as in gzip installations +# Provide a gunzip script. cat > $out/bin/gunzip < $out/bin/curl -chmod +x $out/bin/curl +# Provide fgrep/egrep. +echo "#! $out/bin/sh" > $out/bin/egrep +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 +chmod +x $out/bin/egrep $out/bin/fgrep From dac591aae6b56c5036b050fb017ccdfe4ed33f2d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 17:54:47 +0100 Subject: [PATCH 15/26] 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 23efc01a397..2559dea2653 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 a4f983de8f6..00000000000 --- 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 cbae03425eb..00000000000 --- 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 fabb6c3ec5e..894e2a11cf8 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 516f53954dd..00000000000 --- 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 5d0b1a51762..00000000000 --- 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 9f9fb86a396..1dd15832f5b 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"} From 41c0302661b90dd98e9c1806e5e747ea339d5a3d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2014 17:55:40 +0100 Subject: [PATCH 16/26] aterm: Fix building on Glibc 2.20 --- pkgs/development/libraries/aterm/2.5.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/aterm/2.5.nix b/pkgs/development/libraries/aterm/2.5.nix index 10a22e00f65..ef53a76d20b 100644 --- a/pkgs/development/libraries/aterm/2.5.nix +++ b/pkgs/development/libraries/aterm/2.5.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation { dontDisableStatic = true; + NIX_CFLAGS_COMPILE = "-D__USE_BSD"; + meta = { homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm; license = "LGPL"; From 1acfbca7dfc7beff7f5988d7e3621c930b7eaccd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 30 Oct 2014 09:28:10 +0100 Subject: [PATCH 17/26] grub2: Fix building against Glibc 2.20 http://hydra.nixos.org/build/16563301 --- pkgs/tools/misc/grub/2.0x.nix | 2 +- pkgs/tools/misc/grub/glibc-2.20.patch | 29 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 pkgs/tools/misc/grub/glibc-2.20.patch diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index e5471a6c404..1dbdfff7448 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -77,7 +77,7 @@ stdenv.mkDerivation rec { -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" ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystems.${stdenv.system}.target}" "--program-prefix=" ]; diff --git a/pkgs/tools/misc/grub/glibc-2.20.patch b/pkgs/tools/misc/grub/glibc-2.20.patch new file mode 100644 index 00000000000..6bb4f677541 --- /dev/null +++ b/pkgs/tools/misc/grub/glibc-2.20.patch @@ -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 + +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 + ++/* 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 + #include + #include +-- +2.1.0 From d3da884dd8562dee55b4eeccc0a0c19ef052e9ec Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 30 Oct 2014 13:34:26 +0100 Subject: [PATCH 18/26] imagemagick: Use --with-gcc-arch Without this, ImageMagick's configure script will generate code specific to the machine building the package. This code may then fail on other CPU types. http://hydra.nixos.org/build/16564129 --- .../graphics/ImageMagick/default.nix | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix index e75ce535f7f..da2ca64d975 100644 --- a/pkgs/applications/graphics/ImageMagick/default.nix +++ b/pkgs/applications/graphics/ImageMagick/default.nix @@ -1,4 +1,5 @@ -{ stdenv +{ lib +, stdenv , fetchurl , pkgconfig , bzip2 @@ -18,8 +19,16 @@ }: let + version = "6.8.9-8"; + + arch = + if stdenv.system == "i686-linux" then "i686" + else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64" + else throw "ImageMagick is not supported on this platform."; + in + stdenv.mkDerivation rec { name = "ImageMagick-${version}"; @@ -35,18 +44,19 @@ stdenv.mkDerivation rec { export DVIDecodeDelegate=${tetex}/bin/dvips '' else ""; - configureFlags = "" + stdenv.lib.optionalString (stdenv.system != "x86_64-darwin") '' - --with-gs-font-dir=${ghostscript}/share/ghostscript/fonts - --with-gslib - '' + '' - --with-frozenpaths - ${if librsvg != null then "--with-rsvg" else ""} - ''; + configureFlags = + [ "--with-frozenpaths" ] + ++ [ "--with-gcc-arch=${arch}" ] + ++ lib.optional (librsvg != null) "--with-rsvg" + ++ lib.optionals (stdenv.system != "x86_64-darwin") + [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts" + "--with-gslib" + ]; propagatedBuildInputs = [ bzip2 fontconfig freetype libjpeg libpng libtiff libxml2 zlib librsvg libtool jasper libX11 - ] ++ stdenv.lib.optional (stdenv.system != "x86_64-darwin") ghostscript; + ] ++ lib.optional (stdenv.system != "x86_64-darwin") ghostscript; buildInputs = [ tetex pkgconfig ]; From 4cc61d6d080a10c80267463a340dbe42f0ad0174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 1 Nov 2014 22:29:42 +0100 Subject: [PATCH 19/26] xorg.xf86-video-vmware: fix build against glibc-2.20 --- pkgs/servers/x11/xorg/overrides.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 246ed94cd1a..19c119ad74c 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -203,6 +203,11 @@ in xf86videovmware = attrs: attrs // { 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 // { From 95b475da0925230b6610330d6f6b7fec4729a6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 1 Nov 2014 23:26:44 +0100 Subject: [PATCH 20/26] xorg.xf86-input-vmmouse: fix build with glibc-2.20 --- pkgs/servers/x11/xorg/overrides.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 19c119ad74c..ca3d16d1f9b 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -188,6 +188,11 @@ in "--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.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 // { From 515dcb0f660a472877a34a8c00980fb77ebc005a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 1 Nov 2014 23:31:18 +0100 Subject: [PATCH 21/26] xorg.xf86-video-intel: use the new versions The old driver wasn't updated since August 2013, and e.g. won't compile with glibc-2.20. Distros like Arch or Ubuntu are using newer one for a long time. --- pkgs/servers/x11/xorg/default.nix | 10 +++++----- pkgs/servers/x11/xorg/tarballs-7.7.list | 2 +- pkgs/servers/x11/xorg/xf86-video-intel-testing.nix | 14 -------------- pkgs/top-level/all-packages.nix | 2 -- 4 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 pkgs/servers/x11/xorg/xf86-video-intel-testing.nix diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 11b1168498d..e379ab2750d 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -1555,14 +1555,14 @@ let }) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;}; xf86videointel = (mkDerivation "xf86videointel" { - name = "xf86-video-intel-2.21.15"; + name = "xf86-video-intel-2.99.916"; builder = ./builder.sh; src = fetchurl { - url = mirror://xorg/individual/driver/xf86-video-intel-2.21.15.tar.bz2; - sha256 = "1z6ncmpszmwqi9xr590c4kp4gjjf7mndcr56r35x2bx7h87i8nkx"; + url = mirror://xorg/individual/driver/xf86-video-intel-2.99.916.tar.bz2; + sha256 = "00gd3v3xgrmj8aliwjxkml13gfqvcbjazb6l5m1wkry39agq36j0"; }; - buildInputs = [pkgconfig dri2proto fontsproto glamoregl libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto xorgserver xproto libXrender libXvMC ]; - }) // {inherit dri2proto fontsproto glamoregl libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto xorgserver xproto libXrender libXvMC ;}; + buildInputs = [pkgconfig dri2proto dri3proto fontsproto glamoregl libdrm libpng udev libpciaccess presentproto randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrandr libXrender libxshmfence libXvMC ]; + }) // {inherit dri2proto dri3proto fontsproto glamoregl libdrm libpng udev libpciaccess presentproto randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrandr libXrender libxshmfence libXvMC ;}; xf86videomach64 = (mkDerivation "xf86videomach64" { name = "xf86-video-mach64-6.9.4"; diff --git a/pkgs/servers/x11/xorg/tarballs-7.7.list b/pkgs/servers/x11/xorg/tarballs-7.7.list index 42947f49778..8644aba9a50 100644 --- a/pkgs/servers/x11/xorg/tarballs-7.7.list +++ b/pkgs/servers/x11/xorg/tarballs-7.7.list @@ -134,7 +134,7 @@ mirror://xorg/individual/driver/xf86-video-geode-2.11.16.tar.bz2 mirror://xorg/individual/driver/xf86-video-glide-1.2.2.tar.bz2 mirror://xorg/individual/driver/xf86-video-glint-1.2.8.tar.bz2 mirror://xorg/individual/driver/xf86-video-i128-1.3.6.tar.bz2 -mirror://xorg/individual/driver/xf86-video-intel-2.21.15.tar.bz2 +mirror://xorg/individual/driver/xf86-video-intel-2.99.916.tar.bz2 mirror://xorg/individual/driver/xf86-video-mach64-6.9.4.tar.bz2 mirror://xorg/individual/driver/xf86-video-mga-1.6.3.tar.bz2 mirror://xorg/individual/driver/xf86-video-modesetting-0.9.0.tar.bz2 diff --git a/pkgs/servers/x11/xorg/xf86-video-intel-testing.nix b/pkgs/servers/x11/xorg/xf86-video-intel-testing.nix deleted file mode 100644 index bee394e9963..00000000000 --- a/pkgs/servers/x11/xorg/xf86-video-intel-testing.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ stdenv, fetchurl, pkgconfig, libdrm, udev, xorg }: - -with xorg; - -(stdenv.mkDerivation ({ - name = "xf86-video-intel-2.99.912"; - builder = ./builder.sh; - src = fetchurl { - url = mirror://xorg/individual/driver/xf86-video-intel-2.99.912.tar.bz2; - sha256 = "00cmvs5jxaqnl1pwqvj1rwir4kbvf5qfng89cjn4rwsr5m4zr3vw"; - }; - buildInputs = [pkgconfig dri2proto fontsproto glamoregl libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXcursor libXdamage libXext xextproto xf86driproto libXfixes libXinerama xorgserver xproto libXrandr libXrender libXtst libXvMC ]; -})) // {inherit dri2proto fontsproto glamoregl libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXcursor libXdamage libXext xextproto xf86driproto libXfixes libXinerama xorgserver xproto libXrandr libXrender libXtst libXvMC ;} - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3b3ad79ffa4..17ac0a29554 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7565,8 +7565,6 @@ let mesa = mesa_noglu; udev = if stdenv.isLinux then udev else null; libdrm = if stdenv.isLinux then libdrm else null; - } // { - xf86videointel-testing = callPackage ../servers/x11/xorg/xf86-video-intel-testing.nix { }; }); xorgReplacements = callPackage ../servers/x11/xorg/replacements.nix { }; From 73b75f6157db79fc899154a497823e82e409e76d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 3 Nov 2014 13:25:58 +0100 Subject: [PATCH 22/26] gcc: Fix bug causing Glibc miscompilation http://hydra.nixos.org/build/16564205 --- .../development/compilers/gcc/4.8/bug-61801.patch | 15 +++++++++++++++ pkgs/development/compilers/gcc/4.8/default.nix | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/gcc/4.8/bug-61801.patch diff --git a/pkgs/development/compilers/gcc/4.8/bug-61801.patch b/pkgs/development/compilers/gcc/4.8/bug-61801.patch new file mode 100644 index 00000000000..3d87e007813 --- /dev/null +++ b/pkgs/development/compilers/gcc/4.8/bug-61801.patch @@ -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. diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 7166d325b31..ac5056fbca5 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -61,7 +61,7 @@ let version = "4.8.3"; enableParallelBuilding = true; - patches = [] + patches = [ ./bug-61801.patch ] ++ optional enableParallelBuilding ./parallel-bconfig.patch ++ optional (cross != null) ./libstdc++-target.patch ++ optional noSysDirs ./no-sys-dirs.patch From 3bd2cfa85373a94f88fd90d9b6b0953c9c3c63a9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 3 Nov 2014 18:50:28 +0100 Subject: [PATCH 23/26] Update bootstrap tools with the fix for GCC bug 61801 --- pkgs/stdenv/linux/bootstrap/i686.nix | 8 ++++---- pkgs/stdenv/linux/bootstrap/x86_64.nix | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/stdenv/linux/bootstrap/i686.nix b/pkgs/stdenv/linux/bootstrap/i686.nix index 04712360d15..88bd984bab9 100644 --- a/pkgs/stdenv/linux/bootstrap/i686.nix +++ b/pkgs/stdenv/linux/bootstrap/i686.nix @@ -1,12 +1,12 @@ { busybox = import { - url = http://tarballs.nixos.org/stdenv-linux/i686/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/busybox; - sha256 = "0314dskcp6gp0jpy87phpjz1r13zh0grb40yvdl9s4l2rxzgzr2v"; + url = http://tarballs.nixos.org/stdenv-linux/i686/73b75f6157db79fc899154a497823e82e409e76d/busybox; + sha256 = "159208615405938d9830634f15d38adf5a9c33643926845c44499dbe6dd62042"; executable = true; }; bootstrapTools = import { - url = http://tarballs.nixos.org/stdenv-linux/i686/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/bootstrap-tools.tar.xz; - sha256 = "025r3vifkqlw0i5nvlkmfrvbn0v73r1pr6jkqckgs585y7nmsjhz"; + url = http://tarballs.nixos.org/stdenv-linux/i686/73b75f6157db79fc899154a497823e82e409e76d/bootstrap-tools.tar.xz; + sha256 = "68c430b84dbeac0bd1bea4cdd3159dce44a76445e07860caed1972b4608c42ca"; }; } diff --git a/pkgs/stdenv/linux/bootstrap/x86_64.nix b/pkgs/stdenv/linux/bootstrap/x86_64.nix index 2950e42ae0a..96822f57e50 100644 --- a/pkgs/stdenv/linux/bootstrap/x86_64.nix +++ b/pkgs/stdenv/linux/bootstrap/x86_64.nix @@ -3,7 +3,7 @@ { bootstrapTools = import { - url = http://tarballs.nixos.org/stdenv-linux/x86_64/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/bootstrap-tools.tar.xz; - sha256 = "01485vvwxb7fsx8c8il5hip0bhh4xy2gg76sj4zc98gl4v1jbfq9"; + url = http://tarballs.nixos.org/stdenv-linux/x86_64/73b75f6157db79fc899154a497823e82e409e76d/bootstrap-tools.tar.xz; + sha256 = "e29d47a5dc9f1ff10c3fbaacbd03a3cca0c784299df09fcdd9e25797ec6414ad"; }; } From 65221567c12eb20d1254f6bc1b573e126af43645 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 11 Nov 2014 10:23:26 +0100 Subject: [PATCH 24/26] glibc: Include a copy of libgcc_s.so.1 This prevents failures like "libgcc_s.so.1 must be installed for pthread_cancel to work" that occur because Glibc assumes libgcc_s.so.1 to be in Glibc's libdir. This solution is pretty hacky, because the libgcc_s.so.1 from bootstrap-tools might be too old. So if we update GCC, programs might end up using an outdated libgcc_s.so.1. Ideally, we would build libgcc_s.so.1 *before* Glibc, which might not be impossible... Fixes #3548. --- pkgs/development/libraries/glibc/builder.sh | 4 ---- pkgs/development/libraries/glibc/default.nix | 2 +- pkgs/tools/filesystems/squashfs/default.nix | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pkgs/development/libraries/glibc/builder.sh b/pkgs/development/libraries/glibc/builder.sh index 3b077cbb3fd..2836063e3bf 100644 --- a/pkgs/development/libraries/glibc/builder.sh +++ b/pkgs/development/libraries/glibc/builder.sh @@ -46,10 +46,6 @@ postInstall() { ln -s lib $out/lib64 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. rm -rf $out/var $out/sbin/sln } diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 52a94bd0a0d..1abba35af08 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -35,7 +35,7 @@ in preInstall = '' if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then 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 ''; diff --git a/pkgs/tools/filesystems/squashfs/default.nix b/pkgs/tools/filesystems/squashfs/default.nix index a016627b7a4..5e1700af017 100644 --- a/pkgs/tools/filesystems/squashfs/default.nix +++ b/pkgs/tools/filesystems/squashfs/default.nix @@ -12,8 +12,6 @@ stdenv.mkDerivation rec { buildInputs = [ zlib xz ]; preBuild = "cd squashfs-tools"; - - NIX_LDFLAGS = "-lgcc_s"; # for pthread_cancel installFlags = "INSTALL_DIR=\${out}/bin"; From 975a822778896c086438e22532fe58652c019499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 11 Nov 2014 11:04:10 +0100 Subject: [PATCH 25/26] glibc: improve nscd version check after e316672dcb --- pkgs/development/libraries/glibc/common.nix | 7 +++++-- .../libraries/glibc/glibc-remove-datetime-from-nscd.patch | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 2559dea2653..da1d4f08fa2 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -69,8 +69,11 @@ stdenv.mkDerivation ({ + '' echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile '' - # Replace the date and time in nscd by $out. - # It is used as a protocol compatibility check. + # Replace the date and time in nscd by a prefix of $out. + # 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} \ | sed "s,@out@,$out," | patch -p1 diff --git a/pkgs/development/libraries/glibc/glibc-remove-datetime-from-nscd.patch b/pkgs/development/libraries/glibc/glibc-remove-datetime-from-nscd.patch index 0a5456ea5c4..db010e62366 100644 --- a/pkgs/development/libraries/glibc/glibc-remove-datetime-from-nscd.patch +++ b/pkgs/development/libraries/glibc/glibc-remove-datetime-from-nscd.patch @@ -5,7 +5,7 @@ /* We use this to make sure the receiver is the same. */ -static const char compilation[21] = __DATE__ " " __TIME__; -+static const char compilation[21] = "@out@"; ++static const char compilation[] = "@out@"; /* Statistic data for one database. */ struct dbstat From cef0bcefc6544513fec9dec49686932ef15f1734 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 15 Nov 2014 21:47:05 +0100 Subject: [PATCH 26/26] linux-headers: Update to 3.12.32 We can do this because bootstrap-tools contains an unxz program now (via busybox). --- pkgs/os-specific/linux/kernel-headers/3.12.nix | 6 +++--- pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/kernel-headers/3.12.nix b/pkgs/os-specific/linux/kernel-headers/3.12.nix index 9bf189c40ed..2fd34c68edc 100644 --- a/pkgs/os-specific/linux/kernel-headers/3.12.nix +++ b/pkgs/os-specific/linux/kernel-headers/3.12.nix @@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux; let - version = "3.12.6"; + version = "3.12.32"; kernelHeadersBaseConfig = if cross == null @@ -17,8 +17,8 @@ stdenv.mkDerivation { name = "linux-headers-${version}"; src = fetchurl { - url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.bz2"; - sha256 = "1qh6f1az0flfrbkdjx1i9r7yf31ad0gxigax91nd33z2jmd6h4df"; + url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz"; + sha256 = "1hzws2bf267hfk81ywqcxspkyi1lg56x63izdc0pv1338xcfas53"; }; targetConfig = if cross != null then cross.config else null; diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh index 9db5d2c88e5..52953c9b88d 100644 --- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh @@ -55,4 +55,9 @@ echo "#! $out/bin/sh" > $out/bin/egrep 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 -chmod +x $out/bin/egrep $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