Merge pull request #13570 from carlocab/report-system-framework-linkage

linkage_checker: report linkage with system frameworks
This commit is contained in:
Carlo Cabrera 2022-07-19 14:04:31 +08:00 committed by GitHub
commit 020c93ac84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,7 +198,7 @@ class LinkageChecker
# In macOS Big Sur and later, system libraries do not exist on-disk and instead exist in a cache. # In macOS Big Sur and later, system libraries do not exist on-disk and instead exist in a cache.
# If dlopen finds the dylib, then the linkage is not broken. # If dlopen finds the dylib, then the linkage is not broken.
@system_dylibs << dylib @system_dylibs << dylib
else elsif !system_framework?(dylib)
@broken_dylibs << dylib @broken_dylibs << dylib
end end
else else
@ -306,11 +306,13 @@ class LinkageChecker
def harmless_broken_link?(dylib) def harmless_broken_link?(dylib)
# libgcc_s_* is referenced by programs that use the Java Service Wrapper, # libgcc_s_* is referenced by programs that use the Java Service Wrapper,
# and is harmless on x86(_64) machines # and is harmless on x86(_64) machines
return true if [ [
"/usr/lib/libgcc_s_ppc64.1.dylib", "/usr/lib/libgcc_s_ppc64.1.dylib",
"/opt/local/lib/libgcc/libgcc_s.1.dylib", "/opt/local/lib/libgcc/libgcc_s.1.dylib",
].include?(dylib) ].include?(dylib)
end
def system_framework?(dylib)
dylib.start_with?("/System/Library/Frameworks/") dylib.start_with?("/System/Library/Frameworks/")
end end