Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions microsoft/surface/common/kernel/6.12/patches.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,8 @@
name = "ms-surface/0014-rtc";
patch = patchSrc + "/0014-rtc.patch";
}
{
name = "rust-1.91-fix";
patch = ../rust_1-91_fix.patch;
}
]
4 changes: 4 additions & 0 deletions microsoft/surface/common/kernel/6.15/patches.nix
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,8 @@
name = "ms-surface/0015-rtc";
patch = patchSrc + "/0015-rtc.patch";
}
{
name = "rust-1.91-fix";
patch = ../rust_1-91_fix.patch;
}
]
30 changes: 30 additions & 0 deletions microsoft/surface/common/kernel/rust_1-91_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target.rs
index 39c82908ff3a3f..38b3416bb9799e 100644
--- a/scripts/generate_rust_target.rs
+++ b/scripts/generate_rust_target.rs
@@ -225,7 +225,11 @@ fn main() {
ts.push("features", features);
ts.push("llvm-target", "x86_64-linux-gnu");
ts.push("supported-sanitizers", ["kcfi", "kernel-address"]);
- ts.push("target-pointer-width", "64");
+ if cfg.rustc_version_atleast(1, 91, 0) {
+ ts.push("target-pointer-width", 64);
+ } else {
+ ts.push("target-pointer-width", "64");
+ }
} else if cfg.has("X86_32") {
// This only works on UML, as i386 otherwise needs regparm support in rustc
if !cfg.has("UML") {
@@ -245,7 +249,11 @@ fn main() {
}
ts.push("features", features);
ts.push("llvm-target", "i386-unknown-linux-gnu");
- ts.push("target-pointer-width", "32");
+ if cfg.rustc_version_atleast(1, 91, 0) {
+ ts.push("target-pointer-width", 32);
+ } else {
+ ts.push("target-pointer-width", "32");
+ }
} else if cfg.has("LOONGARCH") {
panic!("loongarch uses the builtin rustc loongarch64-unknown-none-softfloat target");
} else {