[wasm32] remove unstable hack of executing hosts OS tool for file copying intead of wasm linker
This commit is contained in:
committed by
Vasily Levchenko
parent
bb47a28c15
commit
0e89083a8d
+14
-8
@@ -231,11 +231,12 @@ internal open class WasmPlatform(distribution: Distribution)
|
|||||||
= emptyList<String>()
|
= emptyList<String>()
|
||||||
|
|
||||||
override fun linkCommand(objectFiles: List<ObjectFile>, executable: ExecutableFile, optimize: Boolean, debug: Boolean, dynamic: Boolean): List<String> {
|
override fun linkCommand(objectFiles: List<ObjectFile>, executable: ExecutableFile, optimize: Boolean, debug: Boolean, dynamic: Boolean): List<String> {
|
||||||
|
|
||||||
// No link stage for WASM yet, just give '.wasm' as output.
|
// No link stage for WASM yet, just give '.wasm' as output.
|
||||||
return mutableListOf(
|
val src = File(objectFiles.single())
|
||||||
*(if (TargetManager.host == KonanTarget.MINGW) arrayOf("${System.getenv("SystemRoot")}/System32/cmd.exe", "/c", "copy") else arrayOf("/bin/cp")),
|
val dst = File(executable)
|
||||||
objectFiles.single(), executable)
|
src.recursiveCopyTo(dst)
|
||||||
|
|
||||||
|
return listOf()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,7 +373,15 @@ internal class LinkStage(val context: Context) {
|
|||||||
executable = dylibPath.absolutePath
|
executable = dylibPath.absolutePath
|
||||||
}
|
}
|
||||||
|
|
||||||
val linkCommand = platform.linkCommand(objectFiles, executable, optimize, debug, dynamic) +
|
// Hack that removes using OS command line environment for copying files.
|
||||||
|
val toolExecution = platform.linkCommand(objectFiles, executable, optimize, debug, dynamic)
|
||||||
|
if (toolExecution.isEmpty() && platform is WasmPlatform) {
|
||||||
|
JavaScriptLinker(includedBinaries.filter{it.isJavaScript}, executable)
|
||||||
|
return executable
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(toolExecution.isNotEmpty())
|
||||||
|
val linkCommand = toolExecution +
|
||||||
platform.targetLibffi +
|
platform.targetLibffi +
|
||||||
asLinkerArgs(config.getNotNull(KonanConfigKeys.LINKER_ARGS)) +
|
asLinkerArgs(config.getNotNull(KonanConfigKeys.LINKER_ARGS)) +
|
||||||
entryPointSelector +
|
entryPointSelector +
|
||||||
@@ -392,9 +401,6 @@ internal class LinkStage(val context: Context) {
|
|||||||
runTool(*platform.dsymutilDryRunVerboseCommand(executable).toTypedArray())
|
runTool(*platform.dsymutilDryRunVerboseCommand(executable).toTypedArray())
|
||||||
runTool(*platform.dsymutilCommand(executable).toTypedArray())
|
runTool(*platform.dsymutilCommand(executable).toTypedArray())
|
||||||
}
|
}
|
||||||
if (platform is WasmPlatform) {
|
|
||||||
JavaScriptLinker(includedBinaries.filter{it.isJavaScript}, executable)
|
|
||||||
}
|
|
||||||
return executable
|
return executable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user