Skip to content

Commit

Permalink
Merge some Master PRs into staging
Browse files Browse the repository at this point in the history
No native hashes should be changed
  • Loading branch information
Ericson2314 committed Sep 22, 2017
2 parents e151230 + b9bf90c commit 1dd63de
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 39 deletions.
6 changes: 4 additions & 2 deletions pkgs/development/compilers/gcc/4.5/default.nix
Expand Up @@ -20,7 +20,7 @@
, enableMultilib ? false
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? true
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
Expand Down Expand Up @@ -213,7 +213,9 @@ stdenv.mkDerivation ({
''
else null;

inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs profiledCompiler staticCompiler langJava
libcCross crossMingw;

nativeBuildInputs = [ texinfo which gettext ]
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/gcc/4.8/default.nix
Expand Up @@ -26,7 +26,7 @@
, enablePlugin ? true # whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? true
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
Expand Down Expand Up @@ -284,7 +284,9 @@ stdenv.mkDerivation ({
''
else null;

inherit noSysDirs staticCompiler langJava crossStageStatic
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
libcCross crossMingw;

nativeBuildInputs = [ texinfo which gettext ]
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/gcc/4.9/default.nix
Expand Up @@ -26,7 +26,7 @@
, enablePlugin ? true # whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? true
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
Expand Down Expand Up @@ -280,7 +280,9 @@ stdenv.mkDerivation ({
''
else null;

inherit noSysDirs staticCompiler langJava crossStageStatic
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
libcCross crossMingw;

nativeBuildInputs = [ texinfo which gettext ]
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/gcc/5/default.nix
Expand Up @@ -26,7 +26,7 @@
, enablePlugin ? true # whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? true
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
Expand Down Expand Up @@ -298,7 +298,9 @@ stdenv.mkDerivation ({
''
else null;

inherit noSysDirs staticCompiler langJava crossStageStatic
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
libcCross crossMingw;

nativeBuildInputs = [ texinfo which gettext ]
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/gcc/6/default.nix
Expand Up @@ -26,7 +26,7 @@
, enablePlugin ? true # whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? true
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
Expand Down Expand Up @@ -292,7 +292,9 @@ stdenv.mkDerivation ({
''
else null;

inherit noSysDirs staticCompiler langJava crossStageStatic
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
libcCross crossMingw;

nativeBuildInputs = [ texinfo which gettext ]
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/gcc/7/default.nix
Expand Up @@ -26,7 +26,7 @@
, enablePlugin ? true # whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? true
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
Expand Down Expand Up @@ -294,7 +294,9 @@ stdenv.mkDerivation ({
''
else null;

inherit noSysDirs staticCompiler langJava crossStageStatic
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
libcCross crossMingw;

nativeBuildInputs = [ texinfo which gettext ]
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/compilers/gcc/snapshot/default.nix
Expand Up @@ -26,7 +26,7 @@
, enablePlugin ? true # whether to support user-supplied plug-ins
, name ? "gcc"
, libcCross ? null
, crossStageStatic ? true
, crossStageStatic ? false
, gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
Expand Down Expand Up @@ -281,7 +281,9 @@ stdenv.mkDerivation ({
''
else null;

inherit noSysDirs staticCompiler langJava crossStageStatic
# TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
inherit noSysDirs staticCompiler langJava
libcCross crossMingw;

nativeBuildInputs = [ texinfo which gettext ]
Expand Down
4 changes: 2 additions & 2 deletions pkgs/os-specific/gnu/default.nix
Expand Up @@ -2,7 +2,7 @@

args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
, texinfo, glibcCross, hurdPartedCross, libuuid, samba
, gccCrossStageStatic, gccCrossStageFinal
, gccCrossStageStatic, gcc
, forceSystem, newScope, platform, config
, targetPlatform, buildPlatform
, overrides ? {}
Expand All @@ -28,7 +28,7 @@ let
automake = automake111x;
headersOnly = false;
cross = assert targetPlatform != buildPlatform; targetPlatform;
gccCross = gccCrossStageFinal;
gccCross = gcc;
};

hurdCrossIntermediate = forcedNativePackages.callPackage ./hurd {
Expand Down
13 changes: 7 additions & 6 deletions pkgs/stdenv/adapters.nix
Expand Up @@ -59,17 +59,18 @@ rec {
makeStdenvCross = { stdenv
, cc
, buildPlatform, hostPlatform, targetPlatform
, # Prior overrides are surely not valid as packages built
# with this run on a different platform, so disable by
# default.
overrides ? _: _: {}
} @ overrideArgs: let
stdenv = overrideArgs.stdenv.override {
inherit
buildPlatform hostPlatform targetPlatform
cc;
cc overrides;

allowedRequisites = null;

# Overrides are surely not valid as packages built with this run on a
# different platform.
overrides = _: _: {};
extraBuildInputs = [ ]; # Old ones run on wrong platform
};
in stdenv // {
mkDerivation =
Expand Down Expand Up @@ -105,7 +106,7 @@ rec {
# without proper `file` command, libtool sometimes fails
# to recognize 64-bit DLLs
++ stdenv.lib.optional (hostPlatform.config == "x86_64-w64-mingw32") pkgs.file
++ stdenv.lib.optional (hostPlatform.config == "aarch64-linux-gnu") pkgs.updateAutotoolsGnuConfigScriptsHook
++ stdenv.lib.optional hostPlatform.isAarch64 pkgs.updateAutotoolsGnuConfigScriptsHook
;

# Cross-linking dynamic libraries, every buildInput should
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/cross/default.nix
Expand Up @@ -35,7 +35,7 @@ in bootStages ++ [
targetPlatform = crossSystem;
cc = if crossSystem.useiOSCross or false
then buildPackages.darwin.ios-cross
else buildPackages.gccCrossStageFinal;
else buildPackages.gcc;
};
})

Expand Down
8 changes: 4 additions & 4 deletions pkgs/stdenv/linux/default.nix
Expand Up @@ -219,7 +219,7 @@ in
};
extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
lib.optional localSystem.isAarch64 prevStage.updateAutotoolsGnuConfigScriptsHook;
})


Expand Down Expand Up @@ -251,7 +251,7 @@ in
};
extraNativeBuildInputs = [ prevStage.patchelf prevStage.xz ] ++
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
lib.optional localSystem.isAarch64 prevStage.updateAutotoolsGnuConfigScriptsHook;
})

# Construct the final stdenv. It uses the Glibc and GCC, and adds
Expand Down Expand Up @@ -281,7 +281,7 @@ in

extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
lib.optional localSystem.isAarch64 prevStage.updateAutotoolsGnuConfigScriptsHook;

cc = prevStage.gcc;

Expand Down Expand Up @@ -312,7 +312,7 @@ in
glibc.out glibc.dev glibc.bin/*propagated from .dev*/ linuxHeaders
gcc gcc.cc gcc.cc.lib gcc.expand-response-params
]
++ lib.optionals (system == "aarch64-linux")
++ lib.optionals localSystem.isAarch64
[ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ];

overrides = self: super: {
Expand Down
24 changes: 13 additions & 11 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -5381,6 +5381,7 @@ with pkgs;
gambit = callPackage ../development/compilers/gambit { };
gerbil = callPackage ../development/compilers/gerbil { };

gccFun = callPackage ../development/compilers/gcc/6;
gcc = gcc6;
gcc-unwrapped = gcc.cc;

Expand Down Expand Up @@ -5429,19 +5430,27 @@ with pkgs;
cc = buildPackages.gccCrossStageStatic;
};

# The GCC used to build libc for the target platform. Normal gccs will be
# built with, and use, that cross-compiled libc.
gccCrossStageStatic = assert targetPlatform != buildPlatform; let
libcCross1 =
if targetPlatform.libc == "msvcrt" then __targetPackages.windows.mingw_w64_headers
else if targetPlatform.libc == "libSystem" then darwin.xcode
else null;
in wrapCCWith {
name = "gcc-cross-wrapper";
cc = gcc.cc.override {
cc = gccFun {
# copy-pasted
inherit noSysDirs;
# PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
isl = if !stdenv.isDarwin then isl_0_14 else null;

# just for stage static
crossStageStatic = true;
langCC = false;
libcCross = libcCross1;
enableShared = false;
# Why is this needed?
};
libc = libcCross1;
};
Expand All @@ -5453,14 +5462,6 @@ with pkgs;
libc = windows.mingw_headers2;
};

gccCrossStageFinal = assert targetPlatform != buildPlatform; wrapCCWith {
name = "gcc-cross-wrapper";
cc = gcc.cc.override {
crossStageStatic = false;
};
libc = libcCross;
};

gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 {
inherit noSysDirs;
texinfo = texinfo4;
Expand Down Expand Up @@ -6225,8 +6226,9 @@ with pkgs;
ccWrapperFun = callPackage ../build-support/cc-wrapper;

wrapCC = cc: wrapCCWith {
name = lib.optionalString (targetPlatform != hostPlatform) "gcc-cross-wrapper";
inherit cc;
inherit (stdenv.cc) libc;
libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
};
# legacy version, used for gnat bootstrapping
wrapGCC-old = baseGCC: callPackage ../build-support/gcc-wrapper-old {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/release-cross.nix
Expand Up @@ -19,7 +19,7 @@ let
};

gnuCommon = lib.recursiveUpdate common {
buildPackages.gccCrossStageFinal = nativePlatforms;
buildPackages.gcc = nativePlatforms;
coreutils = nativePlatforms;
};

Expand Down

0 comments on commit 1dd63de

Please sign in to comment.