Added support for mipsel
This commit is contained in:
committed by
ilmat192
parent
a6f4481c5b
commit
ca567ac35c
+3
-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.MIPS) add("--hash-style=gnu") // MIPS doesn't support hash-style=gnu
|
||||
if (distribution.target != KonanTarget.MIPS && distribution.target != KonanTarget.MIPSEL) 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)
|
||||
@@ -218,7 +218,8 @@ internal class LinkStage(val context: Context) {
|
||||
private val distribution = context.config.distribution
|
||||
|
||||
private val platform = when (target) {
|
||||
KonanTarget.LINUX, KonanTarget.RASPBERRYPI, KonanTarget.MIPS ->
|
||||
KonanTarget.LINUX, KonanTarget.RASPBERRYPI,
|
||||
KonanTarget.MIPS, KonanTarget.MIPSEL ->
|
||||
LinuxBasedPlatform(distribution)
|
||||
KonanTarget.MACBOOK, KonanTarget.IPHONE, KonanTarget.IPHONE_SIM ->
|
||||
MacOSBasedPlatform(distribution)
|
||||
|
||||
@@ -172,6 +172,30 @@ dynamicLinker.mips = /lib/ld.so.1
|
||||
# targetSysRoot relative
|
||||
abiSpecificLibraries.mips =
|
||||
|
||||
# MIPSel
|
||||
targetToolchain.linux-mipsel = target-gcc-toolchain-1-linux-mips-x86-64/x86_64-unknown-linux-gnu
|
||||
dependencies.linux-mipsel = \
|
||||
clang-llvm-3.9.0-linux-x86-64 \
|
||||
target-gcc-toolchain-1-linux-mips-x86-64 \
|
||||
target-sysroot-mipsel \
|
||||
libffi-3.2.1-2-linux-x86-64 \
|
||||
libffi-3.2.1-linux-mipsel
|
||||
quadruple.mipsel = mipsel-unknown-linux-gnu
|
||||
entrySelector.mipsel = --defsym main=Konan_main
|
||||
linkerOptimizationFlags.mipsel = --gc-sections
|
||||
targetSysRoot.mipsel = target-sysroot-mipsel
|
||||
# We could reuse host toolchain here.
|
||||
libffiDir.mipsel = libffi-3.2.1-linux-mipsel
|
||||
linkerKonanFlags.mipsel = -Bstatic -lstdc++ -Bdynamic -ldl -lm -lpthread
|
||||
# targetSysroot-relative.
|
||||
libGcc.mipsel = lib/gcc/mipsel-unknown-linux-gnu/4.9.4
|
||||
llvmLtoFlags.mipsel =
|
||||
llvmLtoOptFlags.mipsel = -O3 -function-sections
|
||||
llvmLtoNooptFlags.mipsel = -O1
|
||||
dynamicLinker.mipsel = /lib/ld.so.1
|
||||
# targetSysRoot relative
|
||||
abiSpecificLibraries.mipsel =
|
||||
|
||||
# Android ARM32, based on NDK for android-21.
|
||||
targetToolchain.osx-android_arm32 = target-toolchain-21-osx-android_arm32
|
||||
# TODO: split dependencies to host-dependent and host-independent parts.
|
||||
|
||||
@@ -2084,7 +2084,9 @@ kotlinNativeInterop {
|
||||
}
|
||||
|
||||
task interop0(type: RunInteropKonanTest) {
|
||||
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
||||
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
||||
(project.testTarget == 'mips') || // st_uid of '/' is not equal to 0 when using qemu
|
||||
(project.testTarget == 'mipsel') // st_uid of '/' is not equal to 0 when using qemu
|
||||
goldValue = "0\n0\n"
|
||||
source = "interop/basics/0.kt"
|
||||
interop = 'sysstat'
|
||||
@@ -2112,6 +2114,7 @@ task interop3(type: RunInteropKonanTest) {
|
||||
// test back on.
|
||||
disabled = (project.testTarget == 'raspberrypi') ||
|
||||
(project.testTarget == 'mips') ||
|
||||
(project.testTarget == 'mipsel') ||
|
||||
(project.testTarget == 'wasm32') // No interop for wasm yet.
|
||||
goldValue = "8 9 12 13 14 \n"
|
||||
source = "interop/basics/3.kt"
|
||||
@@ -2127,12 +2130,14 @@ task interop4(type: RunInteropKonanTest) {
|
||||
|
||||
task interop_bitfields(type: RunInteropKonanTest) {
|
||||
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
||||
expectedFail = (project.testTarget == 'mips') // 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 == 'mips') // fails because of big-endiannes
|
||||
goldValue = "42\n17\n1\n0\n"
|
||||
source = "interop/basics/funptr.kt"
|
||||
interop = 'cfunptr'
|
||||
|
||||
Reference in New Issue
Block a user