Skip to content
Snippets Groups Projects
Unverified Commit 16e56907 authored by Carlo Cabrera's avatar Carlo Cabrera
Browse files

formula_cellar_checks: fix cpuid instruction check on Mojave

The output format of `objdump` on Mojave is different from newer
versions of macOS, so I've adjusted the relevant audit to account for
this difference.
parent d5aa9f8c
No related branches found
No related tags found
No related merge requests found
......@@ -345,10 +345,15 @@ module FormulaCellarChecks
def cpuid_instruction?(file, objdump = "objdump")
@instruction_column_index ||= {}
@instruction_column_index[objdump] ||= if Utils.popen_read(objdump, "--version").include? "LLVM"
1 # `llvm-objdump` or macOS `objdump`
else
2 # GNU binutils `objdump`
@instruction_column_index[objdump] ||= begin
objdump_version = Utils.popen_read(objdump, "--version")
if (objdump_version.match?(/^Apple LLVM/) && MacOS.version <= :mojave) ||
objdump_version.exclude?("LLVM")
2 # Mojave `objdump` or GNU Binutils `objdump`
else
1 # `llvm-objdump` or Catalina+ `objdump`
end
end
has_cpuid_instruction = false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment