···20202121let
2222 version = "2.26";
2323- patchSuffix = "-115";
2323+ patchSuffix = "-131";
2424 sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
2525 cross = if buildPlatform != hostPlatform then hostPlatform else null;
2626in
···4848 */
4949 ./2.26-75.patch.gz
5050 ./2.26-75to115.diff.gz
5151+ # contains fix for CVE-2018-1000001 as the last commit:
5252+ # https://sourceware.org/git/?p=glibc.git;a=commit;h=fabef2edbc
5353+ ./2.26-115to131.diff.gz
51545255 /* Have rpcgen(1) look for cpp(1) in $PATH. */
5356 ./rpcgen-path.patch
···7376 and we lose early mismatch detection on 2.6.32.
74777578 On major glibc updates we should check that the patched kernel supports
7676- all the required features. ATM it's verified up to glibc-2.26-115.
7979+ all the required features. ATM it's verified up to glibc-2.26-131.
7780 # HOWTO: check glibc sources for changes in kernel requirements
7881 git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h
7982 # get kernel sources (update the URL)
-2
pkgs/development/libraries/json-glib/default.nix
···27272828 doCheck = true;
29293030- checkPhase = "meson test";
3131-3230 meta = with stdenv.lib; {
3331 homepage = http://live.gnome.org/JsonGlib;
3432 description = "A library providing (de)serialization support for the JavaScript Object Notation (JSON) format";
···4343 # libraries are in a system path or in the same directory as the
4444 # executable. This flag makes the shared library accessible from its
4545 # nix/store directory.
4646- cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=$prefix/lib $cmakeFlags"
4646+ cmakeFlags="-DCMAKE_INSTALL_NAME_DIR=${!outputLib}/lib $cmakeFlags"
4747 cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags"
4848 cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags"
4949
···51515252 # Bump the maximum number of CPUs to support systems like EC2 x1.*
5353 # instances and Xeon Phi.
5454- ${optionalString (stdenv.system == "x86_64-linux" || stdenv.system == "aarch64-linux") ''
5454+ ${optionalString (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "aarch64-linux") ''
5555 NR_CPUS 384
5656 ''}
5757···347347 SECURITY_SELINUX_BOOTPARAM_VALUE 0 # Disable SELinux by default
348348 SECURITY_YAMA? y # Prevent processes from ptracing non-children processes
349349 DEVKMEM n # Disable /dev/kmem
350350- ${if versionOlder version "3.14" then ''
351351- CC_STACKPROTECTOR? y # Detect buffer overflows on the stack
352352- '' else ''
353353- CC_STACKPROTECTOR_REGULAR? y
354354- ''}
350350+ ${optionalString (! stdenv.hostPlatform.isArm)
351351+ (if versionOlder version "3.14" then ''
352352+ CC_STACKPROTECTOR? y # Detect buffer overflows on the stack
353353+ '' else ''
354354+ CC_STACKPROTECTOR_REGULAR? y
355355+ '')}
355356 ${optionalString (versionAtLeast version "3.12") ''
356357 USER_NS y # Support for user namespaces
357358 ''}
+16-47
pkgs/os-specific/linux/kernel/generic.nix
···11-{ stdenv, perl, buildLinux
11+{ stdenv, buildPackages, perl, buildLinux
2233, # The kernel source tarball.
44 src
···2323 # symbolic name and `patch' is the actual patch. The patch may
2424 # optionally be compressed with gzip or bzip2.
2525 kernelPatches ? []
2626-, ignoreConfigErrors ? stdenv.platform.name != "pc"
2626+, ignoreConfigErrors ? hostPlatform.platform.name != "pc" ||
2727+ hostPlatform != stdenv.buildPlatform
2728, extraMeta ? {}
2829, hostPlatform
2930, ...
···4344 netfilterRPFilter = true;
4445 } // features) kernelPatches;
45464646- configWithPlatform = kernelPlatform: import ./common-config.nix {
4747- inherit stdenv version kernelPlatform extraConfig;
4747+ config = import ./common-config.nix {
4848+ inherit stdenv version extraConfig;
4949+ kernelPlatform = hostPlatform;
4850 features = kernelFeatures; # Ensure we know of all extra patches, etc.
4951 };
5050-5151- config = configWithPlatform stdenv.platform;
5252- configCross = configWithPlatform hostPlatform.platform;
53525453 kernelConfigFun = baseConfig:
5554 let
···65646665 kernelConfig = kernelConfigFun config;
67666767+ depsBuildBuild = [ buildPackages.stdenv.cc ];
6868 nativeBuildInputs = [ perl ];
69697070- platformName = stdenv.platform.name;
7171- kernelBaseConfig = stdenv.platform.kernelBaseConfig;
7272- kernelTarget = stdenv.platform.kernelTarget;
7373- autoModules = stdenv.platform.kernelAutoModules;
7474- preferBuiltin = stdenv.platform.kernelPreferBuiltin or false;
7575- arch = stdenv.platform.kernelArch;
7676-7777- crossAttrs = let
7878- cp = hostPlatform.platform;
7979- in {
8080- arch = cp.kernelArch;
8181- platformName = cp.name;
8282- kernelBaseConfig = cp.kernelBaseConfig;
8383- kernelTarget = cp.kernelTarget;
8484- autoModules = cp.kernelAutoModules;
8585-8686- # Just ignore all options that don't apply (We are lazy).
8787- ignoreConfigErrors = true;
8888-8989- kernelConfig = kernelConfigFun configCross;
9090-9191- inherit (kernel.crossDrv) src patches preUnpack;
9292- };
7070+ platformName = hostPlatform.platform.name;
7171+ kernelBaseConfig = hostPlatform.platform.kernelBaseConfig;
7272+ kernelTarget = hostPlatform.platform.kernelTarget;
7373+ autoModules = hostPlatform.platform.kernelAutoModules;
7474+ preferBuiltin = hostPlatform.platform.kernelPreferBuiltin or false;
7575+ arch = hostPlatform.platform.kernelArch;
93769477 prePatch = kernel.prePatch + ''
9578 # Patch kconfig to print "###" after every question so that
···10386 cd $buildRoot
1048710588 # Get a basic config file for later refinement with $generateConfig.
106106- make -C ../$sourceRoot O=$PWD $kernelBaseConfig ARCH=$arch
8989+ make HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc -C ../$sourceRoot O=$PWD $kernelBaseConfig ARCH=$arch
1079010891 # Create the config file.
10992 echo "generating kernel configuration..."
···118101 };
119102120103 kernel = buildLinux {
121121- inherit version modDirVersion src kernelPatches stdenv extraMeta;
122122-123123- configfile = configfile.nativeDrv or configfile;
124124-125125- crossConfigfile = configfile.crossDrv or configfile;
104104+ inherit version modDirVersion src kernelPatches stdenv extraMeta configfile;
126105127106 config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
128128-129129- crossConfig = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; };
130107 };
131108132109 passthru = {
···134111 passthru = kernel.passthru // (removeAttrs passthru [ "passthru" ]);
135112 };
136113137137- addPassthru' = lib.extendDerivation true passthru;
138138-139139- nativeDrv = addPassthru' kernel.nativeDrv;
140140-141141- crossDrv = addPassthru' kernel.crossDrv;
142142-143143-in if kernel ? crossDrv
144144- then nativeDrv // { inherit nativeDrv crossDrv; }
145145- else addPassthru' kernel
114114+in lib.extendDerivation true passthru kernel
···188188 addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
189189}
190190191191-192192-ensureDir() {
193193- echo "warning: ‘ensureDir’ is deprecated; use ‘mkdir’ instead" >&2
194194- local dir
195195- for dir in "$@"; do
196196- if ! [ -x "$dir" ]; then mkdir -p "$dir"; fi
197197- done
198198-}
199199-200200-201191# Add $1/lib* into rpaths.
202192# The function is used in multiple-outputs.sh hook,
203193# so it is defined here but tried after the hook.