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.
This commit is contained in:
parent
d5aa9f8c67
commit
16e56907b5
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user