Merge pull request #1465 from Homebrew/revert-1460-audit-ignore-weak-linkage

Revert "os/mac: MachO.dynamically_linked_libraries filtering."
This commit is contained in:
Mike McQuaid 2016-11-09 12:30:11 +00:00 committed by GitHub
commit c091882246
3 changed files with 5 additions and 10 deletions

View File

@ -23,10 +23,7 @@ class LinkageChecker
@keg.find do |file|
next if file.symlink? || file.directory?
next unless file.dylib? || file.mach_o_executable? || file.mach_o_bundle?
# weakly loaded dylibs may not actually exist on disk, so skip them
# when checking for broken linkage
file.dynamically_linked_libraries(except: :LC_LOAD_WEAK_DYLIB).each do |dylib|
file.dynamically_linked_libraries.each do |dylib|
@reverse_links[dylib] << file
if dylib.start_with? "@"
@variable_dylibs << dylib

View File

@ -1,7 +1,7 @@
require "vendor/macho/macho"
require "os/mac/architecture_list"
module MachOShim
module MachO
# @private
def macho
@macho ||= begin
@ -51,10 +51,8 @@ module MachOShim
end
end
def dynamically_linked_libraries(except: :none)
lcs = macho.dylib_load_commands.reject { |lc| lc.type == except }
lcs.map(&:name).map(&:to_s)
def dynamically_linked_libraries
macho.linked_dylibs
end
def dylib_id

View File

@ -1,5 +1,5 @@
require "os/mac/mach"
class Pathname
include MachOShim
include MachO
end