Skip to content
This repository was archived by the owner on Aug 10, 2021. It is now read-only.

Commit 7a1bdbd

Browse files
authored
Fix install_name for dynamic cache (#4510)
1 parent 018a015 commit 7a1bdbd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Linker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ internal class Linker(val context: Context) {
114114
additionalLinkerArgs = if (target.family.isAppleFamily) {
115115
when (context.config.produce) {
116116
CompilerOutputKind.DYNAMIC_CACHE ->
117-
listOf("-install_name", context.config.outputFiles.mainFile)
117+
listOf("-install_name", context.config.outputFiles.dynamicCacheInstallName)
118118
else -> listOf("-dead_strip")
119119
}
120120
} else {

backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/OutputFiles.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ class OutputFiles(outputPath: String?, target: KonanTarget, val produce: Compile
3939
else
4040
outputName.fullOutputName()
4141

42+
private val cacheFile = File(outputName.fullOutputName()).absoluteFile.name
43+
44+
val dynamicCacheInstallName = File(outputName).child(cacheFile).absolutePath
45+
4246
val tempCacheDirectory =
4347
if (produce.isCache)
4448
File(outputName + Random.nextLong().toString())
4549
else null
4650

4751
val nativeBinaryFile =
4852
if (produce.isCache)
49-
tempCacheDirectory!!.child(File(outputName.fullOutputName()).absoluteFile.name).absolutePath
53+
tempCacheDirectory!!.child(cacheFile).absolutePath
5054
else mainFile
5155

5256
val symbolicInfoFile = "$nativeBinaryFile.dSYM"

0 commit comments

Comments
 (0)