Renamed targets. Added linux_ prefix

mips32   -> linux_mips32
mipsel32 -> linux_mipsel32
This commit is contained in:
Sergey Bogolepov
2017-09-25 19:53:51 +07:00
committed by ilmat192
parent b7978c3a1f
commit 0fb788d580
7 changed files with 57 additions and 57 deletions
@@ -90,8 +90,8 @@ private val knownTargets = mapOf(
"iphone_sim" to "ios_sim", "iphone_sim" to "ios_sim",
"ios_sim" to "ios_sim", "ios_sim" to "ios_sim",
"raspberrypi" to "raspberrypi", "raspberrypi" to "raspberrypi",
"mips32" to "mips32", "linux_mips32" to "linux_mips32",
"mipsel32" to "mipsel32", "linux_mipsel32" to "linux_mipsel32",
"android_arm32" to "android_arm32", "android_arm32" to "android_arm32",
"android_arm64" to "android_arm64", "android_arm64" to "android_arm64",
"mingw" to "mingw", "mingw" to "mingw",
@@ -155,7 +155,7 @@ internal open class LinuxBasedPlatform(val distribution: Distribution)
"${targetSysRoot}/usr/lib64/crt1.o", "${targetSysRoot}/usr/lib64/crt1.o",
"${targetSysRoot}/usr/lib64/crti.o", "${libGcc}/crtbegin.o", "${targetSysRoot}/usr/lib64/crti.o", "${libGcc}/crtbegin.o",
"-L${llvmLib}", "-L${libGcc}")) "-L${llvmLib}", "-L${libGcc}"))
if (distribution.target != KonanTarget.MIPS32 && distribution.target != KonanTarget.MIPSEL32) add("--hash-style=gnu") // MIPS doesn't support hash-style=gnu if (distribution.target != KonanTarget.LINUX_MIPS32 && distribution.target != KonanTarget.LINUX_MIPSEL32) add("--hash-style=gnu") // MIPS doesn't support hash-style=gnu
addAll(specificLibs) addAll(specificLibs)
addAll(listOf("-L${targetSysRoot}/../lib", "-L${targetSysRoot}/lib", "-L${targetSysRoot}/usr/lib")) addAll(listOf("-L${targetSysRoot}/../lib", "-L${targetSysRoot}/lib", "-L${targetSysRoot}/usr/lib"))
if (optimize) addAll(listOf("-plugin", "$llvmLib/LLVMgold.so") + pluginOptimizationFlags) if (optimize) addAll(listOf("-plugin", "$llvmLib/LLVMgold.so") + pluginOptimizationFlags)
@@ -219,7 +219,7 @@ internal class LinkStage(val context: Context) {
private val platform = when (target) { private val platform = when (target) {
KonanTarget.LINUX, KonanTarget.RASPBERRYPI, KonanTarget.LINUX, KonanTarget.RASPBERRYPI,
KonanTarget.MIPS32, KonanTarget.MIPSEL32 -> KonanTarget.LINUX_MIPS32, KonanTarget.LINUX_MIPSEL32 ->
LinuxBasedPlatform(distribution) LinuxBasedPlatform(distribution)
KonanTarget.MACBOOK, KonanTarget.IPHONE, KonanTarget.IPHONE_SIM -> KonanTarget.MACBOOK, KonanTarget.IPHONE, KonanTarget.IPHONE_SIM ->
MacOSBasedPlatform(distribution) MacOSBasedPlatform(distribution)
+28 -28
View File
@@ -149,52 +149,52 @@ abiSpecificLibraries.raspberrypi = \
usr/lib/arm-linux-gnueabihf usr/lib/arm-linux-gnueabihf
# MIPS # MIPS
targetToolchain.linux-mips32 = target-gcc-toolchain-2-linux-mips/x86_64-unknown-linux-gnu targetToolchain.linux-linux_mips32 = target-gcc-toolchain-2-linux-mips/x86_64-unknown-linux-gnu
dependencies.linux-mips32 = \ dependencies.linux-linux_mips32 = \
clang-llvm-3.9.0-linux-x86-64 \ clang-llvm-3.9.0-linux-x86-64 \
target-gcc-toolchain-2-linux-mips \ target-gcc-toolchain-2-linux-mips \
target-sysroot-2-mips \ target-sysroot-2-mips \
libffi-3.2.1-2-linux-x86-64 \ libffi-3.2.1-2-linux-x86-64 \
libffi-3.2.1-2-linux-mips libffi-3.2.1-2-linux-mips
quadruple.mips32 = mips-unknown-linux-gnu quadruple.linux_mips32 = mips-unknown-linux-gnu
entrySelector.mips32 = --defsym main=Konan_main entrySelector.linux_mips32 = --defsym main=Konan_main
linkerOptimizationFlags.mips32 = --gc-sections linkerOptimizationFlags.linux_mips32 = --gc-sections
targetSysRoot.mips32 = target-sysroot-2-mips targetSysRoot.linux_mips32 = target-sysroot-2-mips
# We could reuse host toolchain here. # We could reuse host toolchain here.
libffiDir.mips32 = libffi-3.2.1-2-linux-mips libffiDir.linux_mips32 = libffi-3.2.1-2-linux-mips
linkerKonanFlags.mips32 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread linkerKonanFlags.linux_mips32 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread
# targetSysroot-relative. # targetSysroot-relative.
libGcc.mips32 = lib/gcc/mips-unknown-linux-gnu/4.9.4 libGcc.linux_mips32 = lib/gcc/mips-unknown-linux-gnu/4.9.4
llvmLtoFlags.mips32 = llvmLtoFlags.linux_mips32 =
llvmLtoOptFlags.mips32 = -O3 -function-sections llvmLtoOptFlags.linux_mips32 = -O3 -function-sections
llvmLtoNooptFlags.mips32 = -O1 llvmLtoNooptFlags.linux_mips32 = -O1
dynamicLinker.mips32 = /lib/ld.so.1 dynamicLinker.linux_mips32 = /lib/ld.so.1
# targetSysRoot relative # targetSysRoot relative
abiSpecificLibraries.mips32 = abiSpecificLibraries.linux_mips32 =
# MIPSel # MIPSel
targetToolchain.linux-mipsel32 = target-gcc-toolchain-2-linux-mips/x86_64-unknown-linux-gnu targetToolchain.linux-linux_mipsel32 = target-gcc-toolchain-2-linux-mips/x86_64-unknown-linux-gnu
dependencies.linux-mipsel32 = \ dependencies.linux-linux_mipsel32 = \
clang-llvm-3.9.0-linux-x86-64 \ clang-llvm-3.9.0-linux-x86-64 \
target-gcc-toolchain-2-linux-mips \ target-gcc-toolchain-2-linux-mips \
target-sysroot-2-mipsel \ target-sysroot-2-mipsel \
libffi-3.2.1-2-linux-x86-64 \ libffi-3.2.1-2-linux-x86-64 \
libffi-3.2.1-2-linux-mipsel libffi-3.2.1-2-linux-mipsel
quadruple.mipsel32 = mipsel-unknown-linux-gnu quadruple.linux_mipsel32 = mipsel-unknown-linux-gnu
entrySelector.mipsel32 = --defsym main=Konan_main entrySelector.linux_mipsel32 = --defsym main=Konan_main
linkerOptimizationFlags.mipsel32 = --gc-sections linkerOptimizationFlags.linux_mipsel32 = --gc-sections
targetSysRoot.mipsel32 = target-sysroot-2-mipsel targetSysRoot.linux_mipsel32 = target-sysroot-2-mipsel
# We could reuse host toolchain here. # We could reuse host toolchain here.
libffiDir.mipsel32 = libffi-3.2.1-2-linux-mipsel libffiDir.linux_mipsel32 = libffi-3.2.1-2-linux-mipsel
linkerKonanFlags.mipsel32 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread linkerKonanFlags.linux_mipsel32 = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread
# targetSysroot-relative. # targetSysroot-relative.
libGcc.mipsel32 = lib/gcc/mipsel-unknown-linux-gnu/4.9.4 libGcc.linux_mipsel32 = lib/gcc/mipsel-unknown-linux-gnu/4.9.4
llvmLtoFlags.mipsel32 = llvmLtoFlags.linux_mipsel32 =
llvmLtoOptFlags.mipsel32 = -O3 -function-sections llvmLtoOptFlags.linux_mipsel32 = -O3 -function-sections
llvmLtoNooptFlags.mipsel32 = -O1 llvmLtoNooptFlags.linux_mipsel32 = -O1
dynamicLinker.mipsel32 = /lib/ld.so.1 dynamicLinker.linux_mipsel32 = /lib/ld.so.1
# targetSysRoot relative # targetSysRoot relative
abiSpecificLibraries.mipsel32 = abiSpecificLibraries.linux_mipsel32 =
# Android ARM32, based on NDK for android-21. # Android ARM32, based on NDK for android-21.
targetToolchain.osx-android_arm32 = target-toolchain-21-osx-android_arm32 targetToolchain.osx-android_arm32 = target-toolchain-21-osx-android_arm32
+6 -6
View File
@@ -2085,8 +2085,8 @@ kotlinNativeInterop {
task interop0(type: RunInteropKonanTest) { task interop0(type: RunInteropKonanTest) {
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet. disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
(project.testTarget == 'mips32') || // st_uid of '/' is not equal to 0 when using qemu (project.testTarget == 'linux_mips32') || // st_uid of '/' is not equal to 0 when using qemu
(project.testTarget == 'mipsel32') (project.testTarget == 'linux_mipsel32')
goldValue = "0\n0\n" goldValue = "0\n0\n"
source = "interop/basics/0.kt" source = "interop/basics/0.kt"
interop = 'sysstat' interop = 'sysstat'
@@ -2113,8 +2113,8 @@ task interop3(type: RunInteropKonanTest) {
// There are plans to provide a solution and turn this // There are plans to provide a solution and turn this
// test back on. // test back on.
disabled = (project.testTarget == 'raspberrypi') || disabled = (project.testTarget == 'raspberrypi') ||
(project.testTarget == 'mips32') || (project.testTarget == 'linux_mips32') ||
(project.testTarget == 'mipsel32') || (project.testTarget == 'linux_mipsel32') ||
(project.testTarget == 'wasm32') // No interop for wasm yet. (project.testTarget == 'wasm32') // No interop for wasm yet.
goldValue = "8 9 12 13 14 \n" goldValue = "8 9 12 13 14 \n"
source = "interop/basics/3.kt" source = "interop/basics/3.kt"
@@ -2130,14 +2130,14 @@ task interop4(type: RunInteropKonanTest) {
task interop_bitfields(type: RunInteropKonanTest) { task interop_bitfields(type: RunInteropKonanTest) {
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
expectedFail = (project.testTarget == 'mips32') // fails because of big-endiannes expectedFail = (project.testTarget == 'linux_mips32') // fails because of big-endiannes
source = "interop/basics/bf.kt" source = "interop/basics/bf.kt"
interop = 'bitfields' interop = 'bitfields'
} }
task interop_funptr(type: RunInteropKonanTest) { task interop_funptr(type: RunInteropKonanTest) {
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
expectedFail = (project.testTarget == 'mips32') // fails because of big-endiannes expectedFail = (project.testTarget == 'linux_mips32') // fails because of big-endiannes
goldValue = "42\n17\n1\n0\n" goldValue = "42\n17\n1\n0\n"
source = "interop/basics/funptr.kt" source = "interop/basics/funptr.kt"
interop = 'cfunptr' interop = 'cfunptr'
@@ -284,10 +284,10 @@ fun handleExceptionContinuation(x: (Throwable) -> Unit): Continuation<Any?> = ob
def d8 = "$absoluteTargetToolchain/bin/d8" def d8 = "$absoluteTargetToolchain/bin/d8"
def launcherJs = "${exe}.js" def launcherJs = "${exe}.js"
return [d8, '--expose-wasm', launcherJs, '--', exe] return [d8, '--expose-wasm', launcherJs, '--', exe]
} else if (target == KonanTarget.MIPS32 || target == KonanTarget.MIPSEL32) { } else if (target == KonanTarget.LINUX_MIPS32 || target == KonanTarget.LINUX_MIPSEL32) {
def targetSysroot = TargetPropertiesKt.targetString(properties, "targetSysRoot", target) def targetSysroot = TargetPropertiesKt.targetString(properties, "targetSysRoot", target)
def absoluteTargetSysroot = "$dependenciesDir/$targetSysroot" def absoluteTargetSysroot = "$dependenciesDir/$targetSysroot"
def qemu = target == KonanTarget.MIPS32 ? "qemu-mips" : "qemu-mipsel" def qemu = target == KonanTarget.LINUX_MIPS32 ? "qemu-mips" : "qemu-mipsel"
def absoluteQemu = "$absoluteTargetToolchain/bin/$qemu" def absoluteQemu = "$absoluteTargetToolchain/bin/$qemu"
return [absoluteQemu, "-L", absoluteTargetSysroot, exe] return [absoluteQemu, "-L", absoluteTargetSysroot, exe]
} else { } else {
@@ -38,14 +38,14 @@ class ClangTarget(val target: KonanTarget, konanProperties: KonanProperties) {
"-I$sysRoot/usr/include/c++/4.8.3", "-I$sysRoot/usr/include/c++/4.8.3",
"-I$sysRoot/usr/include/c++/4.8.3/arm-linux-gnueabihf") "-I$sysRoot/usr/include/c++/4.8.3/arm-linux-gnueabihf")
KonanTarget.MIPS32 -> KonanTarget.LINUX_MIPS32 ->
listOf("-target", targetArg!!, listOf("-target", targetArg!!,
"-DUSE_GCC_UNWIND=1", "-DUSE_ELF_SYMBOLS=1", "-DELFSIZE=32", "-DUSE_GCC_UNWIND=1", "-DUSE_ELF_SYMBOLS=1", "-DELFSIZE=32",
"--sysroot=$sysRoot", "--sysroot=$sysRoot",
"-I$sysRoot/usr/include/c++/4.9.4", "-I$sysRoot/usr/include/c++/4.9.4",
"-I$sysRoot/usr/include/c++/4.9.4/mips-unknown-linux-gnu") "-I$sysRoot/usr/include/c++/4.9.4/mips-unknown-linux-gnu")
KonanTarget.MIPSEL32 -> KonanTarget.LINUX_MIPSEL32 ->
listOf("-target", targetArg!!, listOf("-target", targetArg!!,
"-DUSE_GCC_UNWIND=1", "-DUSE_ELF_SYMBOLS=1", "-DELFSIZE=32", "-DUSE_GCC_UNWIND=1", "-DUSE_ELF_SYMBOLS=1", "-DELFSIZE=32",
"--sysroot=$sysRoot", "--sysroot=$sysRoot",
@@ -33,23 +33,23 @@ enum class KonanTarget(val targetSuffix: String, val programSuffix: String, var
MINGW("mingw", "exe"), MINGW("mingw", "exe"),
MACBOOK("osx", "kexe"), MACBOOK("osx", "kexe"),
RASPBERRYPI("raspberrypi", "kexe"), RASPBERRYPI("raspberrypi", "kexe"),
MIPS32("mips32", "kexe"), LINUX_MIPS32("linux_mips32", "kexe"),
MIPSEL32("mipsel32", "kexe"), LINUX_MIPSEL32("linux_mipsel32", "kexe"),
WASM32("wasm32", "wasm"); WASM32("wasm32", "wasm");
val userName get() = name.toLowerCase() val userName get() = name.toLowerCase()
val platform get() = when (this) { val platform get() = when (this) {
ANDROID_ARM32 -> Platform.ANDROID ANDROID_ARM32 -> Platform.ANDROID
ANDROID_ARM64 -> Platform.ANDROID ANDROID_ARM64 -> Platform.ANDROID
IPHONE -> Platform.OSX IPHONE -> Platform.OSX
IPHONE_SIM -> Platform.OSX IPHONE_SIM -> Platform.OSX
MACBOOK -> Platform.OSX MACBOOK -> Platform.OSX
RASPBERRYPI -> Platform.LINUX RASPBERRYPI -> Platform.LINUX
LINUX -> Platform.LINUX LINUX -> Platform.LINUX
MIPS32 -> Platform.LINUX LINUX_MIPS32 -> Platform.LINUX
MIPSEL32 -> Platform.LINUX LINUX_MIPSEL32 -> Platform.LINUX
MINGW -> Platform.WINDOWS MINGW -> Platform.WINDOWS
WASM32 -> Platform.WASM WASM32 -> Platform.WASM
} }
} }
@@ -166,8 +166,8 @@ class TargetManager(val userRequest: String? = null) {
KonanTarget.LINUX -> { KonanTarget.LINUX -> {
KonanTarget.LINUX.enabled = true KonanTarget.LINUX.enabled = true
KonanTarget.RASPBERRYPI.enabled = true KonanTarget.RASPBERRYPI.enabled = true
KonanTarget.MIPS32.enabled = true KonanTarget.LINUX_MIPS32.enabled = true
KonanTarget.MIPSEL32.enabled = true KonanTarget.LINUX_MIPSEL32.enabled = true
KonanTarget.ANDROID_ARM32.enabled = true KonanTarget.ANDROID_ARM32.enabled = true
KonanTarget.ANDROID_ARM64.enabled = true KonanTarget.ANDROID_ARM64.enabled = true
} }