Skip to content

Commit dd35346

Browse files
committed
Use correct object file name
1 parent 71a174b commit dd35346

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cargo-afl/src/common.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use std::env;
55
use std::ffi::OsStr;
66
use std::path::{Path, PathBuf};
77

8+
pub const OBJECT_FILE_NAME: &str = "afl-compiler-rt.o";
9+
810
fn xdg_base_dir() -> xdg::BaseDirectories {
911
xdg::BaseDirectories::with_prefix("afl.rs")
1012
}
@@ -52,7 +54,7 @@ pub fn afl_llvm_dir() -> Result<PathBuf> {
5254
}
5355

5456
pub fn object_file_path() -> Result<PathBuf> {
55-
afl_llvm_dir().map(|path| path.join("libafl-llvm-rt.o"))
57+
afl_llvm_dir().map(|path| path.join(OBJECT_FILE_NAME))
5658
}
5759

5860
pub fn plugins_available() -> Result<bool> {

cargo-afl/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn build_afl(args: &Args, work_dir: &Path) -> Result<()> {
125125

126126
fn build_afl_llvm_runtime(_args: &Args, work_dir: &Path) -> Result<()> {
127127
let object_file_path = common::object_file_path()?;
128-
let _: u64 = std::fs::copy(work_dir.join("afl-compiler-rt.o"), &object_file_path)
128+
let _: u64 = std::fs::copy(work_dir.join(common::OBJECT_FILE_NAME), &object_file_path)
129129
.with_context(|| "could not copy object file")?;
130130

131131
Ok(())

0 commit comments

Comments
 (0)