Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apologies in advance for this hack job.
As part of bytecodealliance/wasmtime#611 I am building wasmtime fuzz targets in the google/oss-fuzz build container. This environment supplies the LLVM c++ standard library rather than the GCC one. It is specified in
CXXFLAGS
and presumably linked in the version of libfuzzer they supplied (libFuzzingEngine.a
).It looks like rust-fuzz/libfuzzer currently links the GCC standard library when using an external libfuzzer library, which causes a linker error when linking in the oss-fuzz compilation environment.
This PR adds an environment variable that lets the user select whether they'd like to link the GCC c++ standard library (the default, for backward compatibility), the installed (LLVM) c++ standard library, or not link one at all. If you'd rather control this another way or do something different please feel free.
I wasn't able to easily test rust-fuzz/libfuzzer with the wasmtime fuzz targets due to an incompatibility with the
arbitrary
crate; I didn't attempt to resolve this as part of this PR. I smoke-tested this change by using an old version of libfuzzer, beforearbitrary
was upgraded (actually 0c45075, the last functional commit made to rust-fuzz/libfuzzer-sys, which is what I was developing against before I realized it was deprecated : ).Please let me know how you'd like to proceed -- thanks!