Bring back libpng CI on MacOS (#255)
* Makefile fix for libpng on MacOS (#252) * clean exit for libpng_launcher
This commit is contained in:
parent
bb21ab7a63
commit
ee33faa881
@ -2,7 +2,7 @@ FUZZER_NAME="fuzzer_libpng"
|
|||||||
PROJECT_DIR=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
PROJECT_DIR=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||||
UNAME := $(shell uname)
|
UNAME := $(shell uname)
|
||||||
|
|
||||||
PHONY: all
|
PHONY: all libafl_cc libafl_cxx
|
||||||
|
|
||||||
all: fuzzer
|
all: fuzzer
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ libafl_cxx: target/release/libafl_cxx
|
|||||||
libafl_cc: target/release/libafl_cxx
|
libafl_cc: target/release/libafl_cxx
|
||||||
|
|
||||||
libpng-1.6.37/.libs/libpng16.a: libpng-1.6.37 libafl_cc
|
libpng-1.6.37/.libs/libpng16.a: libpng-1.6.37 libafl_cc
|
||||||
cd libpng-1.6.37 && ./configure
|
cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes
|
||||||
$(MAKE) -C libpng-1.6.37 CC="$(PROJECT_DIR)/target/release/libafl_cc" CXX="$(PROJECT_DIR)/target/release/libafl_cxx"
|
$(MAKE) -C libpng-1.6.37 CC="$(PROJECT_DIR)/target/release/libafl_cc" CXX="$(PROJECT_DIR)/target/release/libafl_cxx"
|
||||||
|
|
||||||
|
|
||||||
@ -36,19 +36,14 @@ fuzzer: libpng-1.6.37/.libs/libpng16.a libafl_cxx
|
|||||||
-lm -lz
|
-lm -lz
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm ./$(FUZZER_NAME)
|
|
||||||
$(MAKE) -C libpng-1.6.37 clean
|
$(MAKE) -C libpng-1.6.37 clean
|
||||||
|
rm ./$(FUZZER_NAME)
|
||||||
|
|
||||||
run: all
|
run: all
|
||||||
./$(FUZZER_NAME) &
|
./$(FUZZER_NAME) &
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
./$(FUZZER_NAME) >/dev/null 2>/dev/null &
|
./$(FUZZER_NAME) >/dev/null 2>/dev/null &
|
||||||
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
short_test: libafl_cc
|
|
||||||
$(warning "The libpng linking step is currently broken on MacOS! See Issue #246")
|
|
||||||
|
|
||||||
else
|
|
||||||
short_test: all
|
short_test: all
|
||||||
rm -rf libafl_unix_shmem_server || true
|
rm -rf libafl_unix_shmem_server || true
|
||||||
timeout 11s ./$(FUZZER_NAME) &
|
timeout 11s ./$(FUZZER_NAME) &
|
||||||
@ -58,8 +53,6 @@ short_test: all
|
|||||||
timeout 10s taskset -c 2 ./$(FUZZER_NAME) >/dev/null 2>/dev/null &
|
timeout 10s taskset -c 2 ./$(FUZZER_NAME) >/dev/null 2>/dev/null &
|
||||||
timeout 10s taskset -c 3 ./$(FUZZER_NAME) >/dev/null 2>/dev/null &
|
timeout 10s taskset -c 3 ./$(FUZZER_NAME) >/dev/null 2>/dev/null &
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
test: all
|
test: all
|
||||||
timeout 60s ./$(FUZZER_NAME) &
|
timeout 60s ./$(FUZZER_NAME) &
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
|
@ -19,7 +19,7 @@ libafl_cxx: target/release/libafl_cxx
|
|||||||
libafl_cc: target/release/libafl_cxx
|
libafl_cc: target/release/libafl_cxx
|
||||||
|
|
||||||
libpng-1.6.37/.libs/libpng16.a: libpng-1.6.37 libafl_cc
|
libpng-1.6.37/.libs/libpng16.a: libpng-1.6.37 libafl_cc
|
||||||
cd libpng-1.6.37 && ./configure
|
cd libpng-1.6.37 && ./configure --enable-shared=no --with-pic=yes --enable-hardware-optimizations=yes
|
||||||
$(MAKE) -C libpng-1.6.37 CC="$(PROJECT_DIR)/target/release/libafl_cc" CXX="$(PROJECT_DIR)/target/release/libafl_cxx"
|
$(MAKE) -C libpng-1.6.37 CC="$(PROJECT_DIR)/target/release/libafl_cc" CXX="$(PROJECT_DIR)/target/release/libafl_cxx"
|
||||||
|
|
||||||
|
|
||||||
@ -42,16 +42,9 @@ clean:
|
|||||||
run: all
|
run: all
|
||||||
./$(FUZZER_NAME) --cores 0 &
|
./$(FUZZER_NAME) --cores 0 &
|
||||||
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
short_test: libafl_cc
|
|
||||||
$(warning "The libpng linking step is currently broken on MacOS! See Issue #246")
|
|
||||||
|
|
||||||
else
|
|
||||||
short_test: all
|
short_test: all
|
||||||
rm -rf libafl_unix_shmem_server || true
|
rm -rf libafl_unix_shmem_server || true
|
||||||
timeout 10s ./$(FUZZER_NAME) --cores 0 &
|
timeout 10s ./$(FUZZER_NAME) --cores 0 &
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
test: all
|
test: all
|
||||||
timeout 60s ./$(FUZZER_NAME) --cores 0 &
|
timeout 60s ./$(FUZZER_NAME) --cores 0 &
|
||||||
|
@ -31,6 +31,7 @@ use libafl::{
|
|||||||
stages::mutational::StdMutationalStage,
|
stages::mutational::StdMutationalStage,
|
||||||
state::{HasCorpus, HasMetadata, StdState},
|
state::{HasCorpus, HasMetadata, StdState},
|
||||||
stats::MultiStats,
|
stats::MultiStats,
|
||||||
|
Error,
|
||||||
};
|
};
|
||||||
|
|
||||||
use libafl_targets::{libfuzzer_initialize, libfuzzer_test_one_input, EDGES_MAP, MAX_EDGES_NUM};
|
use libafl_targets::{libfuzzer_initialize, libfuzzer_test_one_input, EDGES_MAP, MAX_EDGES_NUM};
|
||||||
@ -163,7 +164,7 @@ pub fn libafl_main() {
|
|||||||
Ok(())
|
Ok(())
|
||||||
};
|
};
|
||||||
|
|
||||||
Launcher::builder()
|
match Launcher::builder()
|
||||||
.shmem_provider(shmem_provider)
|
.shmem_provider(shmem_provider)
|
||||||
.configuration("launcher default".into())
|
.configuration("launcher default".into())
|
||||||
.stats(stats)
|
.stats(stats)
|
||||||
@ -173,5 +174,9 @@ pub fn libafl_main() {
|
|||||||
.stdout_file(Some("/dev/null"))
|
.stdout_file(Some("/dev/null"))
|
||||||
.build()
|
.build()
|
||||||
.launch()
|
.launch()
|
||||||
.expect("Launcher failed");
|
{
|
||||||
|
Ok(()) => (),
|
||||||
|
Err(Error::ShuttingDown) => println!("Fuzzing stopped by user. Good bye."),
|
||||||
|
Err(err) => panic!("Failed to run launcher: {:?}", err),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user