[K/N] Cross-compilation of MIPS targets from macOS and Windows hosts
Fixes KT-52226
This commit is contained in:
@@ -675,11 +675,20 @@ runtimeDefinitions.linux_arm64 = USE_GCC_UNWIND=1 KONAN_LINUX=1 KONAN_ARM64=1 \
|
|||||||
gccToolchain.linux_mips32 = $toolchainDependency.linux_mips32
|
gccToolchain.linux_mips32 = $toolchainDependency.linux_mips32
|
||||||
|
|
||||||
targetToolchain.linux_x64-linux_mips32 = $gccToolchain.linux_mips32/mips-unknown-linux-gnu
|
targetToolchain.linux_x64-linux_mips32 = $gccToolchain.linux_mips32/mips-unknown-linux-gnu
|
||||||
|
targetToolchain.mingw_x64-linux_mips32 = $llvmHome.mingw_x64
|
||||||
|
targetToolchain.macos_x64-linux_mips32 = $llvmHome.macos_x64
|
||||||
|
targetToolchain.macos_arm64-linux_mips32 = $llvmHome.macos_arm64
|
||||||
|
|
||||||
emulatorDependency.linux_x64-linux_mips32 = qemu-mips-static-5.1.0-linux-2
|
emulatorDependency.linux_x64-linux_mips32 = qemu-mips-static-5.1.0-linux-2
|
||||||
emulatorExecutable.linux_x64-linux_mips32 = qemu-mips-static-5.1.0-linux-2/qemu-mips
|
emulatorExecutable.linux_x64-linux_mips32 = qemu-mips-static-5.1.0-linux-2/qemu-mips
|
||||||
dependencies.linux_x64-linux_mips32 = \
|
dependencies.linux_x64-linux_mips32 = \
|
||||||
$toolchainDependency.linux_mips32
|
$toolchainDependency.linux_mips32
|
||||||
|
dependencies.mingw_x64-linux_mips32 = \
|
||||||
|
$toolchainDependency.linux_mips32
|
||||||
|
dependencies.macos_x64-linux_mips32 = \
|
||||||
|
$toolchainDependency.linux_mips32
|
||||||
|
dependencies.macos_arm64-linux_mips32 = \
|
||||||
|
$toolchainDependency.linux_mips32
|
||||||
|
|
||||||
targetTriple.linux_mips32 = mips-unknown-linux-gnu
|
targetTriple.linux_mips32 = mips-unknown-linux-gnu
|
||||||
linkerOptimizationFlags.linux_mips32 = --gc-sections
|
linkerOptimizationFlags.linux_mips32 = --gc-sections
|
||||||
@@ -703,6 +712,9 @@ staticLibraryRelocationMode.linux_mips32 = pic
|
|||||||
executableRelocationMode.linux_mips32 = static
|
executableRelocationMode.linux_mips32 = static
|
||||||
|
|
||||||
linker.linux_x64-linux_mips32 = $targetToolchain.linux_x64-linux_mips32/bin/ld
|
linker.linux_x64-linux_mips32 = $targetToolchain.linux_x64-linux_mips32/bin/ld
|
||||||
|
linker.mingw_x64-linux_mips32 = $targetToolchain.mingw_x64-linux_mips32/bin/ld.lld
|
||||||
|
linker.macos_x64-linux_mips32 = $targetToolchain.macos_x64-linux_mips32/bin/ld.lld
|
||||||
|
linker.macos_arm64-linux_mips32 = $targetToolchain.macos_arm64-linux_mips32/bin/ld.lld
|
||||||
linkerHostSpecificFlags.linux_x64-linux_mips32 =
|
linkerHostSpecificFlags.linux_x64-linux_mips32 =
|
||||||
dynamicLinker.linux_mips32 = /lib/ld.so.1
|
dynamicLinker.linux_mips32 = /lib/ld.so.1
|
||||||
# targetSysRoot relative
|
# targetSysRoot relative
|
||||||
@@ -718,11 +730,20 @@ runtimeDefinitions.linux_mips32 = USE_GCC_UNWIND=1 KONAN_LINUX=1 KONAN_MIPS32=1
|
|||||||
gccToolchain.linux_mipsel32 = $toolchainDependency.linux_mipsel32
|
gccToolchain.linux_mipsel32 = $toolchainDependency.linux_mipsel32
|
||||||
|
|
||||||
targetToolchain.linux_x64-linux_mipsel32 = $gccToolchain.linux_mipsel32/mipsel-unknown-linux-gnu
|
targetToolchain.linux_x64-linux_mipsel32 = $gccToolchain.linux_mipsel32/mipsel-unknown-linux-gnu
|
||||||
|
targetToolchain.mingw_x64-linux_mipsel32 = $llvmHome.mingw_x64
|
||||||
|
targetToolchain.macos_x64-linux_mipsel32 = $llvmHome.macos_x64
|
||||||
|
targetToolchain.macos_arm64-linux_mipsel32 = $llvmHome.macos_arm64
|
||||||
|
|
||||||
emulatorDependency.linux_x64-linux_mipsel32 = qemu-mipsel-static-5.1.0-linux-2
|
emulatorDependency.linux_x64-linux_mipsel32 = qemu-mipsel-static-5.1.0-linux-2
|
||||||
emulatorExecutable.linux_x64-linux_mipsel32 = qemu-mipsel-static-5.1.0-linux-2/qemu-mipsel
|
emulatorExecutable.linux_x64-linux_mipsel32 = qemu-mipsel-static-5.1.0-linux-2/qemu-mipsel
|
||||||
dependencies.linux_x64-linux_mipsel32 = \
|
dependencies.linux_x64-linux_mipsel32 = \
|
||||||
$toolchainDependency.linux_mipsel32
|
$toolchainDependency.linux_mipsel32
|
||||||
|
dependencies.mingw_x64-linux_mipsel32 = \
|
||||||
|
$toolchainDependency.linux_mipsel32
|
||||||
|
dependencies.macos_x64-linux_mipsel32 = \
|
||||||
|
$toolchainDependency.linux_mipsel32
|
||||||
|
dependencies.macos_arm64-linux_mipsel32 = \
|
||||||
|
$toolchainDependency.linux_mipsel32
|
||||||
|
|
||||||
targetTriple.linux_mipsel32 = mipsel-unknown-linux-gnu
|
targetTriple.linux_mipsel32 = mipsel-unknown-linux-gnu
|
||||||
linkerOptimizationFlags.linux_mipsel32 = --gc-sections
|
linkerOptimizationFlags.linux_mipsel32 = --gc-sections
|
||||||
@@ -743,6 +764,9 @@ dynamicLibraryRelocationMode.linux_mipsel32 = pic
|
|||||||
staticLibraryRelocationMode.linux_mipsel32 = pic
|
staticLibraryRelocationMode.linux_mipsel32 = pic
|
||||||
|
|
||||||
linker.linux_x64-linux_mipsel32 = $targetToolchain.linux_x64-linux_mipsel32/bin/ld
|
linker.linux_x64-linux_mipsel32 = $targetToolchain.linux_x64-linux_mipsel32/bin/ld
|
||||||
|
linker.mingw_x64-linux_mipsel32 = $targetToolchain.mingw_x64-linux_mipsel32/bin/ld.lld
|
||||||
|
linker.macos_x64-linux_mipsel32 = $targetToolchain.macos_x64-linux_mipsel32/bin/ld.lld
|
||||||
|
linker.macos_arm64-linux_mipsel32 = $targetToolchain.macos_arm64-linux_mipsel32/bin/ld.lld
|
||||||
linkerHostSpecificFlags.linux_x64-linux_mipsel32 =
|
linkerHostSpecificFlags.linux_x64-linux_mipsel32 =
|
||||||
dynamicLinker.linux_mipsel32 = /lib/ld.so.1
|
dynamicLinker.linux_mipsel32 = /lib/ld.so.1
|
||||||
# targetSysRoot relative
|
# targetSysRoot relative
|
||||||
|
|||||||
@@ -46,85 +46,43 @@ open class HostManager(
|
|||||||
return targets[resolveAlias(name)] ?: throw TargetSupportException("Unknown target name: $name")
|
return targets[resolveAlias(name)] ?: throw TargetSupportException("Unknown target name: $name")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val commonTargets = setOf(
|
||||||
|
LINUX_X64,
|
||||||
|
LINUX_ARM32_HFP,
|
||||||
|
LINUX_ARM64,
|
||||||
|
LINUX_MIPS32,
|
||||||
|
LINUX_MIPSEL32,
|
||||||
|
MINGW_X86,
|
||||||
|
MINGW_X64,
|
||||||
|
ANDROID_X86,
|
||||||
|
ANDROID_X64,
|
||||||
|
ANDROID_ARM32,
|
||||||
|
ANDROID_ARM64,
|
||||||
|
WASM32
|
||||||
|
)
|
||||||
|
|
||||||
|
private val appleTargets = setOf(
|
||||||
|
MACOS_X64,
|
||||||
|
MACOS_ARM64,
|
||||||
|
IOS_ARM32,
|
||||||
|
IOS_ARM64,
|
||||||
|
IOS_X64,
|
||||||
|
IOS_SIMULATOR_ARM64,
|
||||||
|
WATCHOS_ARM32,
|
||||||
|
WATCHOS_ARM64,
|
||||||
|
WATCHOS_X86,
|
||||||
|
WATCHOS_X64,
|
||||||
|
WATCHOS_SIMULATOR_ARM64,
|
||||||
|
TVOS_ARM64,
|
||||||
|
TVOS_X64,
|
||||||
|
TVOS_SIMULATOR_ARM64,
|
||||||
|
)
|
||||||
|
|
||||||
private val enabledRegularByHost: Map<KonanTarget, Set<KonanTarget>> = mapOf(
|
private val enabledRegularByHost: Map<KonanTarget, Set<KonanTarget>> = mapOf(
|
||||||
LINUX_X64 to setOf(
|
LINUX_X64 to commonTargets,
|
||||||
LINUX_X64,
|
MINGW_X64 to commonTargets,
|
||||||
LINUX_ARM32_HFP,
|
MACOS_X64 to commonTargets + appleTargets,
|
||||||
LINUX_ARM64,
|
MACOS_ARM64 to commonTargets + appleTargets
|
||||||
LINUX_MIPS32,
|
|
||||||
LINUX_MIPSEL32,
|
|
||||||
MINGW_X86,
|
|
||||||
MINGW_X64,
|
|
||||||
ANDROID_X86,
|
|
||||||
ANDROID_X64,
|
|
||||||
ANDROID_ARM32,
|
|
||||||
ANDROID_ARM64,
|
|
||||||
WASM32
|
|
||||||
),
|
|
||||||
MINGW_X64 to setOf(
|
|
||||||
MINGW_X64,
|
|
||||||
MINGW_X86,
|
|
||||||
LINUX_X64,
|
|
||||||
LINUX_ARM32_HFP,
|
|
||||||
LINUX_ARM64,
|
|
||||||
ANDROID_X86,
|
|
||||||
ANDROID_X64,
|
|
||||||
ANDROID_ARM32,
|
|
||||||
ANDROID_ARM64,
|
|
||||||
WASM32
|
|
||||||
),
|
|
||||||
MACOS_X64 to setOf(
|
|
||||||
MACOS_X64,
|
|
||||||
MACOS_ARM64,
|
|
||||||
IOS_ARM32,
|
|
||||||
IOS_ARM64,
|
|
||||||
IOS_X64,
|
|
||||||
IOS_SIMULATOR_ARM64,
|
|
||||||
WATCHOS_ARM32,
|
|
||||||
WATCHOS_ARM64,
|
|
||||||
WATCHOS_X86,
|
|
||||||
WATCHOS_X64,
|
|
||||||
WATCHOS_SIMULATOR_ARM64,
|
|
||||||
TVOS_ARM64,
|
|
||||||
TVOS_X64,
|
|
||||||
TVOS_SIMULATOR_ARM64,
|
|
||||||
LINUX_X64,
|
|
||||||
LINUX_ARM32_HFP,
|
|
||||||
LINUX_ARM64,
|
|
||||||
MINGW_X86,
|
|
||||||
MINGW_X64,
|
|
||||||
ANDROID_X86,
|
|
||||||
ANDROID_X64,
|
|
||||||
ANDROID_ARM32,
|
|
||||||
ANDROID_ARM64,
|
|
||||||
WASM32
|
|
||||||
),
|
|
||||||
MACOS_ARM64 to setOf(
|
|
||||||
MACOS_ARM64,
|
|
||||||
MACOS_X64,
|
|
||||||
IOS_ARM32,
|
|
||||||
IOS_ARM64,
|
|
||||||
IOS_X64,
|
|
||||||
IOS_SIMULATOR_ARM64,
|
|
||||||
WATCHOS_ARM32,
|
|
||||||
WATCHOS_ARM64,
|
|
||||||
WATCHOS_X86,
|
|
||||||
WATCHOS_X64,
|
|
||||||
WATCHOS_SIMULATOR_ARM64,
|
|
||||||
TVOS_ARM64,
|
|
||||||
TVOS_X64,
|
|
||||||
TVOS_SIMULATOR_ARM64,
|
|
||||||
LINUX_X64,
|
|
||||||
LINUX_ARM32_HFP,
|
|
||||||
LINUX_ARM64,
|
|
||||||
MINGW_X86,
|
|
||||||
MINGW_X64,
|
|
||||||
ANDROID_X86,
|
|
||||||
ANDROID_X64,
|
|
||||||
ANDROID_ARM32,
|
|
||||||
ANDROID_ARM64,
|
|
||||||
WASM32
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
private val enabledExperimentalByHost: Map<KonanTarget, Set<KonanTarget>> = mapOf(
|
private val enabledExperimentalByHost: Map<KonanTarget, Set<KonanTarget>> = mapOf(
|
||||||
|
|||||||
Reference in New Issue
Block a user