···1let lib = import ../../../lib; in lib.makeOverridable (
23-{ system, name ? "stdenv", preHook ? "", initialPath, cc, shell
4, allowedRequisites ? null, extraAttrs ? {}, overrides ? (self: super: {}), config
56, # The `fetchurl' to use for downloading curl and its dependencies
···14, __extraImpureHostDeps ? []
15, stdenvSandboxProfile ? ""
16, extraSandboxProfile ? ""
0000000017}:
1819let
02021 # See discussion at https://github.com/NixOS/nixpkgs/pull/25304#issuecomment-298385426
22 # for why this defaults to false, but I (@copumpkin) want to default it to true soon.
···265266 outputs' =
267 outputs ++
268- (if separateDebugInfo then assert result.isLinux; [ "debug" ] else []);
269270 buildInputs' = lib.chooseDevOutputs buildInputs ++
271 (if separateDebugInfo then [ ../../build-support/setup-hooks/separate-debug-info.sh ] else []);
···311 # Inputs built by the usual native compiler.
312 nativeBuildInputs = nativeBuildInputs'
313 ++ lib.optional
314- (result.isCygwin
315 || (crossConfig != null && lib.hasSuffix "mingw32" crossConfig))
316 ../../build-support/setup-hooks/win-dll-link.sh
317 ;
···392 };
393394 # Utility flags to test the type of platform.
395- isDarwin = system == "x86_64-darwin";
396- isLinux = system == "i686-linux"
397- || system == "x86_64-linux"
398- || system == "powerpc-linux"
399- || system == "armv5tel-linux"
400- || system == "armv6l-linux"
401- || system == "armv7l-linux"
402- || system == "aarch64-linux"
403- || system == "mips64el-linux";
404- isGNU = system == "i686-gnu"; # GNU/Hurd
405- isSunOS = system == "i686-solaris"
406- || system == "x86_64-solaris";
407- isCygwin = system == "i686-cygwin"
408- || system == "x86_64-cygwin";
409- isFreeBSD = system == "i686-freebsd"
410- || system == "x86_64-freebsd";
411- isOpenBSD = system == "i686-openbsd"
412- || system == "x86_64-openbsd";
413- isi686 = system == "i686-linux"
414- || system == "i686-gnu"
415- || system == "i686-freebsd"
416- || system == "i686-openbsd"
417- || system == "i686-cygwin"
418- || system == "i386-sunos";
419- isx86_64 = system == "x86_64-linux"
420- || system == "x86_64-darwin"
421- || system == "x86_64-freebsd"
422- || system == "x86_64-openbsd"
423- || system == "x86_64-cygwin"
424- || system == "x86_64-solaris";
425- is64bit = system == "x86_64-linux"
426- || system == "x86_64-darwin"
427- || system == "x86_64-freebsd"
428- || system == "x86_64-openbsd"
429- || system == "x86_64-cygwin"
430- || system == "x86_64-solaris"
431- || system == "aarch64-linux"
432- || system == "mips64el-linux";
433- isMips = system == "mips-linux"
434- || system == "mips64el-linux";
435- isArm = system == "armv5tel-linux"
436- || system == "armv6l-linux"
437- || system == "armv7l-linux";
438- isAarch64 = system == "aarch64-linux";
439- isBigEndian = system == "powerpc-linux";
440441 # Whether we should run paxctl to pax-mark binaries.
442 needsPax = isLinux;
···1let lib = import ../../../lib; in lib.makeOverridable (
23+{ name ? "stdenv", preHook ? "", initialPath, cc, shell
4, allowedRequisites ? null, extraAttrs ? {}, overrides ? (self: super: {}), config
56, # The `fetchurl' to use for downloading curl and its dependencies
···14, __extraImpureHostDeps ? []
15, stdenvSandboxProfile ? ""
16, extraSandboxProfile ? ""
17+18+, # The platforms here do *not* correspond to the stage the stdenv is
19+ # used in, but rather the previous one, in which it was built. We
20+ # use the latter two platforms, like a cross compiler, because the
21+ # stand environment is a build tool if you squint at it, and because
22+ # neither of these are used when building stdenv so we know the
23+ # build platform is irrelevant.
24+ hostPlatform, targetPlatform
25}:
2627let
28+ inherit (targetPlatform) system;
2930 # See discussion at https://github.com/NixOS/nixpkgs/pull/25304#issuecomment-298385426
31 # for why this defaults to false, but I (@copumpkin) want to default it to true soon.
···274275 outputs' =
276 outputs ++
277+ (if separateDebugInfo then assert targetPlatform.isLinux; [ "debug" ] else []);
278279 buildInputs' = lib.chooseDevOutputs buildInputs ++
280 (if separateDebugInfo then [ ../../build-support/setup-hooks/separate-debug-info.sh ] else []);
···320 # Inputs built by the usual native compiler.
321 nativeBuildInputs = nativeBuildInputs'
322 ++ lib.optional
323+ (hostPlatform.isCygwin
324 || (crossConfig != null && lib.hasSuffix "mingw32" crossConfig))
325 ../../build-support/setup-hooks/win-dll-link.sh
326 ;
···401 };
402403 # Utility flags to test the type of platform.
404+ inherit (hostPlatform)
405+ isDarwin isLinux isSunOS isCygwin isFreeBSD isOpenBSD isi686 isx86_64
406+ is64bit isMips isBigEndian;
407+ isArm = hostPlatform.isArm32;
408+ isAarch64 = hostPlatform.isArm64;
409+ # Other code instead checks for anything using GNU userland,
410+ # e.g. GNU/linux. This refers just to GNU Hurd.
411+ isGNU = system == "i686-gnu";
0000000000000000000000000000000000000412413 # Whether we should run paxctl to pax-mark binaries.
414 needsPax = isLinux;
+8-2
pkgs/stdenv/linux/default.nix
···52 let
5354 thisStdenv = import ../generic {
55- inherit system config extraBuildInputs;
56 name = "stdenv-linux-boot";
57 preHook =
58 ''
···63 '';
64 shell = "${bootstrapTools}/bin/bash";
65 initialPath = [bootstrapTools];
0006667 fetchurlBoot = import ../../build-support/fetchurl/boot.nix {
68 inherit system;
···261 targetPlatform = localSystem;
262 inherit config overlays;
263 stdenv = import ../generic rec {
264- inherit system config;
265266 preHook = ''
267 # Make "strip" produce deterministic output, by setting
···272273 initialPath =
274 ((import ../common-path.nix) {pkgs = prevStage;});
000275276 extraBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
277 # Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.