diff --git a/Cargo.toml b/Cargo.toml index c2e0441..5465aa4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,15 @@ name = "repl" required-features = ["repl"] [profile.perf] -debug = 1 +debug = 2 +strip = false inherits = "release" +[profile.release] +lto = true +codegen-units = 1 +strip = true + [dependencies] rnix = "0.12" thiserror = "2.0" diff --git a/src/jit/mod.rs b/src/jit/mod.rs index 5730856..4f93d8a 100644 --- a/src/jit/mod.rs +++ b/src/jit/mod.rs @@ -135,9 +135,13 @@ pub struct JITContext<'ctx> { impl<'vm, 'ctx: 'vm> JITContext<'ctx> { pub fn new(context: &'ctx Context) -> Self { + // force linker to link JIT engine + unsafe { + inkwell::llvm_sys::execution_engine::LLVMLinkInMCJIT(); + } let module = context.create_module("nixjit"); let execution_engine = module - .create_jit_execution_engine(OptimizationLevel::Default) + .create_jit_execution_engine(OptimizationLevel::Aggressive) .unwrap(); let helpers = Helpers::new(context, &module, &execution_engine);