[RemoteMirror] Mark swift_reflection_classIsSwiftMask as a weak import.

Also have swift-reflection-test check if the symbol exists. This allows swift-reflection-test to work with older Remote Mirror dylibs that don't have it.

rdar://problem/50030805
This commit is contained in:
Mike Ash
2019-04-23 11:35:46 -04:00
parent a97a51956f
commit 8b0ab1cc49
3 changed files with 6 additions and 3 deletions

View File

@@ -576,7 +576,10 @@ int main(int argc, char *argv[]) {
const char *BinaryFilename = argv[1];
swift_reflection_classIsSwiftMask = computeClassIsSwiftMask();
// swift_reflection_classIsSwiftMask is weak linked so we can work
// with older Remote Mirror dylibs.
if (&swift_reflection_classIsSwiftMask != NULL)
swift_reflection_classIsSwiftMask = computeClassIsSwiftMask();
uint16_t Version = swift_reflection_getSupportedMetadataVersion();
printf("Metadata version: %u\n", Version);