integration-test: read OBJCOPY from the environment with fallback

Check for the OBJCOPY environment variable and fall back to
`"llvm-objcopy"` if it's not set.

Simplifies running integration tests while maintaining backward
compatibility.

Fixes: #1142
pull/1143/head
Ignacy 1 week ago
parent cc2da4a2a4
commit cefee7e8c5

@ -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("-")

Loading…
Cancel
Save