Support for macos_arm64 target in backend
(cherry picked from commit 82775e93c1389f21f9be97bd0edfd16dd50300ea)
This commit is contained in:
committed by
Vasily Levchenko
parent
616beedbcf
commit
fddf28ac47
+7
-1
@@ -52,13 +52,19 @@ internal class BitcodeCompiler(val context: Context) {
|
||||
|
||||
val profilingFlags = llvmProfilingFlags().map { listOf("-mllvm", it) }.flatten()
|
||||
|
||||
// LLVM we use does not have support for arm64_32.
|
||||
// TODO: fix with LLVM update.
|
||||
val targetTriple = when (context.config.target) {
|
||||
// LLVM we use does not have support for arm64_32.
|
||||
KonanTarget.WATCHOS_ARM64 -> {
|
||||
require(configurables is AppleConfigurables)
|
||||
"arm64_32-apple-watchos${configurables.osVersionMin}"
|
||||
}
|
||||
// Runtime generates bitcode for mythical macos 10.16 because of old Clang.
|
||||
// Let's fix it.
|
||||
KonanTarget.MACOS_ARM64 -> {
|
||||
require(configurables is AppleConfigurables)
|
||||
"arm64-apple-macos${configurables.osVersionMin}"
|
||||
}
|
||||
else -> context.llvm.targetTriple
|
||||
}
|
||||
val flags = overrideClangOptions.takeIf(List<String>::isNotEmpty)
|
||||
|
||||
+2
@@ -1671,6 +1671,7 @@ private fun Context.is64BitNSInteger(): Boolean = when (val target = this.config
|
||||
KonanTarget.TVOS_ARM64,
|
||||
KonanTarget.TVOS_X64,
|
||||
KonanTarget.MACOS_X64,
|
||||
KonanTarget.MACOS_ARM64,
|
||||
KonanTarget.WATCHOS_X64 -> true
|
||||
KonanTarget.WATCHOS_ARM64,
|
||||
KonanTarget.WATCHOS_ARM32,
|
||||
@@ -1702,6 +1703,7 @@ internal fun Context.is64BitLong(): Boolean = when (this.config.target) {
|
||||
KonanTarget.MINGW_X64,
|
||||
KonanTarget.LINUX_X64,
|
||||
KonanTarget.MACOS_X64,
|
||||
KonanTarget.MACOS_ARM64,
|
||||
KonanTarget.WATCHOS_X64 -> true
|
||||
KonanTarget.WATCHOS_ARM64,
|
||||
KonanTarget.WATCHOS_ARM32,
|
||||
|
||||
+2
-3
@@ -136,8 +136,7 @@ internal class ObjCExport(val context: Context, symbolTable: SymbolTable) {
|
||||
modules.child("module.modulemap").writeBytes(moduleMap.toByteArray())
|
||||
|
||||
emitInfoPlist(frameworkContents, frameworkName)
|
||||
|
||||
if (target == KonanTarget.MACOS_X64) {
|
||||
if (target.family == Family.OSX) {
|
||||
framework.child("Versions/Current").createAsSymlink("A")
|
||||
for (child in listOf(frameworkName, "Headers", "Modules", "Resources")) {
|
||||
framework.child(child).createAsSymlink("Versions/Current/$child")
|
||||
@@ -163,7 +162,7 @@ internal class ObjCExport(val context: Context, symbolTable: SymbolTable) {
|
||||
KonanTarget.IOS_X64 -> "iPhoneSimulator"
|
||||
KonanTarget.TVOS_ARM64 -> "AppleTVOS"
|
||||
KonanTarget.TVOS_X64 -> "AppleTVSimulator"
|
||||
KonanTarget.MACOS_X64 -> "MacOSX"
|
||||
KonanTarget.MACOS_X64, KonanTarget.MACOS_ARM64 -> "MacOSX"
|
||||
KonanTarget.WATCHOS_ARM32, KonanTarget.WATCHOS_ARM64 -> "WatchOS"
|
||||
KonanTarget.WATCHOS_X86, KonanTarget.WATCHOS_X64 -> "WatchSimulator"
|
||||
else -> error(target)
|
||||
|
||||
Reference in New Issue
Block a user