Has anyone succeeded in running Knative on Android...
# kotlin-native
a
Has anyone succeeded in running Knative on Android with the new 16KB memory page size mode? So far, all I’ve experienced is crashes or build failures when trying to fix it. I have reported here https://youtrack.jetbrains.com/issue/KT-77899/Update-Kotlin-Native-Android-NDK-toolchain since that seems related to the LLVM version.
e
using
Copy code
linkerOpts("-Wl,-z,max-page-size=16384", "-Wl,-z,common-page-size=16384")
has worked for me
🙌 1
a
Thank for the tips, that indeed working. I have updated the ticket.
l
That toolchain could really do with an update. I suspect more and more similar issues will happen over time.
👌 1
m
Is compiling with 16KB page sizes needed for published klibs (i.e. a library), or only the final binary?
l
As far as I understand it all native code needs compiling to support it, so that includes any klibs too. Which makes it particularly important for the underlying toolchain to provide support out of the box.
m
jfc...
Wait, if that were the case, then how does the fix @ephemient provided work given kotlin stdlib klib for AndroidNative is not being compiled (currently) with 16KB page sizes.
l
(I could very well be wrong here, my knowledge of klibs is limited perhaps they don't contain architecture specific data?)
a
That only required for final shared lib, I think klib is an intermediate representation so there is no impact on this.
🙌 2
l
Ah that's good to know then. Still means each library project you depend on has to update with this change to support it?
a
If you produce a .so, yes. In my case, I'm including a library compiled with Rust. I had to update this library first to be compatible with 16KB. Then I'm repackaging it with two flavors: • Android/JVM: with the library compiled as a shared library (.so) • Android/Native: with the library embedded as a static library (.a) On Android JVM, there is no extra work since the .so is already compatible with 16KB, but on Android Native, if the end user wants to compile it as a shared library, they need to include this line https://github.com/wgpu4k/wgpu4k-native/blob/ec7da8ef76331b0a7c66c297e1084d6ad3434a80/demo/common/build.gradle.kts#L43
👍 1