Skip to content

Commit 57b56a0

Browse files
Merge pull request #81904 from AnthonyLatsis/сковорода
runtime: Silence a `-Wglobal-constructors` error than appears with up…
2 parents ec48e41 + 8e16bc0 commit 57b56a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "ImageInspectionCommon.h"
1414
#include "swift/shims/MetadataSections.h"
1515
#include "swift/Runtime/Backtrace.h"
16+
#include "swift/Runtime/Config.h"
1617

1718
#include <cstddef>
1819
#include <new>
@@ -84,6 +85,7 @@ namespace {
8485
static swift::MetadataSections sections{};
8586
}
8687

88+
SWIFT_ALLOWED_RUNTIME_GLOBAL_CTOR_BEGIN
8789
__attribute__((__constructor__))
8890
static void swift_image_constructor() {
8991
#define SWIFT_SECTION_RANGE(name) \
@@ -119,3 +121,4 @@ static void swift_image_constructor() {
119121

120122
swift_addNewDSOImage(&sections);
121123
}
124+
SWIFT_ALLOWED_RUNTIME_GLOBAL_CTOR_END

0 commit comments

Comments
 (0)