From 13cb49b86ca7d38072b895a8708a38655d64d299 Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Thu, 16 Apr 2020 10:03:03 -0700 Subject: [Go] remove "-lpthread" flag from "compile_fuzzer" and fix comments (#2714). (#3657) * [Go] remove "-lpthread" flag from "compile_fuzzer" and fix comments (#2714). * fix unrelated go-dns and gonids errors * simplify golang/build.sh as per Abhishek's comment --- projects/go-dns/build.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'projects/go-dns') diff --git a/projects/go-dns/build.sh b/projects/go-dns/build.sh index e2c3f29f..b9309993 100755 --- a/projects/go-dns/build.sh +++ b/projects/go-dns/build.sh @@ -15,19 +15,18 @@ # ################################################################################ -# build target function function compile_fuzzer { path=$1 function=$2 fuzzer=$3 - # Instrument all Go files relevant to this fuzzer + # Compile and instrument all Go files relevant to this fuzz target. go-fuzz -tags fuzz -func $function -o $fuzzer.a $path - # Instrumented, compiled Go ($fuzzer.a) + fuzzing engine = fuzzer binary - $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -lpthread -o $OUT/$fuzzer + # Link Go code ($fuzzer.a) with fuzzing engine to produce fuzz target binary. + $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer } -#same as usual except for added -tags fuzz -compile_fuzzer /root/go/src/github.com/miekg/dns/ FuzzNewRR fuzz_newrr -compile_fuzzer /root/go/src/github.com/miekg/dns/ Fuzz fuzz_msg_unpack +# Same as usual except for added -tags fuzz. +compile_fuzzer github.com/miekg/dns FuzzNewRR fuzz_newrr +compile_fuzzer github.com/miekg/dns Fuzz fuzz_msg_unpack -- cgit v1.2.3