aboutsummaryrefslogtreecommitdiff
path: root/projects/go-dns
diff options
context:
space:
mode:
authorMax Moroz <mmoroz@chromium.org>2020-04-16 10:03:03 -0700
committerGitHub <noreply@github.com>2020-04-16 10:03:03 -0700
commit13cb49b86ca7d38072b895a8708a38655d64d299 (patch)
treed03a8560536f88b8daa1a680528ff94cf8d58f70 /projects/go-dns
parent82175dc123ffde1ad6c9a13f459c188e26b403ae (diff)
downloadoss-fuzz-13cb49b86ca7d38072b895a8708a38655d64d299.tar.gz
[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
Diffstat (limited to 'projects/go-dns')
-rwxr-xr-xprojects/go-dns/build.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/projects/go-dns/build.sh b/projects/go-dns/build.sh
index e2c3f29ff..b9309993d 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