From 4d066b0bb8daef5a0490cd84ecec15850f3b2924 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Thu, 2 May 2024 14:04:49 +0100 Subject: [PATCH] More robust platform detection for picking the binary format --- cargo-auditable/src/object_file.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cargo-auditable/src/object_file.rs b/cargo-auditable/src/object_file.rs index 5fed86c..320964a 100644 --- a/cargo-auditable/src/object_file.rs +++ b/cargo-auditable/src/object_file.rs @@ -86,9 +86,9 @@ fn create_object_file( // Unsupported architecture. _ => return None, }; - let binary_format = if target_triple.contains("-apple-") { + let binary_format = if info["target_vendor"] == "apple" { BinaryFormat::MachO - } else if target_triple.contains("-windows-") { + } else if info["target_os"] == "windows" { BinaryFormat::Coff } else { BinaryFormat::Elf