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