From 264efe24ff14bd7b2c7fe9bd7dd4d629f471de6e Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Thu, 2 Mar 2017 20:41:49 +0000 Subject: [PATCH] tools/fuzz: Use $(CC) for linking the harnesses This is necessary to make use of compiler features such as UBSAN. Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu --- tools/fuzz/libelf/Makefile | 1 + tools/fuzz/x86_instruction_emulator/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/fuzz/libelf/Makefile b/tools/fuzz/libelf/Makefile index af44c402d1..c884703ff0 100644 --- a/tools/fuzz/libelf/Makefile +++ b/tools/fuzz/libelf/Makefile @@ -20,6 +20,7 @@ libelf.a: $(ELF_LIB_OBJS) libelf-fuzzer-all: libelf.a libelf-fuzzer.o afl-libelf-fuzzer: afl-libelf-fuzzer.o libelf-fuzzer.o $(ELF_LIB_OBJS) + $(CC) $(CFLAGS) $^ -o $@ # Common targets .PHONY: all diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile index 98fd398d3f..673b5f042d 100644 --- a/tools/fuzz/x86_instruction_emulator/Makefile +++ b/tools/fuzz/x86_instruction_emulator/Makefile @@ -34,6 +34,7 @@ x86-insn-emulator.a: x86_emulate.o $(AR) rc $@ $^ afl-x86-insn-emulator-fuzzer: afl-x86-insn-emulator-fuzzer.o x86-insn-emulator-fuzzer.o x86_emulate.o + $(CC) $(CFLAGS) $^ -o $@ # Common targets .PHONY: all -- 2.39.5