@@ -10,12 +10,6 @@ use super::common;
10
10
11
11
const AFL_SRC_PATH : & str = "AFLplusplus" ;
12
12
13
- // https://github.com/rust-fuzz/afl.rs/issues/148
14
- #[ cfg( target_os = "macos" ) ]
15
- static AR_CMD : & str = "/usr/bin/ar" ;
16
- #[ cfg( not( target_os = "macos" ) ) ]
17
- static AR_CMD : & str = "ar" ;
18
-
19
13
#[ allow( clippy:: struct_excessive_bools) ]
20
14
#[ derive( Default , Parser ) ]
21
15
#[ clap( after_help = "\
@@ -37,8 +31,8 @@ pub struct Args {
37
31
}
38
32
39
33
pub fn config ( args : & Args ) -> Result < ( ) > {
40
- let archive_file_path = common:: archive_file_path ( ) ?;
41
- if !args. force && archive_file_path . exists ( ) && args. plugins == common:: plugins_available ( ) ? {
34
+ let object_file_path = common:: object_file_path ( ) ?;
35
+ if !args. force && object_file_path . exists ( ) && args. plugins == common:: plugins_available ( ) ? {
42
36
let version = common:: afl_rustc_version ( ) ?;
43
37
bail ! (
44
38
"AFL LLVM runtime was already built for Rust {version}; run `cargo afl config --build \
@@ -129,26 +123,11 @@ fn build_afl(args: &Args, work_dir: &Path) -> Result<()> {
129
123
Ok ( ( ) )
130
124
}
131
125
132
- fn build_afl_llvm_runtime ( args : & Args , work_dir : & Path ) -> Result < ( ) > {
126
+ fn build_afl_llvm_runtime ( _args : & Args , work_dir : & Path ) -> Result < ( ) > {
133
127
let object_file_path = common:: object_file_path ( ) ?;
134
128
let _: u64 = std:: fs:: copy ( work_dir. join ( "afl-compiler-rt.o" ) , & object_file_path)
135
129
. with_context ( || "could not copy object file" ) ?;
136
130
137
- let archive_file_path = common:: archive_file_path ( ) ?;
138
- let mut command = Command :: new ( AR_CMD ) ;
139
- command
140
- . arg ( "r" )
141
- . arg ( archive_file_path)
142
- . arg ( object_file_path) ;
143
-
144
- if !args. verbose {
145
- command. stdout ( Stdio :: null ( ) ) ;
146
- command. stderr ( Stdio :: null ( ) ) ;
147
- }
148
-
149
- let success = command. status ( ) . as_ref ( ) . is_ok_and ( ExitStatus :: success) ;
150
- ensure ! ( success, "could not run 'ar'" ) ;
151
-
152
131
Ok ( ( ) )
153
132
}
154
133
0 commit comments