Commit 8f31dca
committed
Currently, there isn't a reliable way to build
Go test binaries with libfuzzer instrumentation [1].
An attempt such as
`bazel run --@io_bazel_rules_go//go/config:gc_goopts=-d=libfuzzer ...`
fails to compile owing to unresolved symbols, e.g.,
runtime.libfuzzerTraceConstCmp8 [2].
This patch adds `libfuzzer_shim.go` (identical to `trace.go` [2])
to the `bzltestutil` package, which ensures the shim is linked
with a Go test binary. Furthermore, we exclude `-d=libfuzzer`
when compiling any of the _external_ dependencies.
[1] bazel-contrib#3088 (comment)
[2] golang/go@74f49f31 parent 0e7e4e3 commit 8f31dca
2 files changed
+49
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
346 | 354 | | |
347 | 355 | | |
348 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
0 commit comments