diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index 32e8cb0895b..dfaaeb7421f 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -346,7 +346,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map) { + fun appendStaticInitializers() { val ctorName = context.config.moduleId.moduleConstructorName - val ctorFunction = LLVMAddFunction(context.llvmModule, ctorName, kVoidFuncType)!! // Create constructor function. + val ctorFunction = LLVMAddFunction(context.llvmModule, ctorName, kVoidFuncType)!! LLVMSetLinkage(ctorFunction, LLVMLinkage.LLVMExternalLinkage) generateFunction(codegen, ctorFunction) { val initGuard = LLVMAddGlobal(context.llvmModule, int32Type, "Konan_init_guard") @@ -2573,7 +2569,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map