Claus Rørbech
01/18/2021, 5:08 PMUndefined symbols for architecture x86_64 in a KMM project based on https://github.com/Kotlin/kmm-sample/blob/master/README.md.
The ios framework (:shared:linkDebugFrameworkIos) only fails to link when disabling caching with kotlin.native.cacheKind=none (or if using Gradle composite builds for the dependencies), but works when using the cache when consuming the dependencies from a Maven repository.
The unresolved symbols are defined as custom declarations in a cinterop-wrapper’s def-file and used by static libraries in the dependent module. The klibs passed to konanc seems right and the klibs seems to contain the right symbols in the cstubs.bc. The only difference on the konanc command line when it works (i.e. without kotlin.native.cacheKind=none) is a couple of additional -Xcache-directory entries, that indeed contains archives containing the symbols. I have tried getting details from the linking phase (by various `freeCompilerArgs`/ `linker-option`s) without luck. Any idea on how to get insight in the linker invocation through konanc or any known limitations/issues around linking against custom declarations in a module’s? The project is available at https://github.com/realm/realm-kotlin/tree/master/examples/kmm-sampleArtyom Degtyarev [JB]
01/19/2021, 7:29 AM-Xverbose-phases=Linker compiler argument.Claus Rørbech
01/19/2021, 1:35 PMld invocation too. I will try to decipher the outputs and see if it raises any questions.Claus Rørbech
01/20/2021, 8:12 AMcstubs.bc (in any form). I created https://youtrack.jetbrains.com/issue/KT-44447 with steps to reproduce