diff options
Diffstat (limited to 'ossfuzz')
-rw-r--r-- | ossfuzz/Makefile | 12 | ||||
-rw-r--r-- | ossfuzz/compress_fuzzer.c (renamed from ossfuzz/compress_fuzzer.cc) | 2 | ||||
-rw-r--r-- | ossfuzz/decompress_fuzzer.c (renamed from ossfuzz/decompress_fuzzer.cc) | 2 | ||||
-rw-r--r-- | ossfuzz/standaloneengine.c (renamed from ossfuzz/standaloneengine.cc) | 0 | ||||
-rw-r--r-- | ossfuzz/testinput.h | 2 |
5 files changed, 12 insertions, 6 deletions
diff --git a/ossfuzz/Makefile b/ossfuzz/Makefile index 1e7679b..1480ccb 100644 --- a/ossfuzz/Makefile +++ b/ossfuzz/Makefile @@ -42,14 +42,20 @@ include ../Makefile.inc $(LZ4DIR)/liblz4.a: $(MAKE) -C $(LZ4DIR) CFLAGS="$(CFLAGS)" liblz4.a -%.o: %.cc - $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@ +%.o: %.c + $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ # Generic rule for generating fuzzers %_fuzzer: %_fuzzer.o $(LZ4DIR)/liblz4.a # Compile the standalone code just in case. The OSS-Fuzz code might # override the LIB_FUZZING_ENGINE value to "-fsanitize=fuzzer" - $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) standaloneengine.cc -o standaloneengine.o + $(CC) -c $(CFLAGS) $(CPPFLAGS) standaloneengine.c -o standaloneengine.o # Now compile the actual fuzzer. $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIB_FUZZING_ENGINE) $^ -o $@$(EXT) + +%_fuzzer_clean: + $(RM) $*_fuzzer $*_fuzzer.o standaloneengine.o + +.PHONY: clean +clean: compress_fuzzer_clean decompress_fuzzer_clean diff --git a/ossfuzz/compress_fuzzer.cc b/ossfuzz/compress_fuzzer.c index 4a720e2..28610ad 100644 --- a/ossfuzz/compress_fuzzer.cc +++ b/ossfuzz/compress_fuzzer.c @@ -5,7 +5,7 @@ #define CHECK(COND) if (!(COND)) { abort(); } -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { size_t const compressed_dest_size = LZ4_compressBound(size); char *const dest_buffer = (char *)malloc(compressed_dest_size); diff --git a/ossfuzz/decompress_fuzzer.cc b/ossfuzz/decompress_fuzzer.c index 594a5af..1fa2b1a 100644 --- a/ossfuzz/decompress_fuzzer.cc +++ b/ossfuzz/decompress_fuzzer.c @@ -5,7 +5,7 @@ #define CHECK(COND) if (!(COND)) { abort(); } -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { size_t const buffer_size = 10 * 1024 * 1024; char *const dest_buffer = (char *)malloc(buffer_size); diff --git a/ossfuzz/standaloneengine.cc b/ossfuzz/standaloneengine.c index 175360e..175360e 100644 --- a/ossfuzz/standaloneengine.cc +++ b/ossfuzz/standaloneengine.c diff --git a/ossfuzz/testinput.h b/ossfuzz/testinput.h index 6ab9b51..8da6215 100644 --- a/ossfuzz/testinput.h +++ b/ossfuzz/testinput.h @@ -1,3 +1,3 @@ #include <inttypes.h> -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); |