go114-fuzz-build is a mostly-drop-in replacement for github.com/dvyukov/go-fuzz-build's -libfuzzer build mode, but uses cmd/compile's native libfuzzer instrumentation (to be included experimentally in Go 1.14) instead of source-to-source transformation.
- Install go114-fuzz-build:
$ go get -u github.com/mdempsky/go114-fuzz-build
- Checkout and build latest Go pre-release version:
$ git clone https://go.googlesource.com/go go-wip $ cd go-wip/src $ ./make.bash
- Build Kubernetes fuzz target with go114-fuzz-build and link against libFuzzer:
$ git clone --depth=1 git clone --depth 1 https://github.com/kubernetes/kubernetes.git $ cd kubernetes $ PATH=path/to/go-wip/bin:$PATH go114-fuzz-build -o yaml_FuzzSigYaml.a -func FuzzSigYaml ./test/fuzz/yaml $ clang -o yaml_FuzzSigYaml yaml_FuzzSigYaml.a -fsanitize=fuzzer