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 b340d2cf40d..8d071a813fc 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 @@ -184,7 +184,10 @@ class MacOSBasedLinker(targetProperties: AppleConfigurables) Family.OSX -> "osx" else -> error("Target $target is unsupported") } - val suffix = if (libraryName.isNotEmpty() && targetTriple.isSimulator) { + // TODO: remove after `minimalXcodeVersion` will be 12. + // Separate libclang_rt version for simulator appeared in Xcode 12. + val compilerRtForSimulatorExists = Xcode.current.version.substringBefore('.').toInt() >= 12 + val suffix = if ((libraryName.isNotEmpty() || compilerRtForSimulatorExists) && targetTriple.isSimulator) { "sim" } else { ""