-
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.
Cranelift: Don't use raw-dylib in std
- Loading branch information
1 parent
4cf4f2d
commit 65c3de2
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
compiler/rustc_codegen_cranelift/patches/0029-stdlib-rawdylib-processprng.patch
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,47 @@ | ||
From 4b729c081aa1a4c86c12e28ce10940b95f846341 Mon Sep 17 00:00:00 2001 | ||
From: Chris Denton <chris@chrisdenton.dev> | ||
Date: Tue, 20 Feb 2024 16:01:40 -0300 | ||
Subject: [PATCH] Don't use raw-dylib in std | ||
|
||
--- | ||
library/std/src/sys/pal/windows/c.rs | 2 +- | ||
library/std/src/sys/pal/windows/rand.rs | 3 +-- | ||
2 files changed, 2 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs | ||
index f7ebf12bd99..4c99d927c70 100644 | ||
--- a/library/std/src/sys/pal/windows/c.rs | ||
+++ b/library/std/src/sys/pal/windows/c.rs | ||
@@ -323,7 +323,7 @@ pub unsafe fn NtWriteFile( | ||
|
||
// Use raw-dylib to import ProcessPrng as we can't rely on there being an import library. | ||
cfg_if::cfg_if! { | ||
-if #[cfg(not(target_vendor = "win7"))] { | ||
+if #[cfg(any())] { | ||
#[cfg(target_arch = "x86")] | ||
#[link(name = "bcryptprimitives", kind = "raw-dylib", import_name_type = "undecorated")] | ||
extern "system" { | ||
diff --git a/library/std/src/sys/pal/windows/rand.rs b/library/std/src/sys/pal/windows/rand.rs | ||
index 74f26c28dd0..a755c08682e 100644 | ||
--- a/library/std/src/sys/pal/windows/rand.rs | ||
+++ b/library/std/src/sys/pal/windows/rand.rs | ||
@@ -1,7 +1,7 @@ | ||
use crate::mem; | ||
use crate::sys::c; | ||
|
||
-#[cfg(not(target_vendor = "win7"))] | ||
+#[cfg(any())] | ||
#[inline] | ||
pub fn hashmap_random_keys() -> (u64, u64) { | ||
let mut v = (0, 0); | ||
@@ -12,7 +12,6 @@ pub fn hashmap_random_keys() -> (u64, u64) { | ||
v | ||
} | ||
|
||
-#[cfg(target_vendor = "win7")] | ||
pub fn hashmap_random_keys() -> (u64, u64) { | ||
use crate::ffi::c_void; | ||
use crate::io; | ||
-- | ||
2.42.0.windows.2 | ||
|