From 006dd47873e8a41daf2db2eb169f26c974fe6e2e Mon Sep 17 00:00:00 2001 From: Ugljesa Jovanovic Date: Tue, 2 Jun 2020 23:59:01 +0200 Subject: [PATCH] Tried to get arm32 to work, but sysroot is missing getrandom, and no getrandom no libsodium as far as I understand. Everything compiles now, including the sample, tested kexe on arm64, runs and does sodium init at least --- buildSrc/src/main/kotlin/Utils.kt | 4 +- gradle.properties | 2 +- .../build.gradle.kts | 74 ++++--- .../package-lock.json | 201 ------------------ multiplatform-crypto-delegated/package.json | 15 -- sample/build.gradle.kts | 155 +++----------- .../ionspin/kotlin/crypto/sample/Sample.kt | 4 +- .../ionspin/kotlin/crypto/sample/Runner.kt | 0 .../ionspin/kotlin/bignum/integer/Placeholder | 0 .../ionspin/kotlin/crypto/sample/Runner.kt | 2 +- .../ionspin/kotlin/bignum/integer/Placeholder | 0 settings.gradle.kts | 2 +- sodiumWrapper/configureLinuxArm32.sh | 10 +- 13 files changed, 83 insertions(+), 386 deletions(-) delete mode 100644 multiplatform-crypto-delegated/package-lock.json delete mode 100644 multiplatform-crypto-delegated/package.json rename sample/src/{linuxMainArm32Hfp => linuxArm32HfpMain}/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt (100%) rename sample/src/{linuxTestArm32Hfp => linuxArm32HfpTest}/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder (100%) rename sample/src/{linuxMainArm64 => linuxArm64Main}/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt (86%) rename sample/src/{linuxTestArm64 => linuxArm64Test}/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder (100%) diff --git a/buildSrc/src/main/kotlin/Utils.kt b/buildSrc/src/main/kotlin/Utils.kt index 8296d1a..78a021f 100644 --- a/buildSrc/src/main/kotlin/Utils.kt +++ b/buildSrc/src/main/kotlin/Utils.kt @@ -80,7 +80,7 @@ fun independentDependencyBlock(nativeDeps : KotlinDependencyHandler.() -> Unit) */ fun NamedDomainObjectContainer.createWorkaroundNativeMainSourceSet(name : String, nativeDeps : KotlinDependencyHandler.() -> Unit) : KotlinSourceSet { return create("${name}Workaround") { - kotlin.srcDir("src/nativeMain/kotlin") + kotlin.srcDir("src/nativeMain") dependencies { nativeDeps.invoke(this) } @@ -90,7 +90,7 @@ fun NamedDomainObjectContainer.createWorkaroundNativeMainSource fun NamedDomainObjectContainer.createWorkaround32bitNativeMainSourceSet(name : String, nativeDeps : KotlinDependencyHandler.() -> Unit) : KotlinSourceSet { return create("${name}Workaround") { - kotlin.srcDir("src/native32Main/kotlin") + kotlin.srcDir("src/native32Main") dependencies { nativeDeps.invoke(this) } diff --git a/gradle.properties b/gradle.properties index 23b620c..335967a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,6 +19,6 @@ kotlin.code.style=official kotlin.js.compiler=ir #kotlin.js.experimental.generateKotlinExternals=true -kotlin.mpp.enableGranularSourceSetsMetadata=true +#kotlin.mpp.enableGranularSourceSetsMetadata=true org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4096m diff --git a/multiplatform-crypto-delegated/build.gradle.kts b/multiplatform-crypto-delegated/build.gradle.kts index 9aa063c..2fb4cdd 100644 --- a/multiplatform-crypto-delegated/build.gradle.kts +++ b/multiplatform-crypto-delegated/build.gradle.kts @@ -61,7 +61,7 @@ kotlin { js { browser { testTask { - enabled = true //Until I sort out testing on travis + enabled = false //Until I sort out testing on travis useKarma { useChrome() } @@ -109,22 +109,31 @@ kotlin { ) } } + // Linux 32 is using target-sysroot-2-raspberrypi which is missing getrandom and explicit_bzero in stdlib + // so konanc can't build klib because getrandom missing will cause sodium_misuse() + // ld.lld: error: undefined symbol: explicit_bzero + // >>> referenced by utils.c + // >>> libsodium_la-utils.o:(sodium_memzero) in archive /tmp/included11051337748775083797/libsodium.a + // + // ld.lld: error: undefined symbol: getrandom + // >>> referenced by randombytes_sysrandom.c + // >>> libsodium_la-randombytes_sysrandom.o:(_randombytes_linux_getrandom) in archive /tmp/included11051337748775083797/libsodium.a - linuxArm32Hfp() { - binaries { - staticLib { - } - } - compilations.getByName("main") { - val libsodiumCinterop by cinterops.creating { - defFile(project.file("src/nativeInterop/cinterop/libsodium.def")) - compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-arm32/include/") - } - kotlinOptions.freeCompilerArgs = listOf( - "-include-binary", "${project.rootDir}/sodiumWrapper/static-arm32/lib/libsodium.a" - ) - } - } +// linuxArm32Hfp() { +// binaries { +// staticLib { +// } +// } +// compilations.getByName("main") { +// val libsodiumCinterop by cinterops.creating { +// defFile(project.file("src/nativeInterop/cinterop/libsodium.def")) +// compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-arm32/include/") +// } +// kotlinOptions.freeCompilerArgs = listOf( +// "-include-binary", "${project.rootDir}/sodiumWrapper/static-arm32/lib/libsodium.a" +// ) +// } +// } } @@ -299,8 +308,9 @@ kotlin { "linuxX64", "linuxArm64" ) val linux32Bit = setOf( - "linuxArm32Hfp" + "" // "linuxArm32Hfp" ) + //iosArm32, iosArm64, iosX64, macosX64, metadata, tvosArm64, tvosX64, watchosArm32, watchosArm64, watchosX86 val macos64Bit = setOf( "macosX64" @@ -441,28 +451,28 @@ kotlin { val linuxX64Main by getting { dependsOn(nativeMain) isRunningInIdea { - kotlin.srcDir("src/nativeMain/kotlin") + kotlin.srcDir("src/nativeMain") } } val linuxX64Test by getting { dependsOn(nativeTest) isRunningInIdea { - kotlin.srcDir("src/nativeTest/kotlin") - } - } - - val linuxArm32HfpMain by getting { - dependsOn(native32Main) - isRunningInIdea { - kotlin.srcDir("src/native32Main/kotlin") - } - } - val linuxArm32HfpTest by getting { - dependsOn(native32Test) - isRunningInIdea { - kotlin.srcDir("src/native32Test/kotlin") + kotlin.srcDir("src/nativeTest") } } + //can still be useful for cinterop and debugging +// val linuxArm32HfpMain by getting { +// dependsOn(native32Main) +// isRunningInIdea { +// kotlin.srcDir("src/native32Main/kotlin") +// } +// } +// val linuxArm32HfpTest by getting { +// dependsOn(native32Test) +// isRunningInIdea { +// kotlin.srcDir("src/native32Test/kotlin") +// } +// } } runningOnMacos { diff --git a/multiplatform-crypto-delegated/package-lock.json b/multiplatform-crypto-delegated/package-lock.json deleted file mode 100644 index 19fe87b..0000000 --- a/multiplatform-crypto-delegated/package-lock.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "name": "kotlin-multiplatform-crypto-js", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "kotlin": { - "version": "1.3.40", - "resolved": "https://registry.npmjs.org/kotlin/-/kotlin-1.3.40.tgz", - "integrity": "sha512-3l718c3QznxsFNUrnsyGworQZrczyzKRhf+Rx/+7XhSS95S/QrCnlUVuEXA1l9iJpfxx4t9Ecc7+jC1JD28aYg==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - } - } -} diff --git a/multiplatform-crypto-delegated/package.json b/multiplatform-crypto-delegated/package.json deleted file mode 100644 index ffadd88..0000000 --- a/multiplatform-crypto-delegated/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "kotlin-multiplatform-crypto-js", - "version": "0.0.1", - "description": "Kotlin Multiplatform Crypto", - "main": "crypto.js", - "author": "Ugljesa Jovanovic", - "license": "Apache 2.0", - "homepage": "", - "dependencies": { - "kotlin": "1.3.40" - }, - "devDependencies": { - "mocha": "5.2.0" - } -} diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 5f7eb2a..e020c35 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -17,11 +17,8 @@ @file:Suppress("UnstableApiUsage") -import com.moowork.gradle.node.task.NodeTask -import org.gradle.api.tasks.testing.logging.TestLogging import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest -import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile plugins { kotlin(PluginsDeps.multiplatform) @@ -51,32 +48,11 @@ version = "0.0.4-SNAPSHOT" val ideaActive = System.getProperty("idea.active") == "true" -fun getHostOsName(): String { - val target = System.getProperty("os.name") - if (target == "Linux") return "linux" - if (target.startsWith("Windows")) return "windows" - if (target.startsWith("Mac")) return "macos" - return "unknown" -} - kotlin { val hostOsName = getHostOsName() - if (hostOsName == "linux") { + runningOnLinuxx86_64 { jvm() js { - compilations { - this.forEach { - it.compileKotlinTask.kotlinOptions.sourceMap = true - it.compileKotlinTask.kotlinOptions.moduleKind = "commonjs" - it.compileKotlinTask.kotlinOptions.metaInfo = true - - if (it.name == "main") { - it.compileKotlinTask.kotlinOptions.main = "call" - } - println("Compilation name ${it.name} set") - println("Destination dir ${it.compileKotlinTask.destinationDir}") - } - } browser { testTask { enabled = false //Until I sort out testing on travis @@ -99,28 +75,28 @@ kotlin { binaries { executable { - println("Optimized: $optimized") } } } - //Not supported in coroutines at the moment - linuxArm32Hfp() { - binaries { - staticLib { - } - } - } - //Not supported in coroutines at the moment + // Linux 32 is using target-sysroot-2-raspberrypi which is missing getrandom and explicit_bzero in stdlib + // so konanc can't build klib because getrandom missing will cause sodium_misuse() + // so 32bit will be only available from non-delegated flavor +// linuxArm32Hfp() { +// binaries { +// executable { +// } +// } +// } linuxArm64() { binaries { - staticLib { + executable { } } } } - if (hostOsName == "macos") { + runningOnMacos { iosX64("ios") { binaries { framework { @@ -151,7 +127,7 @@ kotlin { } } } - if (hostOsName == "windows") { + runningOnWindows { mingwX64() { binaries { @@ -161,15 +137,6 @@ kotlin { } } } -// No coroutines support for mingwX86 -// mingwX86() { -// binaries { -// staticLib { -// -// } -// } -// } - println(targets.names) @@ -205,24 +172,7 @@ kotlin { } } - targets.withType { - compilations.getByName("main") { - println("Setting native sourceset dependancy for $name") - if (this@withType.name.contains("ios").not()) { - println("Setting native sourceset deps for $this@withType.name") - defaultSourceSet.dependsOn(nativeMain) - } - } - compilations.getByName("test") { - println("Setting native sourceset dependancy for $name") - if (this@withType.name.contains("ios").not()) { - println("Setting native test deps for $this@withType.name") - defaultSourceSet.dependsOn(nativeTest) - } - } - } - - if (hostOsName == "linux") { + runningOnLinuxx86_64 { val jvmMain by getting { dependencies { implementation(kotlin(Deps.Jvm.stdLib)) @@ -253,58 +203,45 @@ kotlin { } val linuxMain by getting { dependsOn(nativeMain) - //Force idea to consider native sourceset - if (ideaActive) { - kotlin.srcDir("src/nativeMain/kotlin") - } } val linuxTest by getting { dependsOn(nativeTest) - //Force idea to consider native sourceset - if (ideaActive) { - kotlin.srcDir("src/nativeTest/kotlin") - } } - //Not supported in coroutines at the moment // val linuxArm32HfpMain by getting { // dependsOn(nativeMain) // } -// // val linuxArm32HfpTest by getting { // dependsOn(nativeTest) // } - -// val linuxArm64Main by getting { -// dependsOn(nativeMain) -// } -// -// val linuxArm64Test by getting { -// dependsOn(nativeTest) -// } - + val linuxArm64Main by getting { + dependsOn(nativeMain) + } + val linuxArm64Test by getting { + dependsOn(nativeTest) + } } - if (hostOsName == "macos") { + runningOnMacos { val iosMain by getting { -// dependsOn(nativeMain) + dependsOn(nativeMain) } val iosTest by getting { -// dependsOn(nativeTest) + dependsOn(nativeTest) } val ios64ArmMain by getting { -// dependsOn(nativeMain) + dependsOn(nativeMain) } val ios64ArmTest by getting { -// dependsOn(nativeTest) + dependsOn(nativeTest) } val ios32ArmMain by getting { -// dependsOn(nativeMain) + dependsOn(nativeMain) } val ios32ArmTest by getting { -// dependsOn(nativeTest) + dependsOn(nativeTest) } val macosX64Main by getting { @@ -315,19 +252,8 @@ kotlin { } } -// Coroutines don't support mingwx86 yet -// val mingwX86Main by getting { -// dependsOn(commonMain) -// dependencies { -// implementation(Deps.Native.coroutines) -// } -// } -// val mingwX86Test by getting { -// dependsOn(commonTest) -// } -// - if (hostOsName == "windows") { + runningOnWindows { val mingwX64Main by getting { dependsOn(commonMain) dependencies { @@ -349,16 +275,6 @@ kotlin { } - - -task("copyPackageJson") { - dependsOn("compileKotlinJs") - println("Copying package.json from $projectDir/core/src/jsMain/npm") - from ("$projectDir/src/jsMain/npm") - println("Node modules dir ${node.nodeModulesDir}") - into ("${node.nodeModulesDir}") -} - tasks { @@ -368,23 +284,8 @@ tasks { from(dokka.get().outputDirectory) } - dokka { - println ("Dokka !") - impliedPlatforms = mutableListOf("Common") - kotlinTasks { - listOf() - } - sourceRoot { - println ("Common !") - path = "/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/crypto/src/commonMain" //TODO remove static path! - platforms = listOf("Common") - } - } if (getHostOsName() == "linux") { - val npmInstall by getting - val compileKotlinJs by getting(AbstractCompile::class) - val compileTestKotlinJs by getting(Kotlin2JsCompile::class) val jvmTest by getting(Test::class) { testLogging { diff --git a/sample/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sample/Sample.kt b/sample/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sample/Sample.kt index 383b3f7..98798d7 100644 --- a/sample/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sample/Sample.kt +++ b/sample/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sample/Sample.kt @@ -1,5 +1,7 @@ package com.ionspin.kotlin.crypto.sample -class Sample { +object Sample { + fun blakehash() { + } } \ No newline at end of file diff --git a/sample/src/linuxMainArm32Hfp/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt b/sample/src/linuxArm32HfpMain/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt similarity index 100% rename from sample/src/linuxMainArm32Hfp/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt rename to sample/src/linuxArm32HfpMain/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt diff --git a/sample/src/linuxTestArm32Hfp/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder b/sample/src/linuxArm32HfpTest/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder similarity index 100% rename from sample/src/linuxTestArm32Hfp/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder rename to sample/src/linuxArm32HfpTest/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder diff --git a/sample/src/linuxMainArm64/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt b/sample/src/linuxArm64Main/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt similarity index 86% rename from sample/src/linuxMainArm64/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt rename to sample/src/linuxArm64Main/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt index bf7b023..c425dda 100644 --- a/sample/src/linuxMainArm64/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt +++ b/sample/src/linuxArm64Main/kotlin/com/ionspin/kotlin/crypto/sample/Runner.kt @@ -8,5 +8,5 @@ fun main() { println("Test") // Blake val blake = Blake2bDelegated() - blake.digest() + println("Result ${blake.digest()}") } diff --git a/sample/src/linuxTestArm64/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder b/sample/src/linuxArm64Test/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder similarity index 100% rename from sample/src/linuxTestArm64/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder rename to sample/src/linuxArm64Test/kotlin/com/ionspin/kotlin/bignum/integer/Placeholder diff --git a/settings.gradle.kts b/settings.gradle.kts index 31a58a2..fa503b5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -37,5 +37,5 @@ rootProject.name = "KotlinMultiplatformCrypto" include("multiplatform-crypto-api") include("multiplatform-crypto") include("multiplatform-crypto-delegated") -//include("sample") +include("sample") diff --git a/sodiumWrapper/configureLinuxArm32.sh b/sodiumWrapper/configureLinuxArm32.sh index ce751f2..9d623d0 100755 --- a/sodiumWrapper/configureLinuxArm32.sh +++ b/sodiumWrapper/configureLinuxArm32.sh @@ -1,10 +1,10 @@ #! /bin/sh export PREFIX="$(pwd)/static-arm32" #export CC=/usr/bin/arm-none-eabi-gcc -export TARGET_ARCH=armv7 -export SYSROOT="$HOME/.konan/dependencies/target-sysroot-2-raspberrypi --host=arm-none-eabi" +export SYSROOT=$HOME/.konan/dependencies/target-sysroot-2-raspberrypi +#export CFLAGS="-fno-stack-protector -mfpu=vfp -mfloat-abi=hard -I$SYSROOT/usr/include/c++/4.8.3 -I$SYSROOT/usr/include/c++/4.8.3/arm-linux-gnueabihf" export CFLAGS="" -export LDFLAGS="--specs=nosys.specs" +export LDFLAGS="" cd libsodium -./configure --prefix=$PREFIX --with-sysroot=$SYSROOT --host=arm-none-eabi "$@" - +./autogen.sh -s -f +./configure --prefix=$PREFIX --with-sysroot=$SYSROOT --host=arm-linux-gnueabihf "$@"