diff --git a/libafl_bolts/Cargo.toml b/libafl_bolts/Cargo.toml index dfffb75edf..199c81fdd9 100644 --- a/libafl_bolts/Cargo.toml +++ b/libafl_bolts/Cargo.toml @@ -141,7 +141,7 @@ num_enum = { workspace = true, default-features = false } ahash = { workspace = true, optional = true } # The hash function already used in hashbrown backtrace = { workspace = true, default-features = true, optional = true } # Used to get the stacktrace in StacktraceObserver -ctor = { optional = true, version = "0.2.9" } +ctor = { optional = true, version = "0.4.0" } miniz_oxide = { version = "0.8.0", optional = true } hostname = { version = "0.4.0", optional = true } # Is there really no gethostname in the stdlib? rand_core = { version = "0.9.0", optional = true } diff --git a/libafl_bolts/src/lib.rs b/libafl_bolts/src/lib.rs index 6207d65f1e..7281353058 100644 --- a/libafl_bolts/src/lib.rs +++ b/libafl_bolts/src/lib.rs @@ -77,7 +77,7 @@ pub extern crate alloc; #[cfg(feature = "ctor")] #[doc(hidden)] -pub use ctor::ctor; +pub use ctor; #[cfg(feature = "alloc")] pub mod anymap; #[cfg(feature = "std")] diff --git a/libafl_bolts/src/serdeany.rs b/libafl_bolts/src/serdeany.rs index 14be4c4864..6fc23087b4 100644 --- a/libafl_bolts/src/serdeany.rs +++ b/libafl_bolts/src/serdeany.rs @@ -840,17 +840,17 @@ impl<'de> Deserialize<'de> for Box { #[macro_export] macro_rules! create_register { ($struct_type:ty) => { - const _: () = { + $crate::ctor::declarative::ctor! { /// Automatically register this type - #[$crate::ctor] - fn register() { + #[ctor(anonymous)] + unsafe fn register() { // # Safety // This `register` call will always run at startup and never in parallel. unsafe { $crate::serdeany::RegistryBuilder::register::<$struct_type>(); } } - }; + } }; } diff --git a/libafl_concolic/symcc_runtime/Cargo.toml b/libafl_concolic/symcc_runtime/Cargo.toml index a0f91e025e..4ac7c162f9 100644 --- a/libafl_concolic/symcc_runtime/Cargo.toml +++ b/libafl_concolic/symcc_runtime/Cargo.toml @@ -36,7 +36,7 @@ libafl = { workspace = true, features = ["std", "serdeany_autoreg"] } libafl_bolts = { workspace = true, features = ["std", "serdeany_autoreg"] } unchecked_unwrap = "4.0.0" -ctor = "0.2.9" +ctor = "0.4.0" libc = { workspace = true } [build-dependencies] diff --git a/utils/noaslr/libnoaslr/Cargo.toml b/utils/noaslr/libnoaslr/Cargo.toml index ed1be271be..9a5fe8cdb0 100644 --- a/utils/noaslr/libnoaslr/Cargo.toml +++ b/utils/noaslr/libnoaslr/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["dylib"] [dependencies] anyhow = { version = "1.0", default-features = false } -ctor = { version = "0.2.9", default-features = false } +ctor = "0.4.0" nix = { version = "0.29", default-features = false, features = [ "process", "personality",