Skip to content

Commit 5fe4a78

Browse files
committed
Demangling: define SWIFT_RUNTIME when building
This is required to ensure that we do not get ODR violations due to LLVMSupport being linked in with multiple definitions. We would previously miscompile the library resulting in a mixed signature containing both `__swift::runtime::llvm::` and `::llvm::` versions of `StringRef`.
1 parent 4adccbd commit 5fe4a78

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Runtimes/Core/Demangling/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ target_compile_definitions(swiftDemangling PRIVATE
2121
# compiler, in order to avoid possible ODR violations if both are statically
2222
# linked into the same binary. (see also commit message for 5b1daa9055c99904c84862ecc313641fd9b26e63)
2323
target_compile_definitions(swiftDemangling PUBLIC
24-
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_INLINE_NAMESPACE=__runtime>)
24+
-DSWIFT_RUNTIME
25+
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_INLINE_NAMESPACE=__runtime>)
2526

2627
target_include_directories(swiftDemangling
2728
PRIVATE

0 commit comments

Comments
 (0)