Skip to content

Commit

Permalink
Merge pull request #16380 from cho-m/cpuid-in-static-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Dec 22, 2023
2 parents 4a8d9ce + 53acccc commit d1625b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Library/Homebrew/formula_cellar_checks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ def check_cpuid_instruction(formula)
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

Expand Down

0 comments on commit d1625b6

Please sign in to comment.