From e41e47109992a26d67d355b39bd195915634e540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Fri, 22 Feb 2019 01:32:07 +0000 Subject: [PATCH 1/2] Fix broken OS detection The #141 workaround was actually fully disabled because the OS condition was wrong. This fixes the workaround. --- src/bin/cargo-afl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/cargo-afl.rs b/src/bin/cargo-afl.rs index 0931496f7..4c7e7f298 100644 --- a/src/bin/cargo-afl.rs +++ b/src/bin/cargo-afl.rs @@ -190,7 +190,7 @@ where common::afl_llvm_rt_dir().display() ); - if cfg!(linux) { + if cfg!(target_os = "linux") { // work around https://github.com/rust-fuzz/afl.rs/issues/141 / // https://github.com/rust-lang/rust/issues/53945, can be removed once // those are fixed. From 3b113857595aea621392573603f4800d4396661a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20C=C3=B4rte-Real?= Date: Fri, 22 Feb 2019 14:13:04 +0000 Subject: [PATCH 2/2] Fix passing extra RUSTFLAGS When the fix for #141 is in effect if you pass extra RUSTFLAGS there is no space separating them and the command line breaks. Fix that by adding a space at the end of those flags, just like it's done in the common string. --- src/bin/cargo-afl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/cargo-afl.rs b/src/bin/cargo-afl.rs index 4c7e7f298..da9edfc2b 100644 --- a/src/bin/cargo-afl.rs +++ b/src/bin/cargo-afl.rs @@ -194,8 +194,8 @@ where // work around https://github.com/rust-fuzz/afl.rs/issues/141 / // https://github.com/rust-lang/rust/issues/53945, can be removed once // those are fixed. - rustflags.push_str("-Clink-arg=-fuse-ld=gold"); - rustdocflags.push_str("-Clink-arg=-fuse-ld=gold"); + rustflags.push_str("-Clink-arg=-fuse-ld=gold "); + rustdocflags.push_str("-Clink-arg=-fuse-ld=gold "); } // add user provided flags