Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
10 changes: 8 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cranelift/jit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cranelift-entity = { workspace = true }
cranelift-control = { workspace = true }
wasmtime-unwinder = { workspace = true, optional = true, features = ["cranelift"] }
anyhow = { workspace = true }
region = "3.0.2"
region = { git = "https://github.com/RossComputerGuy/region-rs", branch = "fix/uefi" }
libc = { workspace = true }
target-lexicon = { workspace = true }
memmap2 = { version = "0.2.1", optional = true }
Expand Down
9 changes: 8 additions & 1 deletion cranelift/jit/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use cranelift_module::{
use log::info;
use std::cell::RefCell;
use std::collections::HashMap;
#[cfg(not(target_os = "uefi"))]
use std::ffi::CString;
use std::io::Write;
use target_lexicon::PointerWidth;
Expand Down Expand Up @@ -88,7 +89,13 @@ impl JITBuilder {
libcall_names: Box<dyn Fn(ir::LibCall) -> String + Send + Sync>,
) -> Self {
let symbols = HashMap::new();

#[cfg(not(target_os = "uefi"))]
let lookup_symbols = vec![Box::new(lookup_with_dlsym) as Box<_>];

#[cfg(target_os = "uefi")]
let lookup_symbols = vec![];

Self {
isa,
symbols,
Expand Down Expand Up @@ -656,7 +663,7 @@ impl Module for JITModule {
}
}

#[cfg(not(windows))]
#[cfg(all(not(windows), not(target_os = "uefi")))]
fn lookup_with_dlsym(name: &str) -> Option<*const u8> {
let c_str = CString::new(name).unwrap();
let c_str_ptr = c_str.as_ptr();
Expand Down
6 changes: 5 additions & 1 deletion cranelift/jit/src/memory/system.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use cranelift_module::{ModuleError, ModuleResult};

#[cfg(all(not(target_os = "windows"), feature = "selinux-fix"))]
#[cfg(all(
not(target_os = "windows"),
not(target_os = "uefi"),
feature = "selinux-fix"
))]
use memmap2::MmapMut;

#[cfg(not(any(feature = "selinux-fix", windows)))]
Expand Down
Loading