Skip to content

Commit 2cc2c28

Browse files
authored
Fix qemu systemmode: Add nyx feature to gate nyx commands (#3432)
* Add nyx feature to gate nyx commands * disable nyx in CI
1 parent e074a0d commit 2cc2c28

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

crates/libafl_qemu/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ slirp = [
9292
intel_pt = ["systemmode", "x86_64", "dep:libafl_intelpt"]
9393
intel_pt_export_raw = ["intel_pt", "libafl_intelpt/export_raw"]
9494

95+
nyx = ["systemmode", "x86_64"]
96+
9597
# Requires the binary's build.rs to call `build_libafl_qemu`
9698
shared = ["libafl_qemu_sys/shared"]
9799

crates/libafl_qemu/src/command/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::{
2929
sync_exit::ExitArgs,
3030
};
3131

32-
#[cfg(all(cpu_target = "x86_64", feature = "systemmode"))]
32+
#[cfg(feature = "nyx")]
3333
pub mod nyx;
3434
pub mod parser;
3535

crates/libafl_qemu/src/command/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616
sync_exit::ExitArgs,
1717
};
1818

19-
#[cfg(all(cpu_target = "x86_64", feature = "systemmode"))]
19+
#[cfg(feature = "nyx")]
2020
pub mod nyx;
2121

2222
pub static EMU_EXIT_KIND_MAP: OnceLock<EnumMap<NativeExitKind, Option<ExitKind>>> = OnceLock::new();

crates/libafl_qemu/src/emu/drivers/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use crate::{
1414
modules::EmulatorModuleTuple,
1515
};
1616

17-
#[cfg(all(cpu_target = "x86_64", feature = "systemmode"))]
17+
#[cfg(feature = "nyx")]
1818
pub mod nyx;
19-
#[cfg(all(cpu_target = "x86_64", feature = "systemmode"))]
19+
#[cfg(feature = "nyx")]
2020
pub use nyx::{NyxEmulatorDriver, NyxEmulatorDriverBuilder};
2121

2222
#[derive(Debug, Clone)]

utils/ci_splitter/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn main() -> Result<(), Box<dyn Error>> {
4141
--exclude-features=prelude,python,sancov_pcguard_edges,arm,aarch64,i386,be,systemmode,whole_archive \
4242
--no-dev-deps --exclude libafl_libfuzzer --exclude libafl_qemu --exclude libafl_qemu_sys --exclude libafl_asan_libc --print-command-list; ",
4343
"DOCS_RS=1 cargo hack check -p libafl_qemu -p libafl_qemu_sys --each-feature --clean-per-run \
44-
--exclude-features=prelude,python,sancov_pcguard_edges,arm,aarch64,i386,be,systemmode,whole_archive,slirp,intel_pt,intel_pt_export_raw \
44+
--exclude-features=prelude,python,sancov_pcguard_edges,arm,aarch64,i386,be,systemmode,whole_archive,slirp,intel_pt,intel_pt_export_raw,nyx \
4545
--no-dev-deps --features usermode --print-command-list"
4646
);
4747

0 commit comments

Comments
 (0)