Merge pull request #2672 from jepler/fuzz

Makefiles: add targets to build unix port, mpy-cross for fuzzing
This commit is contained in:
Scott Shawcroft 2020-03-03 11:36:53 -08:00 committed by GitHub
commit 2fea811c30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -3,4 +3,5 @@
/mpy-cross.static /mpy-cross.static
/mpy-cross.static.exe /mpy-cross.static.exe
/mpy-cross.static-raspbian /mpy-cross.static-raspbian
/mpy-cross.fuzz
/pitools /pitools

6
mpy-cross/Makefile.fuzz Normal file
View File

@ -0,0 +1,6 @@
PROG=mpy-cross.fuzz
BUILD=build-static
STATIC_BUILD=1
CC=afl-clang-fast
include mpy-cross.mk

View File

@ -277,6 +277,18 @@ coverage_test: coverage
coverage_clean: coverage_clean:
$(MAKE) V=2 BUILD=build-coverage PROG=micropython_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). # Value of configure's --host= option (required for cross-compilation).
# Deduce it from CROSS_COMPILE by default, but can be overridden. # Deduce it from CROSS_COMPILE by default, but can be overridden.
ifneq ($(CROSS_COMPILE),) ifneq ($(CROSS_COMPILE),)