-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #122599 - bjorn3:sync_cg_clif-2024-03-16, r=bjorn3
Subtree sync for rustc_codegen_cranelift The main highlight this time is a fix for a recently introduced ICE. Fixes #122399 r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
- Loading branch information
Showing
7 changed files
with
83 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
compiler/rustc_codegen_cranelift/patches/bcryptprimitives.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Shim for bcryptprimitives.dll. The Wine version shipped with Ubuntu 22.04 | ||
// doesn't support it yet. Authored by @ChrisDenton | ||
|
||
#![crate_type = "cdylib"] | ||
#![allow(nonstandard_style)] | ||
|
||
#[no_mangle] | ||
pub unsafe extern "system" fn ProcessPrng(mut pbData: *mut u8, mut cbData: usize) -> i32 { | ||
while cbData > 0 { | ||
let size = core::cmp::min(cbData, u32::MAX as usize); | ||
RtlGenRandom(pbData, size as u32); | ||
cbData -= size; | ||
pbData = pbData.add(size); | ||
} | ||
1 | ||
} | ||
|
||
#[link(name = "advapi32")] | ||
extern "system" { | ||
#[link_name = "SystemFunction036"] | ||
pub fn RtlGenRandom(RandomBuffer: *mut u8, RandomBufferLength: u32) -> u8; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[toolchain] | ||
channel = "nightly-2024-03-08" | ||
channel = "nightly-2024-03-16" | ||
components = ["rust-src", "rustc-dev", "llvm-tools"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters