diff --git a/Cargo.lock b/Cargo.lock index 1bb6110..1a97402 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1659,7 +1659,6 @@ version = "4.0.0" source = "git+https://github.com/danipopes/revm?branch=tmp-prs#30923817aa72866a907c8fb5bff47f8e20073ad4" dependencies = [ "revm-primitives", - "serde", ] [[package]] @@ -1759,7 +1758,6 @@ dependencies = [ "enumn", "hashbrown 0.14.3", "hex", - "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d383a1b..24c3065 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,15 +22,6 @@ rust.unused_must_use = "deny" rust.rust_2018_idioms = "deny" rustdoc.all = "warn" -[profile.bitcode] -inherits = "release" -opt-level = 3 -debug = 0 -lto = "fat" -strip = "symbols" -panic = "abort" -codegen-units = 1 - [workspace.dependencies] revm-jit = { version = "0.1.0", path = "crates/revm-jit", default-features = false } revm-jit-backend = { version = "0.1.0", path = "crates/revm-jit-backend", default-features = false } diff --git a/crates/revm-jit-builtins/Cargo.toml b/crates/revm-jit-builtins/Cargo.toml index d0e88ae..bc240ea 100644 --- a/crates/revm-jit-builtins/Cargo.toml +++ b/crates/revm-jit-builtins/Cargo.toml @@ -14,7 +14,9 @@ repository.workspace = true exclude.workspace = true [lib] -crate-type = ["rlib"] +# We want this library both to be available in the final binary for JIT-ing, as well as a dynamic +# library for the AOT-produced object files to link against. +crate-type = ["lib", "dylib"] [lints] workspace = true @@ -30,6 +32,4 @@ revm-jit-backend = { workspace = true, optional = true } tracing = { workspace = true, optional = true } [features] -default = ["std"] ir = ["dep:revm-jit-backend", "dep:tracing"] -std = ["revm-jit-context/std"] diff --git a/crates/revm-jit-builtins/src/ir.rs b/crates/revm-jit-builtins/src/ir.rs index 42e2147..11395b5 100644 --- a/crates/revm-jit-builtins/src/ir.rs +++ b/crates/revm-jit-builtins/src/ir.rs @@ -1,7 +1,5 @@ -use revm_jit_backend::{Attribute, Backend, Builder, FunctionAttributeLocation, TypeMethods}; - -#[cfg(not(feature = "std"))] use alloc::vec::Vec; +use revm_jit_backend::{Attribute, Backend, Builder, FunctionAttributeLocation, TypeMethods}; /// Builtin cache. #[derive(Debug)] diff --git a/crates/revm-jit-builtins/src/lib.rs b/crates/revm-jit-builtins/src/lib.rs index 7d4263e..76cfc11 100644 --- a/crates/revm-jit-builtins/src/lib.rs +++ b/crates/revm-jit-builtins/src/lib.rs @@ -2,7 +2,7 @@ #![allow(missing_docs, clippy::missing_safety_doc)] #![cfg_attr(not(test), warn(unused_extern_crates))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #[allow(unused_imports)] #[macro_use] @@ -12,6 +12,7 @@ extern crate alloc; #[macro_use] extern crate tracing; +use alloc::{boxed::Box, vec::Vec}; use revm_interpreter::{ as_u64_saturated, as_usize_saturated, gas as rgas, CallInputs, CallScheme, CreateInputs, InstructionResult, InterpreterAction, InterpreterResult, LoadAccountResult, SStoreResult, @@ -23,9 +24,6 @@ use revm_primitives::{ U256, }; -#[cfg(not(feature = "std"))] -use alloc::{boxed::Box, vec::Vec}; - #[cfg(feature = "ir")] mod ir; #[cfg(feature = "ir")] diff --git a/crates/revm-jit-context/Cargo.toml b/crates/revm-jit-context/Cargo.toml index f43a9de..eddd010 100644 --- a/crates/revm-jit-context/Cargo.toml +++ b/crates/revm-jit-context/Cargo.toml @@ -21,6 +21,4 @@ revm-interpreter = { workspace = true, default-features = false } revm-primitives = { workspace = true, default-features = false } [features] -default = ["std"] -std = ["revm-interpreter/std", "revm-primitives/std"] host-ext-any = [] diff --git a/crates/revm-jit-context/src/lib.rs b/crates/revm-jit-context/src/lib.rs index 64360f7..ab42f66 100644 --- a/crates/revm-jit-context/src/lib.rs +++ b/crates/revm-jit-context/src/lib.rs @@ -1,11 +1,11 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(test), warn(unused_extern_crates))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] -#[cfg(not(feature = "std"))] extern crate alloc; +use alloc::vec::Vec; use core::{fmt, mem::MaybeUninit, ptr}; use revm_interpreter::{ Contract, FunctionStack, Gas, Host, InstructionResult, Interpreter, InterpreterAction, @@ -13,9 +13,6 @@ use revm_interpreter::{ }; use revm_primitives::{Address, Bytes, Env, U256}; -#[cfg(not(feature = "std"))] -use alloc::vec::Vec; - #[cfg(feature = "host-ext-any")] use core::any::Any; @@ -258,7 +255,6 @@ impl EvmStack { /// Creates a vector that can be used as a stack. #[inline] - #[cfg(feature = "std")] pub fn new_heap() -> Vec { Vec::with_capacity(1024) } @@ -282,7 +278,6 @@ impl EvmStack { /// /// Panics if the vector's capacity is less than the required stack capacity. #[inline] - #[cfg(feature = "std")] pub fn from_vec(vec: &Vec) -> &Self { assert!(vec.capacity() >= Self::CAPACITY); unsafe { Self::from_ptr(vec.as_ptr()) } @@ -306,7 +301,6 @@ impl EvmStack { /// assert_eq!(stack.as_slice().len(), EvmStack::CAPACITY); /// ``` #[inline] - #[cfg(feature = "std")] pub fn from_mut_vec(vec: &mut Vec) -> &mut Self { assert!(vec.capacity() >= Self::CAPACITY); unsafe { Self::from_mut_ptr(vec.as_mut_ptr()) } diff --git a/crates/revm-jit/Cargo.toml b/crates/revm-jit/Cargo.toml index 287315b..ed226fd 100644 --- a/crates/revm-jit/Cargo.toml +++ b/crates/revm-jit/Cargo.toml @@ -18,12 +18,12 @@ workspace = true [dependencies] revm-jit-backend.workspace = true -revm-jit-builtins = { workspace = true, features = ["ir", "std"] } -revm-jit-context = { workspace = true, features = ["std"] } +revm-jit-builtins = { workspace = true, features = ["ir"] } +revm-jit-context.workspace = true revm-jit-cranelift = { workspace = true, optional = true } revm-jit-llvm = { workspace = true, optional = true } -alloy-primitives.workspace = true +alloy-primitives = { workspace = true, features = ["std"] } revm-interpreter.workspace = true revm-primitives.workspace = true @@ -33,7 +33,7 @@ rustc-hash.workspace = true tracing.workspace = true [dev-dependencies] -revm-jit-context = { workspace = true, features = ["std", "host-ext-any"] } +revm-jit-context = { workspace = true, features = ["host-ext-any"] } paste = "1.0" [features] diff --git a/crates/revm-jit/src/lib.rs b/crates/revm-jit/src/lib.rs index bf1c82e..c54ce5f 100644 --- a/crates/revm-jit/src/lib.rs +++ b/crates/revm-jit/src/lib.rs @@ -7,6 +7,7 @@ extern crate tracing; #[macro_use] extern crate revm_jit_backend; +// For features. use alloy_primitives as _; mod bytecode;