From cefee7e8c557776c971c3c9abb2e40f1525920cc Mon Sep 17 00:00:00 2001 From: Ignacy Date: Wed, 22 Jan 2025 13:40:37 +0100 Subject: [PATCH] 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 --- test/integration-test/build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration-test/build.rs b/test/integration-test/build.rs index d7ae6ff0..ba23f9e7 100644 --- a/test/integration-test/build.rs +++ b/test/integration-test/build.rs @@ -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("-")