Skip to content

Commit

Permalink
fix: windows jit compiler_builtin
Browse files Browse the repository at this point in the history
  • Loading branch information
Chronostasys committed Apr 30, 2024
1 parent 160cdb1 commit 79b73b8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/ast/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ fn test_doc_symbol() {

#[test]
#[cfg(feature = "jit")]
#[cfg(not(windows))] // FIXME: windows i128 issue https://discourse.llvm.org/c/beginners/17
fn test_orc_jit() {
use crate::ast::compiler::{compile, Options};
use std::path::PathBuf;
Expand Down
4 changes: 2 additions & 2 deletions vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ path = "src/lib.rs"
crate-type = ["staticlib", "lib", "cdylib"]

[features]
default = ["static", "immix", "nolog"]
jit = ["internal_macro/jit"]
default = ["static", "immix", "nolog", "jitdylib"]
jitdylib = []
static = ["internal_macro/static"]
immix = []
nolog = ["log/release_max_level_off"]
12 changes: 12 additions & 0 deletions vm/src/compiler_rt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! walkaround for windows, see https://discourse.llvm.org/t/orc-jit-on-windows-cannot-find-divti3/78676/2
use internal_macro::is_runtime;

#[is_runtime]
fn __divti3(a: i128, b: i128) -> i128 {
a / b
}

#[is_runtime]
fn __modti3(a: i128, b: i128) -> i128 {
a % b
}
3 changes: 3 additions & 0 deletions vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,6 @@ fn millitime() -> i64 {
.unwrap()
.as_millis() as _
}

#[cfg(all(windows, feature = "jitdylib"))]
mod compiler_rt;

0 comments on commit 79b73b8

Please sign in to comment.