@@ -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 \
@@ -79,7 +73,6 @@ pub fn config(args: &Args) -> Result<()> {
79
73
let work_dir = tempdir. path ( ) . join ( AFL_SRC_PATH ) ;
80
74
81
75
build_afl ( args, & work_dir) ?;
82
- build_afl_llvm_runtime ( args, & work_dir) ?;
83
76
84
77
if args. plugins {
85
78
copy_afl_llvm_plugins ( args, & work_dir) ?;
@@ -129,29 +122,6 @@ fn build_afl(args: &Args, work_dir: &Path) -> Result<()> {
129
122
Ok ( ( ) )
130
123
}
131
124
132
- fn build_afl_llvm_runtime ( args : & Args , work_dir : & Path ) -> Result < ( ) > {
133
- let object_file_path = common:: object_file_path ( ) ?;
134
- let _: u64 = std:: fs:: copy ( work_dir. join ( "afl-compiler-rt.o" ) , & object_file_path)
135
- . with_context ( || "could not copy object file" ) ?;
136
-
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
- Ok ( ( ) )
153
- }
154
-
155
125
fn copy_afl_llvm_plugins ( _args : & Args , work_dir : & Path ) -> Result < ( ) > {
156
126
// Iterate over the files in the directory.
157
127
for result in work_dir
0 commit comments