Add some patches for libstd
This commit is contained in:
parent
ed9528a104
commit
07c693b764
25
patches/0013-Patch-away-bswap-usage.patch
Normal file
25
patches/0013-Patch-away-bswap-usage.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From da996dae0b95f986de46a916aca00e03257ba4f9 Mon Sep 17 00:00:00 2001
|
||||
From: bjorn3 <bjorn3@users.noreply.github.com>
|
||||
Date: Wed, 30 Jan 2019 14:51:57 +0100
|
||||
Subject: [PATCH] Patch away bswap usage
|
||||
|
||||
---
|
||||
src/libcore/num/mod.rs | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
|
||||
index f928d40..6a146f5 100644
|
||||
--- a/src/libcore/num/mod.rs
|
||||
+++ b/src/libcore/num/mod.rs
|
||||
@@ -2303,7 +2303,7 @@ assert_eq!(m, ", $swapped, ");
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub const fn swap_bytes(self) -> Self {
|
||||
- intrinsics::bswap(self as $ActualT) as Self
|
||||
+ 0 // bswap is unsupported by cg_clif
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.11.0
|
||||
|
57
patches/0014-Don-t-use-OS-TLS.patch
Normal file
57
patches/0014-Don-t-use-OS-TLS.patch
Normal file
@ -0,0 +1,57 @@
|
||||
From 1ad7a849f9ff845f676d4625ba71d1060039c0de Mon Sep 17 00:00:00 2001
|
||||
From: bjorn3 <bjorn3@users.noreply.github.com>
|
||||
Date: Thu, 31 Jan 2019 20:11:56 +0100
|
||||
Subject: [PATCH] Don't use OS TLS
|
||||
|
||||
---
|
||||
src/libstd/thread/local.rs | 4 ++--
|
||||
src/libstd/thread/mod.rs | 1 -
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
|
||||
index 5d2eb5f..39513b6 100644
|
||||
--- a/src/libstd/thread/local.rs
|
||||
+++ b/src/libstd/thread/local.rs
|
||||
@@ -160,10 +160,10 @@ macro_rules! __thread_local_inner {
|
||||
&'static $crate::cell::UnsafeCell<
|
||||
$crate::option::Option<$t>>>
|
||||
{
|
||||
- #[cfg(all(target_arch = "wasm32", not(target_feature = "atomics")))]
|
||||
static __KEY: $crate::thread::__StaticLocalKeyInner<$t> =
|
||||
$crate::thread::__StaticLocalKeyInner::new();
|
||||
|
||||
+ /*
|
||||
#[thread_local]
|
||||
#[cfg(all(
|
||||
target_thread_local,
|
||||
@@ -178,6 +178,7 @@ macro_rules! __thread_local_inner {
|
||||
))]
|
||||
static __KEY: $crate::thread::__OsLocalKeyInner<$t> =
|
||||
$crate::thread::__OsLocalKeyInner::new();
|
||||
+ */
|
||||
|
||||
__KEY.get()
|
||||
}
|
||||
@@ -304,7 +305,6 @@ impl<T: 'static> LocalKey<T> {
|
||||
/// On some platforms like wasm32 there's no threads, so no need to generate
|
||||
/// thread locals and we can instead just use plain statics!
|
||||
#[doc(hidden)]
|
||||
-#[cfg(all(target_arch = "wasm32", not(target_feature = "atomics")))]
|
||||
pub mod statik {
|
||||
use cell::UnsafeCell;
|
||||
use fmt;
|
||||
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
|
||||
index eb8e0c1..b44d737 100644
|
||||
--- a/src/libstd/thread/mod.rs
|
||||
+++ b/src/libstd/thread/mod.rs
|
||||
@@ -195,7 +195,6 @@ pub use self::local::{LocalKey, AccessError};
|
||||
// where available, but both are needed.
|
||||
|
||||
#[unstable(feature = "libstd_thread_internals", issue = "0")]
|
||||
-#[cfg(all(target_arch = "wasm32", not(target_feature = "atomics")))]
|
||||
#[doc(hidden)] pub use self::local::statik::Key as __StaticLocalKeyInner;
|
||||
#[unstable(feature = "libstd_thread_internals", issue = "0")]
|
||||
#[cfg(target_thread_local)]
|
||||
--
|
||||
2.11.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user