Skip to content

Commit 80be467

Browse files
committed
[WIP] Tls support
1 parent 85ce626 commit 80be467

15 files changed

+326
-180
lines changed

Cargo.lock

+32-92
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ default-features = false
3030
features = ["write"] # We don't need read support
3131

3232
# Uncomment to use local checkout of cranelift
33-
#[patch."https://github.com/bytecodealliance/cranelift/"]
34-
#cranelift-codegen = { path = "../cranelift/cranelift-codegen" }
35-
#cranelift-frontend = { path = "../cranelift/cranelift-frontend" }
36-
#cranelift-module = { path = "../cranelift/cranelift-module" }
37-
#cranelift-simplejit = { path = "../cranelift/cranelift-simplejit" }
38-
#cranelift-object = { path = "../cranelift/cranelift-object" }
33+
[patch."https://github.com/bytecodealliance/cranelift/"]
34+
cranelift-codegen = { path = "../cranelift/cranelift-codegen", default-features = false, features = ["std"] }
35+
cranelift-frontend = { path = "../cranelift/cranelift-frontend", default-features = false, features = ["std"] }
36+
cranelift-module = { path = "../cranelift/cranelift-module" }
37+
cranelift-simplejit = { path = "../cranelift/cranelift-simplejit" }
38+
cranelift-object = { path = "../cranelift/cranelift-object" }
3939

4040
#[patch.crates-io]
4141
#gimli = { path = "../" }

crate_patches/regex.patch

-34
This file was deleted.

example/mini_core.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![feature(
22
no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types,
3-
untagged_unions, decl_macro, rustc_attrs, transparent_unions, optin_builtin_traits
3+
untagged_unions, decl_macro, rustc_attrs, transparent_unions, optin_builtin_traits,
4+
thread_local,
45
)]
56
#![no_core]
67
#![allow(dead_code)]
@@ -551,3 +552,11 @@ struct PanicLocation {
551552
line: u32,
552553
column: u32,
553554
}
555+
556+
#[no_mangle]
557+
pub fn get_tls() -> u8 {
558+
#[thread_local]
559+
static A: u8 = 42;
560+
561+
A
562+
}

0 commit comments

Comments
 (0)