Hey, I'm currently trying to fuzz a library that was generated from rust and run into an Could not import C (no metadata for C) error
.
I found these prs to golang: https://go-review.googlesource.com/c/tools/+/214738/ https://go-review.googlesource.com/c/tools/+/214943/
The second one was merged into master (but not included in the latest release). I also tried to apply the first one, however this gives me multiple undeclared name: C
errors.
The library is here: https://github.com/shamatar/eip2537rustwrapper Repro:
- clone the library,
- execute the functions in their readme
- edit package from main -> bls in lib.go
- Change the library path to a real path e.g.
// #cgo LDFLAGS: -L/home/matematik/go/src/github.com/ethereum/go-ethereum/tests/fuzzers/bls12381/eip2637rustwrapper/libs -leth_pairings -lm -ldl
- add
func Fuzz(data []byte) int { return 1 }
to lib.go - run go-fuzz-build