Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libafl_cc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn find_llvm_config_brew() -> Result<PathBuf, String> {
return Err("Empty return from brew --cellar".to_string());
}
let location_suffix = "*/bin/llvm-config";
let cellar_glob = vec![
let cellar_glob = [
// location for explicitly versioned brew formulae
format!("{brew_cellar_location}/llvm@*/{location_suffix}"),
// location for current release brew formulae
Expand Down
1 change: 1 addition & 0 deletions libafl_concolic/symcc_runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
//! name = "SymRuntime"
//! ```
#![allow(clippy::module_name_repetitions, clippy::missing_panics_doc)]
#![allow(clippy::pub_underscore_fields)]
pub mod filter;
pub mod tracing;

Expand Down
11 changes: 7 additions & 4 deletions libafl_libfuzzer/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ fn main() {
if cfg!(any(feature = "cargo-clippy", docsrs)) {
return; // skip when clippy or docs is running
}
assert!(
cfg!(target_os = "linux"),
"The libafl_libfuzzer runtime may only be built for linux; failing fast."
);

if cfg!(target_os = "windows") {
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/Cargo.toml");
Expand Down
2 changes: 1 addition & 1 deletion libafl_qemu/src/edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
hooks: &mut QemuHooks<QT, S>,
Expand Down
2 changes: 1 addition & 1 deletion libafl_qemu/src/emu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ impl CPU {
#[cfg(emulation_mode = "usermode")]
{
thread_local! {
static PAGE_SIZE: OnceCell<usize> = OnceCell::new();
static PAGE_SIZE: OnceCell<usize> = const { OnceCell::new() };
}

PAGE_SIZE.with(|s| {
Expand Down
3 changes: 2 additions & 1 deletion libafl_targets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
clippy::missing_panics_doc,
clippy::missing_docs_in_private_items,
clippy::module_name_repetitions,
clippy::unreadable_literal
clippy::unreadable_literal,
clippy::pub_underscore_fields
)]
#![cfg_attr(not(test), warn(
missing_debug_implementations,
Expand Down
Loading