Merge branch 'master' into update-ios-gnu-config

This commit is contained in:
Matthew Bauer
2019-05-07 14:25:33 -04:00
committed by GitHub
1343 changed files with 22995 additions and 13346 deletions

View File

@@ -37,7 +37,8 @@ in lib.init bootStages ++ [
# Run Packages
(buildPackages: {
inherit config;
overlays = overlays ++ crossOverlays;
overlays = overlays ++ crossOverlays
++ (if crossSystem.isWasm then [(import ../../top-level/static.nix)] else []);
selfBuild = false;
stdenv = buildPackages.stdenv.override (old: rec {
buildPlatform = localSystem;
@@ -63,7 +64,7 @@ in lib.init bootStages ++ [
(hostPlatform.isLinux && !buildPlatform.isLinux)
[ buildPackages.patchelf ]
++ lib.optional
(let f = p: !p.isx86 || p.libc == "musl" || p.isiOS; in f hostPlatform && !(f buildPlatform))
(let f = p: !p.isx86 || p.libc == "musl" || p.libc == "wasilibc" || p.isiOS; in f hostPlatform && !(f buildPlatform))
buildPackages.updateAutotoolsGnuConfigScriptsHook
# without proper `file` command, libtool sometimes fails
# to recognize 64-bit DLLs

View File

@@ -1,15 +0,0 @@
With format string strictness, High Sierra also enforces that %n isn't used
in dynamic format strings, but we should just disable its use on darwin in
general.
--- a/lib/vasnprintf.c 2017-06-22 15:19:15.000000000 -0700
+++ b/lib/vasnprintf.c 2017-06-22 15:20:20.000000000 -0700
@@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
#endif
*fbp = dp->conversion;
#if USE_SNPRINTF
-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
fbp[1] = '%';
fbp[2] = 'n';
fbp[3] = '\0';

View File

@@ -132,9 +132,6 @@ in rec {
extraAttrs = {
inherit platform;
parent = last;
# This is used all over the place so I figured I'd just leave it here for now
secure-format-patch = ./darwin-secure-format.patch;
};
overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; };
};
@@ -158,7 +155,7 @@ in rec {
dyld = bootstrapTools;
};
llvmPackages_5 = {
llvmPackages_7 = {
libcxx = stdenv.mkDerivation {
name = "bootstrap-stage0-libcxx";
phases = [ "installPhase" "fixupPhase" ];
@@ -200,7 +197,12 @@ in rec {
python2 = self.python;
ninja = super.ninja.override { buildDocs = false; };
darwin = super.darwin // { cctools = super.darwin.cctools.override { llvm = null; }; };
darwin = super.darwin // {
cctools = super.darwin.cctools.override {
llvm = null;
enableTapiSupport = false;
};
};
};
in with prevStage; stageFun 1 prevStage {
extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\"";
@@ -260,9 +262,9 @@ in rec {
# Avoid pulling in a full python and its extra dependencies for the llvm/clang builds.
libxml2 = super.libxml2.override { pythonSupport = false; };
llvmPackages_5 = super.llvmPackages_5 // (let
libraries = super.llvmPackages_5.libraries.extend (_: _: {
inherit (llvmPackages_5) libcxx libcxxabi;
llvmPackages_7 = super.llvmPackages_7 // (let
libraries = super.llvmPackages_7.libraries.extend (_: _: {
inherit (llvmPackages_7) libcxx libcxxabi;
});
in { inherit libraries; } // libraries);
@@ -278,8 +280,8 @@ in rec {
# enables patchShebangs above. Unfortunately, patchShebangs ignores our $SHELL setting
# and instead goes by $PATH, which happens to contain bootstrapTools. So it goes and
# patches our shebangs back to point at bootstrapTools. This makes sure bash comes first.
extraNativeBuildInputs = with pkgs; [ xz pkgs.bash ];
extraBuildInputs = [ pkgs.darwin.CF ];
extraNativeBuildInputs = with pkgs; [ xz ];
extraBuildInputs = [ pkgs.darwin.CF pkgs.bash ];
libcxx = pkgs.libcxx;
extraPreHook = ''
@@ -314,18 +316,20 @@ in rec {
];
});
llvmPackages_5 = super.llvmPackages_5 // (let
tools = super.llvmPackages_5.tools.extend (llvmSelf: _: {
inherit (llvmPackages_5) llvm clang-unwrapped;
llvmPackages_7 = super.llvmPackages_7 // (let
tools = super.llvmPackages_7.tools.extend (llvmSelf: _: {
clang-unwrapped = llvmPackages_7.clang-unwrapped.override { llvm = llvmSelf.llvm; };
llvm = llvmPackages_7.llvm.override { libxml2 = self.darwin.libxml2-nopython; };
});
libraries = super.llvmPackages_5.libraries.extend (llvmSelf: _: {
inherit (llvmPackages_5) libcxx libcxxabi compiler-rt;
libraries = super.llvmPackages_7.libraries.extend (llvmSelf: _: {
inherit (llvmPackages_7) libcxx libcxxabi compiler-rt;
});
in { inherit tools libraries; } // tools // libraries);
darwin = super.darwin // rec {
inherit (darwin) dyld Libsystem libiconv locale;
cctools = super.darwin.cctools.override { enableTapiSupport = false; };
libxml2-nopython = super.libxml2.override { pythonSupport = false; };
CF = super.darwin.CF.override {
libxml2 = libxml2-nopython;
@@ -335,8 +339,8 @@ in rec {
};
in with prevStage; stageFun 4 prevStage {
shell = "${pkgs.bash}/bin/bash";
extraNativeBuildInputs = with pkgs; [ xz pkgs.bash ];
extraBuildInputs = [ pkgs.darwin.CF ];
extraNativeBuildInputs = with pkgs; [ xz ];
extraBuildInputs = [ pkgs.darwin.CF pkgs.bash ];
libcxx = pkgs.libcxx;
extraPreHook = ''
@@ -353,12 +357,12 @@ in rec {
ncurses libffi zlib llvm gmp pcre gnugrep
coreutils findutils diffutils patchutils;
llvmPackages_5 = super.llvmPackages_5 // (let
tools = super.llvmPackages_5.tools.extend (_: super: {
inherit (llvmPackages_5) llvm clang-unwrapped;
llvmPackages_7 = super.llvmPackages_7 // (let
tools = super.llvmPackages_7.tools.extend (_: super: {
inherit (llvmPackages_7) llvm clang-unwrapped;
});
libraries = super.llvmPackages_5.libraries.extend (_: _: {
inherit (llvmPackages_5) compiler-rt libcxx libcxxabi;
libraries = super.llvmPackages_7.libraries.extend (_: _: {
inherit (llvmPackages_7) compiler-rt libcxx libcxxabi;
});
in { inherit tools libraries; } // tools // libraries);
@@ -414,9 +418,6 @@ in rec {
inherit platform bootstrapTools;
libc = pkgs.darwin.Libsystem;
shellPackage = pkgs.bash;
# This is used all over the place so I figured I'd just leave it here for now
secure-format-patch = ./darwin-secure-format.patch;
};
allowedRequisites = (with pkgs; [

View File

@@ -3,7 +3,7 @@
with import pkgspath { inherit system; };
let
llvmPackages = llvmPackages_5;
llvmPackages = llvmPackages_7;
in rec {
coreutils_ = coreutils.override (args: {
# We want coreutils without ACL support.
@@ -80,14 +80,14 @@ in rec {
cp -d ${libxml2.out}/lib/libxml2*.dylib $out/lib
# Copy what we need of clang
cp -d ${llvmPackages.clang-unwrapped}/bin/clang $out/bin
cp -d ${llvmPackages.clang-unwrapped}/bin/clang++ $out/bin
cp -d ${llvmPackages.clang-unwrapped}/bin/clang-[0-9].[0-9] $out/bin
cp -d ${llvmPackages.clang-unwrapped}/bin/clang* $out/bin
cp -rL ${llvmPackages.clang-unwrapped}/lib/clang $out/lib
cp -d ${llvmPackages.libcxx}/lib/libc++*.dylib $out/lib
cp -d ${llvmPackages.libcxxabi}/lib/libc++abi*.dylib $out/lib
cp -d ${llvmPackages.llvm.lib}/lib/libLLVM.dylib $out/lib
cp -d ${libffi}/lib/libffi*.dylib $out/lib
mkdir $out/include
cp -rd ${llvmPackages.libcxx}/include/c++ $out/include

View File

@@ -88,7 +88,7 @@ let
# there (yet?) so it goes here until then.
preHook = preHook+ lib.optionalString buildPlatform.isDarwin ''
export NIX_BUILD_DONT_SET_RPATH=1
'' + lib.optionalString hostPlatform.isDarwin ''
'' + lib.optionalString (hostPlatform.isDarwin || (hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.elf && hostPlatform.parsed.kernel.execFormat != lib.systems.parse.execFormats.macho)) ''
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
''

View File

@@ -86,6 +86,8 @@ in rec {
, hardeningEnable ? []
, hardeningDisable ? []
, patches ? []
, ... } @ attrs:
let
@@ -235,6 +237,8 @@ in rec {
++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}"
++ optional (elem "target" configurePlatforms) "--target=${stdenv.targetPlatform.config}";
inherit patches;
inherit doCheck doInstallCheck;
inherit outputs;
@@ -253,6 +257,8 @@ in rec {
enableParallelChecking = attrs.enableParallelChecking or true;
} // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != []) {
NIX_HARDENING_ENABLE = enabledHardeningOptions;
} // lib.optionalAttrs (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform ? platform.gcc.arch) {
requiredSystemFeatures = attrs.requiredSystemFeatures or [] ++ [ "gccarch-${stdenv.hostPlatform.platform.gcc.arch}" ];
} // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) {
inherit __darwinAllowLocalNetworking;
# TODO: remove lib.unique once nix has a list canonicalization primitive

View File

@@ -182,10 +182,8 @@ addToSearchPathWithCustomDelimiter() {
fi
}
PATH_DELIMITER=':'
addToSearchPath() {
addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
addToSearchPathWithCustomDelimiter ":" "$@"
}
# Add $1/lib* into rpaths.
@@ -508,7 +506,7 @@ activatePackage() {
fi
if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then
addToSearchPath HOST_PATH "$pkg/bin"
addToSearchPath _HOST_PATH "$pkg/bin"
fi
if [[ -f "$pkg/nix-support/setup-hook" ]]; then
@@ -617,10 +615,15 @@ fi
PATH="${_PATH-}${_PATH:+${PATH:+:}}$PATH"
HOST_PATH="${_HOST_PATH-}${_HOST_PATH:+${HOST_PATH:+:}}$HOST_PATH"
if (( "${NIX_DEBUG:-0}" >= 1 )); then
echo "final path: $PATH"
echo "final host path: $HOST_PATH"
fi
unset _PATH
unset _HOST_PATH
# Make GNU Make produce nested output.
export NIX_INDENT_MAKE=1