[K/N] Properly support watchosArm64
This commit is contained in:
+4
-6
@@ -18,12 +18,7 @@ import org.jetbrains.kotlin.native.interop.indexer.*
|
||||
internal fun Type.isStret(target: KonanTarget): Boolean {
|
||||
val unwrappedType = this.unwrapTypedefs()
|
||||
val abiInfo: ObjCAbiInfo = when (target.architecture) {
|
||||
Architecture.ARM64 -> {
|
||||
// Currently, cinterop works with watchos_arm64 as with watchos_arm32.
|
||||
// TODO: ABI for watchos_arm64 should be revisited after LLVM update.
|
||||
require(target != KonanTarget.WATCHOS_ARM64)
|
||||
DarwinArm64AbiInfo()
|
||||
}
|
||||
Architecture.ARM64 -> DarwinArm64AbiInfo()
|
||||
|
||||
Architecture.X64 -> DarwinX64AbiInfo()
|
||||
|
||||
@@ -88,6 +83,9 @@ class DarwinArm32AbiInfo(private val target: KonanTarget) : ObjCAbiInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remember about arm64_32!
|
||||
*/
|
||||
class DarwinArm64AbiInfo : ObjCAbiInfo {
|
||||
override fun shouldUseStret(returnType: Type): Boolean {
|
||||
// On aarch64 stret is never the case, since an implicit argument gets passed on x8.
|
||||
|
||||
+1
-7
@@ -288,13 +288,7 @@ private fun processCLib(flavor: KotlinPlatform, cinteropArguments: CInteropArgum
|
||||
|
||||
val (nativeIndex, compilation) = plugin.buildNativeIndex(library, verbose)
|
||||
|
||||
// Our current approach to arm64_32 support is to compile armv7k version of bitcode
|
||||
// for arm64_32. That's the reason for this substitution.
|
||||
// TODO: Add proper support with the next LLVM update.
|
||||
val target = when (tool.target) {
|
||||
KonanTarget.WATCHOS_ARM64 -> KonanTarget.WATCHOS_ARM32
|
||||
else -> tool.target
|
||||
}
|
||||
val target = tool.target
|
||||
|
||||
val klibSuffix = CompilerOutputKind.LIBRARY.suffix(target)
|
||||
val moduleName = cinteropArguments.moduleName
|
||||
|
||||
Reference in New Issue
Block a user