- // <rdar://problem/26934069> Somehow we found the dylib in the cache, but it is not this literal string, try simple expansions of @rpath
- if ( strncmp(path, "@rpath/", 7) == 0 ) {
+ if ( strncmp(path, "@rpath/libswift", 15) == 0 ) {
+ // <rdar://problem/51352017> a stable swift app built to run on pre-iOS-12.2 will use @rpath to reference swift dylibs in OS
+ const char* trailingPath = &path[7];
+ char possiblePath[strlen(trailingPath)+16];
+ strcpy(possiblePath, "/usr/lib/swift/");
+ strcat(possiblePath, trailingPath);
+ if ( hasDylib(possiblePath, &index) )
+ return index;
+ }
+ else if ( strncmp(path, "@rpath/", 7) == 0 ) {
+ // <rdar://problem/26934069> Somehow we found the dylib in the cache, but it is not this literal string, try simple expansions of @rpath