From 90b7ae08d63f5e46791e59f505b8f5acda821d13 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Wed, 21 Jul 2021 20:48:33 +0100 Subject: [PATCH] x86 32 bits build fix (#234) --- libafl/src/bolts/cpu.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libafl/src/bolts/cpu.rs b/libafl/src/bolts/cpu.rs index a0773c3cf3..c9f23058dd 100644 --- a/libafl/src/bolts/cpu.rs +++ b/libafl/src/bolts/cpu.rs @@ -16,7 +16,14 @@ use crate::bolts::current_nanos; #[cfg(any(target_arch = "x86_64", target_arch = "x86"))] #[must_use] pub fn read_time_counter() -> u64 { - unsafe { core::arch::x86_64::_rdtsc() } + #[cfg(target_arch = "x86_64")] + unsafe { + core::arch::x86_64::_rdtsc() + } + #[cfg(target_arch = "x86")] + unsafe { + core::arch::x86::_rdtsc() + } } /// Read a timestamp for measurements.