diff options
| author | Jeff Epler <jepler@gmail.com> | 2020-03-01 11:48:20 -0600 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2020-03-01 11:48:33 -0600 |
| commit | 74bf17bb0dee27a431e2fc6d0e07ee1df833cf1b (patch) | |
| tree | d2cd0c6da9aa614062f32afbb120e37c4d65ed1b | |
| parent | 0c2894c72548a08d58e6cf300927e076f9331350 (diff) | |
Makefiles: add targets to build unix port, mpy-cross for fuzzing
This assumes you have properly install afl-fuzz with afl-clang-fast.
Tested with AFLplusplus 2.60c-75-g2c6847b.
| -rw-r--r-- | mpy-cross/.gitignore | 1 | ||||
| -rw-r--r-- | mpy-cross/Makefile.fuzz | 6 | ||||
| -rw-r--r-- | ports/unix/Makefile | 12 |
3 files changed, 19 insertions, 0 deletions
diff --git a/mpy-cross/.gitignore b/mpy-cross/.gitignore index 0681b685f..80d7acd42 100644 --- a/mpy-cross/.gitignore +++ b/mpy-cross/.gitignore @@ -3,4 +3,5 @@ /mpy-cross.static /mpy-cross.static.exe /mpy-cross.static-raspbian +/mpy-cross.fuzz /pitools diff --git a/mpy-cross/Makefile.fuzz b/mpy-cross/Makefile.fuzz new file mode 100644 index 000000000..ca59788f4 --- /dev/null +++ b/mpy-cross/Makefile.fuzz @@ -0,0 +1,6 @@ + +PROG=mpy-cross.fuzz +BUILD=build-static +STATIC_BUILD=1 +CC=afl-clang-fast +include mpy-cross.mk diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 7ffa0fd08..63c4980c3 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -277,6 +277,18 @@ coverage_test: coverage coverage_clean: $(MAKE) V=2 BUILD=build-coverage PROG=micropython_coverage clean +# build an interpreter for fuzzing +fuzz: + $(MAKE) \ + CC=afl-clang-fast DEBUG=1 \ + CFLAGS_EXTRA='$(CFLAGS_EXTRA) -ffunction-sections' \ + LDFLAGS_EXTRA='$(LDFLAGS_EXTRA)' \ + BUILD=build-fuzz PROG=micropython_fuzz + +fuzz_clean: + $(MAKE) V=2 BUILD=build-fuzz PROG=micropython_fuzz clean + + # Value of configure's --host= option (required for cross-compilation). # Deduce it from CROSS_COMPILE by default, but can be overridden. ifneq ($(CROSS_COMPILE),) |
