Skip to content

Commit 598eef3

Browse files
authored
Merge pull request swiftlang#38696 from mikeash/weak-import-dyld-calls
[Runtime] Weakly import dyld protocol conformance functions.
2 parents 0ccf43d + aec4ec4 commit 598eef3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@
3636
#if __has_include(<mach-o/dyld_priv.h>)
3737
#include <mach-o/dyld_priv.h>
3838
#define DYLD_EXPECTED_SWIFT_OPTIMIZATIONS_VERSION 1u
39+
40+
// Redeclare these functions as weak so we can build against a macOS 12 SDK and
41+
// still test on macOS 11.
42+
LLVM_ATTRIBUTE_WEAK
43+
struct _dyld_protocol_conformance_result
44+
_dyld_find_protocol_conformance(const void *protocolDescriptor,
45+
const void *metadataType,
46+
const void *typeDescriptor);
47+
48+
LLVM_ATTRIBUTE_WEAK
49+
struct _dyld_protocol_conformance_result
50+
_dyld_find_foreign_type_protocol_conformance(const void *protocol,
51+
const char *foreignTypeIdentityStart,
52+
size_t foreignTypeIdentityLength);
53+
54+
LLVM_ATTRIBUTE_WEAK
55+
uint32_t _dyld_swift_optimizations_version(void);
3956
#endif
4057

4158
// Set this to 1 to enable logging of calls to the dyld shared cache conformance

0 commit comments

Comments
 (0)