Merge pull request #16380 from cho-m/cpuid-in-static-lib

This commit is contained in:
Mike McQuaid 2023-12-22 01:12:26 +00:00 committed by GitHub
commit d1625b6e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -324,6 +324,14 @@ module FormulaCellarChecks
cpuid_instruction?(file, objdump)
end
hardlinks = Set.new
return if formula.lib.directory? && formula.lib.find.any? do |pn|
next false if pn.symlink? || pn.directory? || pn.extname != ".a"
next false unless hardlinks.add? [pn.stat.dev, pn.stat.ino]
cpuid_instruction?(pn, objdump)
end
"No `cpuid` instruction detected. #{formula} should not use `ENV.runtime_cpu_detection`."
end