diff options
author | Mattias Nissler <mnissler@chromium.org> | 2019-10-14 17:03:45 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-17 06:08:24 +0000 |
commit | 089a944d51778640d26a125123e1d1946c828e90 (patch) | |
tree | eb050cd9b57200e79d7daab55c4113a6b57fe3a3 /Makefile | |
parent | 7be3991ed441865f325182885ea08dc199ddbfd5 (diff) | |
download | vboot-stabilize-12607.15.B.tar.gz |
tests: Add cgpt fuzzer.stabilize-12607.6.Bstabilize-12607.5.Bstabilize-12607.3.Bstabilize-12607.15.B
This adds a fuzzer binary to exercise GPT parsing.
BUG=chromium:1014101
TEST=Build and run fuzzer.
BRANCH=none
Change-Id: Idecc0ddf491e976d4e01f5778e51a01ac317d961
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1859595
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -242,6 +242,10 @@ LDFLAGS += -static PKG_CONFIG += --static endif +ifneq (${FUZZ_FLAGS},) +CFLAGS += ${FUZZ_FLAGS} +endif + # Optional Libraries LIBZIP_VERSION := $(shell ${PKG_CONFIG} --modversion libzip 2>/dev/null) HAVE_LIBZIP := $(if ${LIBZIP_VERSION},1) @@ -775,6 +779,14 @@ TEST21_BINS = $(addprefix ${BUILD}/,${TEST21_NAMES}) # Directory containing test keys TEST_KEYS = ${SRC_RUN}/tests/testkeys +# ---------------------------------------------------------------------------- +# Fuzzing binaries + +FUZZ_TEST_NAMES = \ + tests/cgpt_fuzzer + +FUZZ_TEST_BINS = $(addprefix ${BUILD}/,${FUZZ_TEST_NAMES}) +FUZZ_TEST_OBJS += $(addsuffix .o,${FUZZ_TEST_BINS}) ############################################################################## # Finally, some targets. High-level ones first. @@ -793,6 +805,7 @@ host_tools: utils futil tests .PHONY: host_stuff host_stuff: utillib hostlib \ + $(if $(filter x86_64,${ARCH}),fuzzers) \ $(if ${NO_BUILD_TOOLS},,cgpt host_tools) .PHONY: clean @@ -1073,6 +1086,15 @@ ${TESTLIB}: ${TESTLIB_OBJS} @${PRINTF} " AR $(subst ${BUILD}/,,$@)\n" ${Q}ar qc $@ $^ +# ---------------------------------------------------------------------------- +# Fuzzers + +.PHONY: fuzzers +fuzzers: ${FUZZ_TEST_BINS} + +${FUZZ_TEST_BINS}: ${FWLIB} +${FUZZ_TEST_BINS}: LIBS = ${FWLIB} +${FUZZ_TEST_BINS}: LDFLAGS += -fsanitize=fuzzer # ---------------------------------------------------------------------------- # Generic build rules. LIBS and OBJS can be overridden to tweak the generic |