Merge pull request #18456 from Homebrew/skip-incompatible-arch

This commit is contained in:
Carlo Cabrera 2024-09-30 22:54:50 +08:00 committed by GitHub
commit f0513c0d64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View File

@ -469,6 +469,11 @@ class Pathname
false
end
sig { params(_wanted_arch: Symbol).returns(T::Boolean) }
def arch_compatible?(_wanted_arch)
true
end
sig { returns(T::Array[String]) }
def rpaths
[]

View File

@ -115,6 +115,7 @@ class LinkageChecker
@keg.find do |file|
next if file.symlink? || file.directory?
next if !file.dylib? && !file.binary_executable? && !file.mach_o_bundle?
next unless file.arch_compatible?(Hardware::CPU.arch)
# weakly loaded dylibs may not actually exist on disk, so skip them
# when checking for broken linkage

View File

@ -68,6 +68,12 @@ module ELFShim
end
end
def arch_compatible?(wanted_arch)
return true unless elf?
wanted_arch == arch
end
def elf_type
return :dunno unless elf?