Skip to content

Commit 00a01e8

Browse files
committed
[CMake] Use separate namespace for demangling symbols used by runtime
This matches the behavior introduced with #30733. Addresses rdar://142550635
1 parent bc405c5 commit 00a01e8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ add_compile_definitions(
124124
$<$<BOOL:${SwiftCore_ENABLE_UNICODE_DATA}>:-DSWIFT_STDLIB_ENABLE_UNICODE_DATA> # Stubs
125125
$<$<BOOL:${SwiftCore_ENABLE_ENVIRONMENT}>:-DSWIFT_STDLIB_HAS_ENVIRON> # Concurrency, runtime, shims, platform overlay
126126
$<$<BOOL:${SwiftCore_ENABLE_BACKDEPLOYMENT_SUPPORT}>:-DSWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT> # Concurrency, Compatibility override, magic symbols
127+
# Target libraries that include libDemangling must define the name to use for
128+
# the inline namespace to distinguish symbols from those built for the
129+
# compiler, in order to avoid possible ODR violations if both are statically
130+
# linked into the same binary. (see also commit message for 5b1daa9055c99904c84862ecc313641fd9b26e63)
131+
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_INLINE_NAMESPACE=__runtime> # Demangling, runtime, Concurrency, RemoteInspection, SwiftRemoteMirror, swift-reflection-test
127132
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_THREADING_${SwiftCore_THREADING_PACKAGE}>
128133
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_RUNTIME_ENABLE_LEAK_CHECKER=$<BOOL:${SwiftCore_ENABLE_RUNTIME_LEAK_CHECKER}>>
129134
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_RUNTIME_CLOBBER_FREED_OBJECTS=$<BOOL:${SwiftCore_ENABLE_CLOBBER_FREED_OBJECTS}>>)

0 commit comments

Comments
 (0)