Fix install_name for dynamic cache (#4510)

This commit is contained in:
Alexander Shabalin
2020-11-10 10:36:13 +03:00
committed by Stanislav Erokhin
parent 598d0e07e3
commit 2c898fe72c
2 changed files with 6 additions and 2 deletions
@@ -114,7 +114,7 @@ internal class Linker(val context: Context) {
additionalLinkerArgs = if (target.family.isAppleFamily) {
when (context.config.produce) {
CompilerOutputKind.DYNAMIC_CACHE ->
listOf("-install_name", context.config.outputFiles.mainFile)
listOf("-install_name", context.config.outputFiles.dynamicCacheInstallName)
else -> listOf("-dead_strip")
}
} else {
@@ -39,6 +39,10 @@ class OutputFiles(outputPath: String?, target: KonanTarget, val produce: Compile
else
outputName.fullOutputName()
private val cacheFile = File(outputName.fullOutputName()).absoluteFile.name
val dynamicCacheInstallName = File(outputName).child(cacheFile).absolutePath
val tempCacheDirectory =
if (produce.isCache)
File(outputName + Random.nextLong().toString())
@@ -46,7 +50,7 @@ class OutputFiles(outputPath: String?, target: KonanTarget, val produce: Compile
val nativeBinaryFile =
if (produce.isCache)
tempCacheDirectory!!.child(File(outputName.fullOutputName()).absoluteFile.name).absolutePath
tempCacheDirectory!!.child(cacheFile).absolutePath
else mainFile
val symbolicInfoFile = "$nativeBinaryFile.dSYM"