Skip to content

Commit 9ff2bf5

Browse files
authored
kn: re-enable cross-compilation on Linux hosts (#145)
1 parent c861e77 commit 9ff2bf5

File tree

1 file changed

+7
-2
lines changed
  • build-support/src/main/kotlin/aws/sdk/kotlin/gradle/crt

1 file changed

+7
-2
lines changed

build-support/src/main/kotlin/aws/sdk/kotlin/gradle/crt/CMakeTasks.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ private fun Project.registerCmakeConfigureTask(
121121
}
122122
}
123123

124+
// FIXME? Compiling s2n-tls on GitHub Actions Ubuntu image (without Docker / cross-compilation) has errors like:
125+
// In function ‘s2n_hash_algorithms_init’
126+
// error: implicit declaration of function ‘EVP_MD_free’;
127+
// See https://github.com/aws/s2n-tls/blob/529b01a8363962a4e3809c9d9ee34fdd098fb0ba/tests/features/S2N_LIBCRYPTO_SUPPORTS_PROVIDERS.c#L29
128+
// and https://github.com/aws/s2n-tls/blob/529b01a8363962a4e3809c9d9ee34fdd098fb0ba/crypto/s2n_hash.c#L85
129+
124130
// executed from root build dir which is where CMakeLists.txt is
125131
// We _could_ use the undocumented -H flag but that will be harder to make work inside docker
126132
args.add(".")
@@ -207,8 +213,7 @@ private fun runCmake(project: Project, target: KotlinNativeTarget, cmakeArgs: Li
207213
workingDir(project.rootDir)
208214
val exeArgs = cmakeArgs.toMutableList()
209215
val exeName = when {
210-
// Only cross-compile on non-Linux hosts
211-
!HostManager.hostIsLinux && target.konanTarget in crossCompileTargets -> {
216+
target.konanTarget in crossCompileTargets -> {
212217
// cross compiling via dockcross - set the docker exe to cmake
213218
val containerScriptArgs = listOf("--args", "--pull=missing", "--", "cmake")
214219
exeArgs.addAll(0, containerScriptArgs)

0 commit comments

Comments
 (0)