Skip to content

Commit

Permalink
Merge pull request #350 from Pivot-Studio/feat/llvm@16
Browse files Browse the repository at this point in the history
feat: bump llvm to version 16
  • Loading branch information
Chronostasys authored Nov 23, 2023
2 parents d7cefb2 + 590b61b commit 62c5ebc
Show file tree
Hide file tree
Showing 62 changed files with 2,728 additions and 746 deletions.
134 changes: 30 additions & 104 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ authors = ["The pivot-lang Authors"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
inkwell = { version = "0.1", optional = true, features = ["llvm14-0", "no-libffi-linking"] }
llvm-sys = { version = "140", optional = true }
inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master", optional = true, features = ["llvm16-0", "no-libffi-linking"] }
llvm-sys = { version = "160", optional = true }
pl_linker = { path = "./pl_linker", optional = true }
immix = { path = "./immix", optional = true, features = ["llvm_gc_plugin", "llvm_stackmap"] }
vm = { path = "./vm", optional = true, features = ["jit"] }
Expand Down Expand Up @@ -45,6 +45,7 @@ derivative = "2.2"
console = "0.15"
anstyle = "1.0"
regex = "1.9"
ena = "0.2"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion immix/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ libc = "0.2"
parking_lot = "0.12"
rustc-hash = "1.1"
lazy_static = "1.4"
vector-map = "1.0"
backtrace = "0.3"
log = "0.4"
memory-stats = "1.1"
threadpool = {version = "1.8"}

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["winuser","memoryapi"] }
Expand Down
2 changes: 1 addition & 1 deletion immix/benches/immix_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ fn test_complecated_multiple_thread_gc(num_iter: usize, threads: usize) -> Durat
for h in handles {
times.push(h.join().unwrap());
}
times.sort_by(|k1, k2| (k1).cmp(k2));
times.sort();
times.pop().unwrap()
}

Expand Down
22 changes: 12 additions & 10 deletions immix/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@ fn main() {
lazy_static! {
/// A single path to search for LLVM in (containing bin/llvm-config)
static ref ENV_LLVM_PREFIX: String =
format!("LLVM_SYS_{}_PREFIX", 140);
format!("LLVM_SYS_{}_PREFIX", 160);

/// If exactly "YES", ignore the version blocklist
static ref ENV_IGNORE_BLOCKLIST: String =
format!("LLVM_SYS_{}_IGNORE_BLOCKLIST", 140);
format!("LLVM_SYS_{}_IGNORE_BLOCKLIST", 160);

/// If set, enforce precise correspondence between crate and binary versions.
static ref ENV_STRICT_VERSIONING: String =
format!("LLVM_SYS_{}_STRICT_VERSIONING", 140);
format!("LLVM_SYS_{}_STRICT_VERSIONING", 160);

/// If set, do not attempt to strip irrelevant options for llvm-config --cflags
static ref ENV_NO_CLEAN_CFLAGS: String =
format!("LLVM_SYS_{}_NO_CLEAN_CFLAGS", 140);
format!("LLVM_SYS_{}_NO_CLEAN_CFLAGS", 160);

/// If set and targeting MSVC, force the debug runtime library
static ref ENV_USE_DEBUG_MSVCRT: String =
format!("LLVM_SYS_{}_USE_DEBUG_MSVCRT", 140);
format!("LLVM_SYS_{}_USE_DEBUG_MSVCRT", 160);

/// If set, always link against libffi
static ref ENV_FORCE_FFI: String =
format!("LLVM_SYS_{}_FFI_WORKAROUND", 140);
format!("LLVM_SYS_{}_FFI_WORKAROUND", 160);
}

lazy_static! {
/// LLVM version used by this version of the crate.
static ref CRATE_VERSION: Version = {
let crate_version = Version::parse("140.0.6")
let crate_version = Version::parse("160.0.6")
.expect("Crate version is somehow not valid semver");
Version {
major: crate_version.major / 10,
Expand Down Expand Up @@ -244,19 +244,21 @@ fn main() {
fn get_system_libraries() -> Vec<String> {
llvm_config("--system-libs")
.split(&[' ', '\n'] as &[char])
.filter(|s| !s.is_empty())
.filter(|s| !s.is_empty() && s.starts_with("-l"))
.map(|flag| {
if cfg!(target_env = "msvc") {
// Same as --libnames, foo.lib
assert!(flag.ends_with(".lib"));
&flag[..flag.len() - 4]
} else if cfg!(target_os = "macos") {
// Linker flags style, -lfoo
assert!(flag.starts_with("-l"));
// assert!(flag.starts_with("-l"), "{}",flag);
if flag.ends_with(".tbd") && flag.starts_with("-llib") {
&flag[5..flag.len() - 4]
} else if let Some(postfix) = flag.strip_prefix("-l") {
postfix
} else {
&flag[2..]
flag
}
} else {
if let Some(f) = flag.strip_prefix("-l") {
Expand Down
Loading

0 comments on commit 62c5ebc

Please sign in to comment.