Cycle collector. (#175)
This commit is contained in:
committed by
Konstantin Anisimov
parent
f6cab824ab
commit
e3662bfa1e
+11
-11
@@ -25,7 +25,7 @@ internal abstract class PlatformFlags(val distribution: Distribution) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal open class MacOSPlatform(distribution: Distribution)
|
internal open class MacOSPlatform(distribution: Distribution)
|
||||||
: PlatformFlags(distribution) {
|
: PlatformFlags(distribution) {
|
||||||
|
|
||||||
override val llvmLtoFlags = properties.propertyList("llvmLtoFlags.osx")
|
override val llvmLtoFlags = properties.propertyList("llvmLtoFlags.osx")
|
||||||
@@ -34,7 +34,7 @@ internal open class MacOSPlatform(distribution: Distribution)
|
|||||||
override val linkerOptimizationFlags =
|
override val linkerOptimizationFlags =
|
||||||
properties.propertyList("linkerOptimizationFlags.osx")
|
properties.propertyList("linkerOptimizationFlags.osx")
|
||||||
override val linkerKonanFlags = properties.propertyList("linkerKonanFlags.osx")
|
override val linkerKonanFlags = properties.propertyList("linkerKonanFlags.osx")
|
||||||
override val linker = "${distribution.sysRoot}/usr/bin/ld"
|
override val linker = "${distribution.sysRoot}/usr/bin/ld"
|
||||||
|
|
||||||
open val arch = properties.propertyString("arch.osx")!!
|
open val arch = properties.propertyString("arch.osx")!!
|
||||||
open val osVersionMin = properties.propertyList("osVersionMin.osx")
|
open val osVersionMin = properties.propertyList("osVersionMin.osx")
|
||||||
@@ -48,8 +48,8 @@ internal open class MacOSPlatform(distribution: Distribution)
|
|||||||
return mutableListOf<String>(linker, "-demangle") +
|
return mutableListOf<String>(linker, "-demangle") +
|
||||||
if (optimize) listOf("-object_path_lto", "temporary.o", "-lto_library", distribution.libLTO) else {listOf<String>()} +
|
if (optimize) listOf("-object_path_lto", "temporary.o", "-lto_library", distribution.libLTO) else {listOf<String>()} +
|
||||||
listOf( "-dynamic", "-arch", arch) +
|
listOf( "-dynamic", "-arch", arch) +
|
||||||
osVersionMin +
|
osVersionMin +
|
||||||
listOf("-syslibroot", "$targetSysRoot",
|
listOf("-syslibroot", "$targetSysRoot",
|
||||||
"-o", executable) +
|
"-o", executable) +
|
||||||
objectFiles +
|
objectFiles +
|
||||||
if (optimize) linkerOptimizationFlags else {listOf<String>()} +
|
if (optimize) linkerOptimizationFlags else {listOf<String>()} +
|
||||||
@@ -58,7 +58,7 @@ internal open class MacOSPlatform(distribution: Distribution)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class IPhoneOSfromMacOSPlatform(distribution: Distribution)
|
internal class IPhoneOSfromMacOSPlatform(distribution: Distribution)
|
||||||
: MacOSPlatform(distribution) {
|
: MacOSPlatform(distribution) {
|
||||||
|
|
||||||
override val arch = properties.propertyString("arch.osx-ios")!!
|
override val arch = properties.propertyString("arch.osx-ios")!!
|
||||||
@@ -67,7 +67,7 @@ internal class IPhoneOSfromMacOSPlatform(distribution: Distribution)
|
|||||||
override val targetSysRoot = "${distribution.dependencies}/${properties.propertyString("targetSysRoot.osx-ios")!!}"
|
override val targetSysRoot = "${distribution.dependencies}/${properties.propertyString("targetSysRoot.osx-ios")!!}"
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class IPhoneSimulatorFromMacOSPlatform(distribution: Distribution)
|
internal class IPhoneSimulatorFromMacOSPlatform(distribution: Distribution)
|
||||||
: MacOSPlatform(distribution) {
|
: MacOSPlatform(distribution) {
|
||||||
|
|
||||||
override val arch = properties.propertyString("arch.osx-ios-sim")!!
|
override val arch = properties.propertyString("arch.osx-ios-sim")!!
|
||||||
@@ -75,7 +75,7 @@ internal class IPhoneSimulatorFromMacOSPlatform(distribution: Distribution)
|
|||||||
override val llvmLlcFlags = properties.propertyList("llvmLlcFlags.osx-ios-sim")
|
override val llvmLlcFlags = properties.propertyList("llvmLlcFlags.osx-ios-sim")
|
||||||
override val targetSysRoot = "${distribution.dependencies}/${properties.propertyString("targetSysRoot.osx-ios-sim")!!}"
|
override val targetSysRoot = "${distribution.dependencies}/${properties.propertyString("targetSysRoot.osx-ios-sim")!!}"
|
||||||
}
|
}
|
||||||
internal class LinuxPlatform(distribution: Distribution)
|
internal class LinuxPlatform(distribution: Distribution)
|
||||||
: PlatformFlags(distribution) {
|
: PlatformFlags(distribution) {
|
||||||
|
|
||||||
override val llvmLtoFlags = properties.propertyList("llvmLtoFlags.linux")
|
override val llvmLtoFlags = properties.propertyList("llvmLtoFlags.linux")
|
||||||
@@ -84,7 +84,7 @@ internal class LinuxPlatform(distribution: Distribution)
|
|||||||
override val linkerOptimizationFlags =
|
override val linkerOptimizationFlags =
|
||||||
properties.propertyList("linkerOptimizationFlags.linux")
|
properties.propertyList("linkerOptimizationFlags.linux")
|
||||||
override val linkerKonanFlags = properties.propertyList("linkerKonanFlags.linux")
|
override val linkerKonanFlags = properties.propertyList("linkerKonanFlags.linux")
|
||||||
override val linker = "${distribution.sysRoot}/../bin/ld.gold"
|
override val linker = "${distribution.sysRoot}/../bin/ld.gold"
|
||||||
|
|
||||||
val pluginOptimizationFlags =
|
val pluginOptimizationFlags =
|
||||||
properties.propertyList("pluginOptimizationFlags.linux")
|
properties.propertyList("pluginOptimizationFlags.linux")
|
||||||
@@ -122,7 +122,7 @@ internal class LinkStage(val context: Context) {
|
|||||||
val config = context.config.configuration
|
val config = context.config.configuration
|
||||||
|
|
||||||
val targetManager = TargetManager(config)
|
val targetManager = TargetManager(config)
|
||||||
private val distribution =
|
private val distribution =
|
||||||
Distribution(context.config.configuration)
|
Distribution(context.config.configuration)
|
||||||
private val properties = distribution.properties
|
private val properties = distribution.properties
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ internal class LinkStage(val context: Context) {
|
|||||||
KonanTarget.MACBOOK -> when (targetManager.current) {
|
KonanTarget.MACBOOK -> when (targetManager.current) {
|
||||||
KonanTarget.IPHONE_SIM
|
KonanTarget.IPHONE_SIM
|
||||||
-> IPhoneSimulatorFromMacOSPlatform(distribution)
|
-> IPhoneSimulatorFromMacOSPlatform(distribution)
|
||||||
KonanTarget.IPHONE
|
KonanTarget.IPHONE
|
||||||
-> IPhoneOSfromMacOSPlatform(distribution)
|
-> IPhoneOSfromMacOSPlatform(distribution)
|
||||||
KonanTarget.MACBOOK
|
KonanTarget.MACBOOK
|
||||||
-> MacOSPlatform(distribution)
|
-> MacOSPlatform(distribution)
|
||||||
@@ -209,7 +209,7 @@ internal class LinkStage(val context: Context) {
|
|||||||
fun linkStage() {
|
fun linkStage() {
|
||||||
context.log("# Compiler root: ${distribution.konanHome}")
|
context.log("# Compiler root: ${distribution.konanHome}")
|
||||||
|
|
||||||
val bitcodeFiles = listOf<BitcodeFile>(emitted, distribution.start, distribution.runtime,
|
val bitcodeFiles = listOf<BitcodeFile>(emitted, distribution.start, distribution.runtime,
|
||||||
distribution.launcher) + libraries
|
distribution.launcher) + libraries
|
||||||
|
|
||||||
val objectFiles = if (optimize) {
|
val objectFiles = if (optimize) {
|
||||||
|
|||||||
Reference in New Issue
Block a user