about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Makefile11
-rw-r--r--libclang_rt.fuzzer_no_main-x86_64.a.syms3
2 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1d8d819f..f65650b7 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,8 @@ HELPER_PATH = $(PREFIX)/lib/afl
 DOC_PATH    = $(PREFIX)/share/doc/afl
 MISC_PATH   = $(PREFIX)/share/afl
 
+CLANG_COMPILER_RT = "/home/user/code/compiler-rt/cmake-build-debug/lib/linux"
+
 # PROGS intentionally omit afl-as, which gets installed elsewhere.
 
 PROGS       = afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze
@@ -95,6 +97,15 @@ afl-as: afl-as.c afl-as.h $(COMM_HDR) | test_x86
 afl-fuzz: afl-fuzz.c $(COMM_HDR) | test_x86
 	$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS) $(PYFLAGS)
 
+smart-rabbit: afl-fuzz.c $(COMM_HDR) | test_x86
+	$(CC) $(CFLAGS) afl-fuzz.c -o $@ $(LDFLAGS) -lstdc++ -lpthread -lm \
+	 -Wl,--whole-archive -Wl,$(CLANG_COMPILER_RT)/libclang_rt.ubsan_standalone-x86_64.a -Wl,--no-whole-archive \
+	 -Wl,--dynamic-list=$(CLANG_COMPILER_RT)/libclang_rt.ubsan_standalone-x86_64.a.syms \
+	 -Wl,--whole-archive -Wl,$(CLANG_COMPILER_RT)/libclang_rt.ubsan_standalone_cxx-x86_64.a -Wl,--no-whole-archive \
+	 -Wl,--dynamic-list=$(CLANG_COMPILER_RT)/libclang_rt.ubsan_standalone_cxx-x86_64.a.syms \
+	 -Wl,--whole-archive -Wl,$(CLANG_COMPILER_RT)/libclang_rt.fuzzer_no_main-x86_64.a -Wl,--no-whole-archive \
+	 -Wl,--dynamic-list=libclang_rt.fuzzer_no_main-x86_64.a.syms
+
 afl-showmap: afl-showmap.c $(COMM_HDR) | test_x86
 	$(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
 
diff --git a/libclang_rt.fuzzer_no_main-x86_64.a.syms b/libclang_rt.fuzzer_no_main-x86_64.a.syms
new file mode 100644
index 00000000..289454c8
--- /dev/null
+++ b/libclang_rt.fuzzer_no_main-x86_64.a.syms
@@ -0,0 +1,3 @@
+{
+  LLVMFuzzerMutate;
+};
\ No newline at end of file