Skip to content

Commit 5a78591

Browse files
committed
Work around linking issues from rust-fuzz#141, rust-lang/rust#53945
rust-fuzz#141 + rust-lang/rust#53945 track issues with linkage which regressed when rust updated to llvm 8. This commit adds a work around for such issues for cargo-afl. This helps with the ergonomics of cargo-afl, particularly for those less familiar with the project and the above issues. These changes can be safely removed once patches are landed in llvm and rust updates to use the patched version.
1 parent 48bee64 commit 5a78591

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bin/cargo-afl.rs

+6
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ where
190190
common::afl_llvm_rt_dir().display()
191191
);
192192

193+
// work around https://github.com/rust-fuzz/afl.rs/issues/141 /
194+
// https://github.com/rust-lang/rust/issues/53945, can be removed once
195+
// those are fixed.
196+
rustflags.push_str("-Clink-arg=-fuse-ld=gold");
197+
rustdocflags.push_str("-Clink-arg=-fuse-ld=gold");
198+
193199
// add user provided flags
194200
rustflags.push_str(&env::var("RUSTFLAGS").unwrap_or_default());
195201
rustdocflags.push_str(&env::var("RUSTDOCFLAGS").unwrap_or_default());

0 commit comments

Comments
 (0)