Don't use assert fail when building on libafl_libfuzzer on windows (#1792)

* fix

* fix

* clippy

* clippy
This commit is contained in:
Dongjia "toka" Zhang 2024-01-13 16:02:10 +01:00 committed by GitHub
parent 6a72f8a1ad
commit 3ed231db69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 8 deletions

View File

@ -45,7 +45,7 @@ fn find_llvm_config_brew() -> Result<PathBuf, String> {
return Err("Empty return from brew --cellar".to_string()); return Err("Empty return from brew --cellar".to_string());
} }
let location_suffix = "*/bin/llvm-config"; let location_suffix = "*/bin/llvm-config";
let cellar_glob = vec![ let cellar_glob = [
// location for explicitly versioned brew formulae // location for explicitly versioned brew formulae
format!("{brew_cellar_location}/llvm@*/{location_suffix}"), format!("{brew_cellar_location}/llvm@*/{location_suffix}"),
// location for current release brew formulae // location for current release brew formulae

View File

@ -28,6 +28,7 @@
//! name = "SymRuntime" //! name = "SymRuntime"
//! ``` //! ```
#![allow(clippy::module_name_repetitions, clippy::missing_panics_doc)] #![allow(clippy::module_name_repetitions, clippy::missing_panics_doc)]
#![allow(clippy::pub_underscore_fields)]
pub mod filter; pub mod filter;
pub mod tracing; pub mod tracing;

View File

@ -16,10 +16,13 @@ fn main() {
if cfg!(any(feature = "cargo-clippy", docsrs)) { if cfg!(any(feature = "cargo-clippy", docsrs)) {
return; // skip when clippy or docs is running return; // skip when clippy or docs is running
} }
assert!(
cfg!(target_os = "linux"), if cfg!(target_os = "windows") {
"The libafl_libfuzzer runtime may only be built for linux; failing fast." println!(
); "cargo:warning=The libafl_libfuzzer runtime may only be built for linux; failing fast."
);
return;
}
println!("cargo:rerun-if-changed=libafl_libfuzzer_runtime/src"); println!("cargo:rerun-if-changed=libafl_libfuzzer_runtime/src");
println!("cargo:rerun-if-changed=libafl_libfuzzer_runtime/Cargo.toml"); println!("cargo:rerun-if-changed=libafl_libfuzzer_runtime/Cargo.toml");

View File

@ -463,7 +463,7 @@ where
} }
} }
thread_local!(static PREV_LOC : UnsafeCell<u64> = UnsafeCell::new(0)); thread_local!(static PREV_LOC : UnsafeCell<u64> = const { UnsafeCell::new(0) });
pub fn gen_unique_edge_ids<QT, S>( pub fn gen_unique_edge_ids<QT, S>(
hooks: &mut QemuHooks<QT, S>, hooks: &mut QemuHooks<QT, S>,

View File

@ -732,7 +732,7 @@ impl CPU {
#[cfg(emulation_mode = "usermode")] #[cfg(emulation_mode = "usermode")]
{ {
thread_local! { thread_local! {
static PAGE_SIZE: OnceCell<usize> = OnceCell::new(); static PAGE_SIZE: OnceCell<usize> = const { OnceCell::new() };
} }
PAGE_SIZE.with(|s| { PAGE_SIZE.with(|s| {

View File

@ -13,7 +13,8 @@
clippy::missing_panics_doc, clippy::missing_panics_doc,
clippy::missing_docs_in_private_items, clippy::missing_docs_in_private_items,
clippy::module_name_repetitions, clippy::module_name_repetitions,
clippy::unreadable_literal clippy::unreadable_literal,
clippy::pub_underscore_fields
)] )]
#![cfg_attr(not(test), warn( #![cfg_attr(not(test), warn(
missing_debug_implementations, missing_debug_implementations,