Skip to content

Commit

Permalink
integration-test: read OBJCOPY from the environment with fallback
Browse files Browse the repository at this point in the history
Check for the OBJCOPY environment variable and fall back to
`"llvm-objcopy"` if it's not set.

Simplifies running integration tests while mantaining backward
compatibility.

Fixes: aya-rs#1142
  • Loading branch information
ignacya committed Jan 22, 2025
1 parent cc2da4a commit e1639f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/integration-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ fn main() -> Result<()> {
let mut output = OsString::new();
output.push(".BTF=");
output.push(dst);
let objcopy_exec = env::var_os("OBJCOPY").unwrap_or("llvm-objcopy".into());
exec(
// NB: objcopy doesn't support reading from stdin, so we have to use llvm-objcopy.
Command::new("llvm-objcopy")
Command::new(objcopy_exec)
.arg("--dump-section")
.arg(output)
.arg("-")
Expand Down

0 comments on commit e1639f5

Please sign in to comment.