diff --git a/kotlin-native/shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/Linker.kt b/kotlin-native/shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/Linker.kt index dcce518d8c8..aac5339b34e 100644 --- a/kotlin-native/shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/Linker.kt +++ b/kotlin-native/shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/Linker.kt @@ -363,6 +363,9 @@ class GccBasedLinker(targetProperties: GccConfigurables) if (!debug) +linkerNoDebugFlags if (dynamic) +linkerDynamicFlags +objectFiles + +libraries + +linkerArgs + if (mimallocEnabled) +mimallocLinkerDependencies // See explanation about `-u__llvm_profile_runtime` here: // https://github.com/llvm/llvm-project/blob/21e270a479a24738d641e641115bce6af6ed360a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp#L930 if (needsProfileLibrary) +listOf("-u__llvm_profile_runtime", profileLibrary!!) @@ -370,9 +373,6 @@ class GccBasedLinker(targetProperties: GccConfigurables) +linkerGccFlags +if (dynamic) "$libGcc/crtendS.o" else "$libGcc/crtend.o" +"$crtPrefix/crtn.o" - +libraries - +linkerArgs - if (mimallocEnabled) +mimallocLinkerDependencies }) } }