8000 Makefiles: add targets to build unix port, mpy-cross for fuzzing · gregdavill/circuitpython@74bf17b · GitHub
[go: up one dir, main page]

Skip to content

Commit 74bf17b

Browse files
committed
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.
1 parent 0c2894c commit 74bf17b

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

mpy-cross/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
/mpy-cross.static
44
/mpy-cross.static.exe
55
/mpy-cross.static-raspbian
6+
/mpy-cross.fuzz
67
/pitools

mpy-cross/Makefile.fuzz

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
PROG=mpy-cross.fuzz
3+
BUILD=build-static
4+
STATIC_BUILD=1
5+
CC=afl-clang-fast
6+
include mpy-cross.mk

ports/unix/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,18 @@ coverage_test: coverage
277277
coverage_clean:
278278
$(MAKE) V=2 BUILD=build-coverage PROG=micropython_coverage clean
279279

280+
# build an interpreter for fuzzing
281+
fuzz:
282+
$(MAKE) \
283+
CC=afl-clang-fast DEBUG=1 \
284+
CFLAGS_EXTRA='$(CFLAGS_EXTRA) -ffunction-sections' \
285+
LDFLAGS_EXTRA='$(LDFLAGS_EXTRA)' \
286+
BUILD=build-fuzz PROG=micropython_fuzz
287+
288+
fuzz_clean:
289+
$(MAKE) V=2 BUILD=build-fuzz PROG=micropython_fuzz clean
290+
291+
280292
# Value of configure's --host= option (required for cross-compilation).
281293
# Deduce it from CROSS_COMPILE by default, but can be overridden.
282294
ifneq ($(CROSS_COMPILE),)

0 commit comments

Comments
 (0)
0