http://vegard.wiki/mediawiki/index.php?title=rustc_fuzzing&feed=atom&action=history
rustc fuzzing - Revision history
2024-03-29T05:21:03Z
Revision history for this page on the wiki
MediaWiki 1.33.1
http://vegard.wiki/mediawiki/index.php?title=rustc_fuzzing&diff=133&oldid=prev
Vegard: fix typo
2020-01-29T08:36:11Z
<p>fix typo</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 08:36, 29 January 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l9" >Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Set <tt>LD_LIBRARY_PATH</tt>:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Set <tt>LD_LIBRARY_PATH</tt>:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>:<source lang="Bash"></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>:<source lang="Bash"></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>LIBRARY_PATH="$(realpath ~/.local/share/afl.rs/rustc-*/afl.rs-*/afl-llvm-rt"</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>LIBRARY_PATH="$(realpath ~/.local/share/afl.rs/rustc-*/afl.rs-*/afl-llvm-rt<ins class="diffchange diffchange-inline">)</ins>"</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></source></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></source></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Change the options used to compile rustc:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Change the options used to compile rustc:</div></td></tr>
<!-- diff cache key mediawiki:diff::1.12:old-38:rev-133 -->
</table>
Vegard
http://vegard.wiki/mediawiki/index.php?title=rustc_fuzzing&diff=38&oldid=prev
Vegard: new page
2019-12-14T21:36:22Z
<p>new page</p>
<p><b>New page</b></p><div>Here is how to build rustc with AFL instrumentation:<br />
<br />
* Install AFL:<br />
:<source lang="Bash"><br />
cargo install afl<br />
</source><br />
:This will compile AFL and the LLVM plugins needed to build rust with AFL instrumentation.<br />
* Clone https://github.com/rust-lang/rust.<br />
* Set <tt>LD_LIBRARY_PATH</tt>:<br />
:<source lang="Bash"><br />
LIBRARY_PATH="$(realpath ~/.local/share/afl.rs/rustc-*/afl.rs-*/afl-llvm-rt"<br />
</source><br />
* Change the options used to compile rustc:<br />
:<source lang="Bash">RUSTFLAGS="-C llvm-args=-sanitizer-coverage-level=3 \<br />
-C llvm-args=-sanitizer-coverage-trace-pc-guard \<br />
-C passes=sancov \<br />
-l afl-llvm-rt \<br />
-L $(realpath ~/.local/share/afl.rs/rustc-*/afl.rs-*/afl-llvm-rt)"<br />
</source><br />
* Build rustc: <source lang="Bash">./x.py build</source><br />
* Test that it works:<br />
:<source lang="Bash"><br />
cargo afl showmap -o trace.txt -m 1024 -- \<br />
build/x86_64-unknown-linux-gnu/stage2/bin/rustc \<br />
--emit asm \ input.rs<br />
cat trace.txt<br />
</source><br />
* Clone https://github.com/rust-fuzz/afl.rs. This will give you the AFL version that you can use with the instrumented rustc.<br />
<br />
[[Category:Programming]]<br />
[[Category:Rust]]<br />
[[Category:Fuzzing]]</div>
Vegard