Skip to content

Commit 393afa5

Browse files
authored
Github workflows frida build on windows (#536)
* Update build_and_test.yml * Update build_and_test.yml * clippy * clippy * clippy
1 parent 7dad215 commit 393afa5

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

.github/workflows/build_and_test.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,16 @@ jobs:
149149
uses: actions-rs/cargo@v1
150150
with:
151151
command: clippy
152-
#- name: Build frida
153-
# run: cd fuzzers/frida_libpng/ && cargo build --release
152+
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
153+
uses: KyleMayes/install-llvm-action@32c4866ebb71e0949e8833eb49beeebed48532bd
154+
with:
155+
version: "12.0"
156+
directory: ${{ runner.temp }}/llvm
157+
- name: Set LIBCLANG_PATH
158+
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
159+
- name: Build frida
160+
run: cd fuzzers/frida_libpng/ && cargo build --release
161+
154162
macos:
155163
runs-on: macOS-latest
156164
steps:

libafl_frida/src/alloc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,8 @@ impl Allocator {
121121
let base: usize = 2;
122122
// On x64, if end > 2**48, then that's in vsyscall or something.
123123
#[cfg(target_arch = "x86_64")]
124-
if end <= base.pow(48) {
125-
if end > userspace_max {
126-
userspace_max = end;
127-
}
124+
if end <= base.pow(48) && end > userspace_max {
125+
userspace_max = end;
128126
}
129127

130128
// On x64, if end > 2**52, then range is not in userspace

libafl_frida/src/helper.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,8 @@ where
407407

408408
/// Pointer to coverage map
409409
pub fn map_ptr_mut(&mut self) -> Option<*mut u8> {
410-
if let Some(rt) = self.runtime_mut::<CoverageRuntime>() {
411-
Some(rt.map_ptr_mut())
412-
} else {
413-
None
414-
}
410+
self.runtime_mut::<CoverageRuntime>()
411+
.map(CoverageRuntime::map_ptr_mut)
415412
}
416413

417414
/// Ranges

libafl_sugar/src/forkserver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ pub mod pybind {
321321
impl ForkserverBytesCoverageSugar {
322322
/// Create a new [`ForkserverBytesCoverageSugar`]
323323
#[new]
324+
#[allow(clippy::too_many_arguments)]
324325
fn new(
325326
input_dirs: Vec<PathBuf>,
326327
output_dir: PathBuf,

libafl_sugar/src/inmemory.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ pub mod pybind {
385385
impl InMemoryBytesCoverageSugar {
386386
/// Create a new [`InMemoryBytesCoverageSugar`]
387387
#[new]
388+
#[allow(clippy::too_many_arguments)]
388389
fn new(
389390
input_dirs: Vec<PathBuf>,
390391
output_dir: PathBuf,

libafl_sugar/src/qemu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ pub mod pybind {
449449
impl QemuBytesCoverageSugar {
450450
/// Create a new [`QemuBytesCoverageSugar`]
451451
#[new]
452+
#[allow(clippy::too_many_arguments)]
452453
fn new(
453454
input_dirs: Vec<PathBuf>,
454455
output_dir: PathBuf,

0 commit comments

Comments
 (0)