File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 72
72
// SWIFT_RUNTIME_EXPORT on the library it's exported from.
73
73
74
74
// / Attribute used to export symbols from the runtime.
75
- #if defined(__MACH__) || defined(__ELF__)
75
+ #if defined(__MACH__)
76
+
76
77
# define SWIFT_EXPORT_ATTRIBUTE __attribute__ ((__visibility__(" default" )))
77
78
78
- #else // FIXME: this #else should be some sort of #elif Windows
79
+ #elif defined(__ELF__)
80
+
81
+ // We make assumptions that the runtime and standard library can refer to each
82
+ // other's symbols as DSO-local, which means we can't allow the dynamic linker
83
+ // to relocate these symbols. We must give them protected visibility while
84
+ // building the standard library and runtime.
85
+ # if defined(swiftCore_EXPORTS)
86
+ # define SWIFT_EXPORT_ATTRIBUTE __attribute__ ((__visibility__(" protected" )))
87
+ # else
88
+ # define SWIFT_EXPORT_ATTRIBUTE __attribute__ ((__visibility__(" default" )))
89
+ # endif
90
+
91
+ // FIXME: this #else should be some sort of #elif Windows
92
+ #else // !__MACH__ && !__ELF__
93
+
79
94
# if defined(__CYGWIN__)
80
95
# define SWIFT_EXPORT_ATTRIBUTE
81
96
# else
97
+
82
98
# if defined(swiftCore_EXPORTS)
83
99
# define SWIFT_EXPORT_ATTRIBUTE __declspec (dllexport)
84
100
# else
85
101
# define SWIFT_EXPORT_ATTRIBUTE __declspec (dllimport)
86
102
# endif
103
+
87
104
# endif
105
+
88
106
#endif
89
107
90
108
#if defined(__cplusplus)
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ SWIFT_RUNTIME_STDLIB_INTERFACE
37
37
ClassMetadata CLASS_METADATA_SYM (s20_RawNativeSetStorage);
38
38
} // namespace swift
39
39
40
+ SWIFT_RUNTIME_STDLIB_INTERFACE
40
41
swift::_SwiftEmptyArrayStorage swift::_swiftEmptyArrayStorage = {
41
42
// HeapObject header;
42
43
{
@@ -50,8 +51,7 @@ swift::_SwiftEmptyArrayStorage swift::_swiftEmptyArrayStorage = {
50
51
}
51
52
};
52
53
53
-
54
-
54
+ SWIFT_RUNTIME_STDLIB_INTERFACE
55
55
swift::_SwiftEmptyDictionaryStorage swift::_swiftEmptyDictionaryStorage = {
56
56
// HeapObject header;
57
57
{
@@ -79,7 +79,7 @@ swift::_SwiftEmptyDictionaryStorage swift::_swiftEmptyDictionaryStorage = {
79
79
0 // int entries; (zero'd bits)
80
80
};
81
81
82
-
82
+ SWIFT_RUNTIME_STDLIB_INTERFACE
83
83
swift::_SwiftEmptySetStorage swift::_swiftEmptySetStorage = {
84
84
// HeapObject header;
85
85
{
You can’t perform that action at this time.
0 commit comments