Skip to content

Commit 1dd63de

Browse files
committedSep 22, 2017
Merge some Master PRs into staging
No native hashes should be changed
2 parents e151230 + b9bf90c commit 1dd63de

File tree

13 files changed

+56
-39
lines changed

13 files changed

+56
-39
lines changed
 

‎pkgs/development/compilers/gcc/4.5/default.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
, enableMultilib ? false
2121
, name ? "gcc"
2222
, libcCross ? null
23-
, crossStageStatic ? true
23+
, crossStageStatic ? false
2424
, gnat ? null
2525
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
2626
, stripped ? true
@@ -213,7 +213,9 @@ stdenv.mkDerivation ({
213213
''
214214
else null;
215215

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

219221
nativeBuildInputs = [ texinfo which gettext ]

‎pkgs/development/compilers/gcc/4.8/default.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
, enablePlugin ? true # whether to support user-supplied plug-ins
2727
, name ? "gcc"
2828
, libcCross ? null
29-
, crossStageStatic ? true
29+
, crossStageStatic ? false
3030
, gnat ? null
3131
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3232
, stripped ? true
@@ -284,7 +284,9 @@ stdenv.mkDerivation ({
284284
''
285285
else null;
286286

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

290292
nativeBuildInputs = [ texinfo which gettext ]

‎pkgs/development/compilers/gcc/4.9/default.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
, enablePlugin ? true # whether to support user-supplied plug-ins
2727
, name ? "gcc"
2828
, libcCross ? null
29-
, crossStageStatic ? true
29+
, crossStageStatic ? false
3030
, gnat ? null
3131
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3232
, stripped ? true
@@ -280,7 +280,9 @@ stdenv.mkDerivation ({
280280
''
281281
else null;
282282

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

286288
nativeBuildInputs = [ texinfo which gettext ]

‎pkgs/development/compilers/gcc/5/default.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
, enablePlugin ? true # whether to support user-supplied plug-ins
2727
, name ? "gcc"
2828
, libcCross ? null
29-
, crossStageStatic ? true
29+
, crossStageStatic ? false
3030
, gnat ? null
3131
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3232
, stripped ? true
@@ -298,7 +298,9 @@ stdenv.mkDerivation ({
298298
''
299299
else null;
300300

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

304306
nativeBuildInputs = [ texinfo which gettext ]

‎pkgs/development/compilers/gcc/6/default.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
, enablePlugin ? true # whether to support user-supplied plug-ins
2727
, name ? "gcc"
2828
, libcCross ? null
29-
, crossStageStatic ? true
29+
, crossStageStatic ? false
3030
, gnat ? null
3131
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3232
, stripped ? true
@@ -292,7 +292,9 @@ stdenv.mkDerivation ({
292292
''
293293
else null;
294294

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

298300
nativeBuildInputs = [ texinfo which gettext ]

‎pkgs/development/compilers/gcc/7/default.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
, enablePlugin ? true # whether to support user-supplied plug-ins
2727
, name ? "gcc"
2828
, libcCross ? null
29-
, crossStageStatic ? true
29+
, crossStageStatic ? false
3030
, gnat ? null
3131
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3232
, stripped ? true
@@ -294,7 +294,9 @@ stdenv.mkDerivation ({
294294
''
295295
else null;
296296

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

300302
nativeBuildInputs = [ texinfo which gettext ]

‎pkgs/development/compilers/gcc/snapshot/default.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
, enablePlugin ? true # whether to support user-supplied plug-ins
2727
, name ? "gcc"
2828
, libcCross ? null
29-
, crossStageStatic ? true
29+
, crossStageStatic ? false
3030
, gnat ? null
3131
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3232
, stripped ? true
@@ -281,7 +281,9 @@ stdenv.mkDerivation ({
281281
''
282282
else null;
283283

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

287289
nativeBuildInputs = [ texinfo which gettext ]

‎pkgs/os-specific/gnu/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
44
, texinfo, glibcCross, hurdPartedCross, libuuid, samba
5-
, gccCrossStageStatic, gccCrossStageFinal
5+
, gccCrossStageStatic, gcc
66
, forceSystem, newScope, platform, config
77
, targetPlatform, buildPlatform
88
, overrides ? {}
@@ -28,7 +28,7 @@ let
2828
automake = automake111x;
2929
headersOnly = false;
3030
cross = assert targetPlatform != buildPlatform; targetPlatform;
31-
gccCross = gccCrossStageFinal;
31+
gccCross = gcc;
3232
};
3333

3434
hurdCrossIntermediate = forcedNativePackages.callPackage ./hurd {

‎pkgs/stdenv/adapters.nix

+7-6
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,18 @@ rec {
5959
makeStdenvCross = { stdenv
6060
, cc
6161
, buildPlatform, hostPlatform, targetPlatform
62+
, # Prior overrides are surely not valid as packages built
63+
# with this run on a different platform, so disable by
64+
# default.
65+
overrides ? _: _: {}
6266
} @ overrideArgs: let
6367
stdenv = overrideArgs.stdenv.override {
6468
inherit
6569
buildPlatform hostPlatform targetPlatform
66-
cc;
70+
cc overrides;
6771

6872
allowedRequisites = null;
69-
70-
# Overrides are surely not valid as packages built with this run on a
71-
# different platform.
72-
overrides = _: _: {};
73+
extraBuildInputs = [ ]; # Old ones run on wrong platform
7374
};
7475
in stdenv // {
7576
mkDerivation =
@@ -105,7 +106,7 @@ rec {
105106
# without proper `file` command, libtool sometimes fails
106107
# to recognize 64-bit DLLs
107108
++ stdenv.lib.optional (hostPlatform.config == "x86_64-w64-mingw32") pkgs.file
108-
++ stdenv.lib.optional (hostPlatform.config == "aarch64-linux-gnu") pkgs.updateAutotoolsGnuConfigScriptsHook
109+
++ stdenv.lib.optional hostPlatform.isAarch64 pkgs.updateAutotoolsGnuConfigScriptsHook
109110
;
110111

111112
# Cross-linking dynamic libraries, every buildInput should

‎pkgs/stdenv/cross/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ in bootStages ++ [
3535
targetPlatform = crossSystem;
3636
cc = if crossSystem.useiOSCross or false
3737
then buildPackages.darwin.ios-cross
38-
else buildPackages.gccCrossStageFinal;
38+
else buildPackages.gcc;
3939
};
4040
})
4141

‎pkgs/stdenv/linux/default.nix

+4-4
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ in
219219
};
220220
extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
221221
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
222-
lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook;
222+
lib.optional localSystem.isAarch64 prevStage.updateAutotoolsGnuConfigScriptsHook;
223223
})
224224

225225

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

257257
# Construct the final stdenv. It uses the Glibc and GCC, and adds
@@ -281,7 +281,7 @@ in
281281

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

286286
cc = prevStage.gcc;
287287

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

318318
overrides = self: super: {

‎pkgs/top-level/all-packages.nix

+13-11
Original file line numberDiff line numberDiff line change
@@ -5381,6 +5381,7 @@ with pkgs;
53815381
gambit = callPackage ../development/compilers/gambit { };
53825382
gerbil = callPackage ../development/compilers/gerbil { };
53835383

5384+
gccFun = callPackage ../development/compilers/gcc/6;
53845385
gcc = gcc6;
53855386
gcc-unwrapped = gcc.cc;
53865387

@@ -5429,19 +5430,27 @@ with pkgs;
54295430
cc = buildPackages.gccCrossStageStatic;
54305431
};
54315432

5433+
# The GCC used to build libc for the target platform. Normal gccs will be
5434+
# built with, and use, that cross-compiled libc.
54325435
gccCrossStageStatic = assert targetPlatform != buildPlatform; let
54335436
libcCross1 =
54345437
if targetPlatform.libc == "msvcrt" then __targetPackages.windows.mingw_w64_headers
54355438
else if targetPlatform.libc == "libSystem" then darwin.xcode
54365439
else null;
54375440
in wrapCCWith {
54385441
name = "gcc-cross-wrapper";
5439-
cc = gcc.cc.override {
5442+
cc = gccFun {
5443+
# copy-pasted
5444+
inherit noSysDirs;
5445+
# PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
5446+
profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
5447+
isl = if !stdenv.isDarwin then isl_0_14 else null;
5448+
5449+
# just for stage static
54405450
crossStageStatic = true;
54415451
langCC = false;
54425452
libcCross = libcCross1;
54435453
enableShared = false;
5444-
# Why is this needed?
54455454
};
54465455
libc = libcCross1;
54475456
};
@@ -5453,14 +5462,6 @@ with pkgs;
54535462
libc = windows.mingw_headers2;
54545463
};
54555464

5456-
gccCrossStageFinal = assert targetPlatform != buildPlatform; wrapCCWith {
5457-
name = "gcc-cross-wrapper";
5458-
cc = gcc.cc.override {
5459-
crossStageStatic = false;
5460-
};
5461-
libc = libcCross;
5462-
};
5463-
54645465
gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 {
54655466
inherit noSysDirs;
54665467
texinfo = texinfo4;
@@ -6225,8 +6226,9 @@ with pkgs;
62256226
ccWrapperFun = callPackage ../build-support/cc-wrapper;
62266227

62276228
wrapCC = cc: wrapCCWith {
6229+
name = lib.optionalString (targetPlatform != hostPlatform) "gcc-cross-wrapper";
62286230
inherit cc;
6229-
inherit (stdenv.cc) libc;
6231+
libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
62306232
};
62316233
# legacy version, used for gnat bootstrapping
62326234
wrapGCC-old = baseGCC: callPackage ../build-support/gcc-wrapper-old {

‎pkgs/top-level/release-cross.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let
1919
};
2020

2121
gnuCommon = lib.recursiveUpdate common {
22-
buildPackages.gccCrossStageFinal = nativePlatforms;
22+
buildPackages.gcc = nativePlatforms;
2323
coreutils = nativePlatforms;
2424
};
2525

0 commit comments

Comments
 (0)
Please sign in to comment.