Skip to content

Commit 8d2f500

Browse files
committed
[Runtime] Add the retain attribute to make the backtracer work.
Without `retain` here, we might remove the reference that pulls in the backtracing support code. rdar://123504095
1 parent e65c105 commit 8d2f500

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/runtime/SwiftRT-ELF-WASM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static constexpr const void *__dso_handle = nullptr;
2828
#if SWIFT_ENABLE_BACKTRACING
2929
// Drag in a symbol from the backtracer, to force the static linker to include
3030
// the code.
31-
static const void *__backtraceRef __attribute__((used))
31+
static const void *__backtraceRef __attribute__((used, retain))
3232
= (const void *)swift::runtime::backtrace::_swift_backtrace_isThunkFunction;
3333
#endif
3434

0 commit comments

Comments
 (0)