summaryrefslogtreecommitdiff
path: root/Source/cmBinUtilsMacOSMachOLinker.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmBinUtilsMacOSMachOLinker.cxx')
-rw-r--r--Source/cmBinUtilsMacOSMachOLinker.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx
index 98250b1c05..0f47146c5e 100644
--- a/Source/cmBinUtilsMacOSMachOLinker.cxx
+++ b/Source/cmBinUtilsMacOSMachOLinker.cxx
@@ -14,6 +14,18 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+namespace {
+bool IsMissingSystemDylib(std::string const& path)
+{
+ // Starting on macOS 11, the dynamic loader has a builtin cache of
+ // system-provided dylib files that do not exist on the filesystem.
+ // Tell our caller that these are expected to be missing.
+ return ((cmHasLiteralPrefix(path, "/System/Library/") ||
+ cmHasLiteralPrefix(path, "/usr/lib/")) &&
+ !cmSystemTools::PathExists(path));
+}
+}
+
cmBinUtilsMacOSMachOLinker::cmBinUtilsMacOSMachOLinker(
cmRuntimeDependencyArchive* archive)
: cmBinUtilsLinker(archive)
@@ -82,7 +94,8 @@ bool cmBinUtilsMacOSMachOLinker::GetFileDependencies(
return false;
}
if (resolved) {
- if (!this->Archive->IsPostExcluded(path)) {
+ if (!this->Archive->IsPostExcluded(path) &&
+ !IsMissingSystemDylib(path)) {
auto filename = cmSystemTools::GetFilenameName(path);
bool unique;
this->Archive->AddResolvedPath(filename, path, unique);