[Interpreter] Fall back to loading Swift dylibs from /usr/lib/swift on Apple platforms.

Continue to load the dylibs next to the compiler if they exist. If they don't, then use the OS's dylibs.

rdar://problem/47528005
This commit is contained in:
Mike Ash
2019-05-16 14:41:25 -04:00
parent 379b7ad245
commit 3f774094b7
7 changed files with 53 additions and 14 deletions

View File

@@ -1066,9 +1066,12 @@ class ParseableInterfaceModuleLoaderImpl {
}
bool isInResourceDir(StringRef path) {
StringRef resourceDir = ctx.SearchPathOpts.RuntimeLibraryPath;
if (resourceDir.empty()) return false;
return path.startswith(resourceDir);
for (auto &RuntimeLibraryPath : ctx.SearchPathOpts.RuntimeLibraryPaths) {
if (path.startswith(RuntimeLibraryPath)) {
return true;
}
}
return false;
}
/// Finds the most appropriate .swiftmodule, whose dependencies are up to