Repository navigation
add --capture rllvm as an alternative to gllvm - #4
Merged
Merged
Conversation
This was referenced Oct 10, 2026
Member
|
Hi! |
Contributor
Author
|
@vanhauser-thc Yes, this PR is ready for merge. Thanks! Feel free to let me know if you see any issues against rllvm while use it with fuzz-reachability. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi @vanhauser-thc ,
I came across
fuzz-reachabilitywhile fixing some Grammar-Mutator issues. These days I maintain rllvm, a successor to gllvm and wllvm, which are no longer actively maintained. Besides C/C++, it also captures Rust and mixed C/C++/Rust builds, and support WebAssembly and eBPF.This PR adds rllvm as an opt-in
--capture rllvm; gllvm stays the default.llvm-linkmerge.syn,proc_macro2,cc, ...), and type matching then connects them to the harness. Taking the bitcode from the linked binary leaves them out: on theurlcrate's cargo-fuzz target, 6746 reachable of 6748 defined instead of 12661 of 18149.My rllvm-query does something related: source-level queries such as callers, callees and reachability over the captured bitcode. It only follows call edges it can prove, so your type-based indirect-call resolution complements it nicely. I also looked at SVF for indirect calls, but it was too slow and expensive, and I saw you dropped it here too.
It needs rllvm 0.7.1 or newer, which
REACHABILITY_CAPTURE=rllvm bash scripts/setup.shinstalls. Happy to adjust anything. Thanks for the tool!Details
What changes:
rllvm-cc/rllvm-cxxreplacegclang/gclang++, with the same pinned toolchain and bitcode-only-O0 -fno-inlineflags.rllvm-rustc(plusCC/CXXfor mixed), then one extraction from the linked artifact.deps/,build/andincremental/copies and also looks in a workspace's target directory.setup.shinstalls rllvm via Homebrew or cargo, and the docs cover all of it.Validation:
Identical sets on all C/C++ fixtures,
rust_main,rust_dyn,rust_generic,mixed_c_rust, and libxml2 2.9.2 with--static-libs auto(1903 reachable, 1133 unreachable).The test suite gives the same results under both captures (
REACHABILITY_CAPTURE=rllvm).The build-time crates on
url:Nothing is lost the other way: every function the fuzz binary defines, apart from the prebuilt std and libFuzzer's C++, is in the rllvm bitcode.