Skip to content

Commit 0b0e691

Browse files
committed
rust 1.41: Fix build with no_std only target
See rust-lang/rust#69381
1 parent c1a1650 commit 0b0e691

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

pkgs/development/compilers/rust/1_41_0.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
# request review, in case platforms cannot be covered.
77
# 2. The LLVM version used for building should match with rust upstream.
88
# 3. Firefox and Thunderbird should still build on x86_64-linux.
9+
10+
{ stdenv, lib
11+
, buildPackages
12+
, newScope, callPackage
13+
, CoreFoundation, Security
14+
, llvmPackages_5
15+
, pkgsBuildTarget, pkgsBuildBuild
16+
, fetchpatch
17+
} @ args:
18+
919
import ./default.nix {
1020
rustcVersion = "1.41.0";
1121
rustcSha256 = "0jypz2mrzac41sj0zh07yd1z36g2s2rvgsb8g624sk4l14n84ijm";
@@ -26,4 +36,13 @@ import ./default.nix {
2636
};
2737

2838
selectRustPackage = pkgs: pkgs.rust_1_41_0;
39+
40+
rustcPatches = [
41+
(fetchpatch {
42+
url = "https://github.com/QuiltOS/rust/commit/f1803452b9e95bfdbc3b8763138b9f92c7d12b46.diff";
43+
sha256 = "1mzxaj46bq7ll617wg0mqnbnwr1da3hd4pbap8bjwhs3kfqnr7kk";
44+
})
45+
];
2946
}
47+
48+
(builtins.removeAttrs args [ "fetchpatch" ])

pkgs/development/compilers/rust/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
, bootstrapVersion
55
, bootstrapHashes
66
, selectRustPackage
7+
, rustcPatches ? []
78
}:
89
{ stdenv, lib
910
, buildPackages
@@ -73,6 +74,8 @@
7374
sha256 = rustcSha256;
7475
inherit enableRustcDev;
7576

77+
patches = rustcPatches;
78+
7679
# Use boot package set to break cycle
7780
rustPlatform = bootRustPlatform;
7881
} // lib.optionalAttrs (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) {

pkgs/development/compilers/rust/rustc.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
, enableRustcDev ? true
88
, version
99
, sha256
10+
, patches ? []
1011
}:
1112

1213
let
@@ -104,6 +105,8 @@ in stdenv.mkDerivation rec {
104105
# the rust build system complains that nix alters the checksums
105106
dontFixLibtool = true;
106107

108+
inherit patches;
109+
107110
postPatch = ''
108111
patchShebangs src/etc
109112

0 commit comments

Comments
 (0)