Hey all, got this error when linking a C library t...
# multiplatform
a
Hey all, got this error when linking a C library to a Kotlin Native app:
Copy code
> Task :linkDebugExecutableNativeLinuxX64

e: /home/runner/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold invocation reported errors
The /home/runner/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold command returned non-zero exit code: 1.
output:
/usr/lib/x86_64-linux-gnu/libtinfo.so: error: undefined reference to 'stat', version 'GLIBC_2.33'
/usr/lib/x86_64-linux-gnu/libncurses.so.6: error: undefined reference to 'dlopen', version 'GLIBC_2.34'
/usr/lib/x86_64-linux-gnu/libncurses.so.6: error: undefined reference to 'dlclose', version 'GLIBC_2.34'
/usr/lib/x86_64-linux-gnu/libncurses.so.6: error: undefined reference to 'dlsym', version 'GLIBC_2.34'

> Task :linkDebugExecutableNativeLinuxX64 FAILED
Apparently, glibc bundled with Kotlin Native toolchain (2.19 in
x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2
) is of lower version than might be required (
GLIBC_2.33
). Any clues on how to resolve that would be welcome. Thanks!
j
No idea how to sort it out, maybe somebody here knows off the top of their head, but if I were to investigate this myself, I'd start by adding freeCompilerArgs += listOf("-Xverbose-phases=Linker") to your build.gradle.kts to see what exact parameters the linker uses. Hopefully that'll give you more info what to try next.
a
Hey Jan, thanks for a suggestion, I tried it and also checked Gradle output with
--info
and
--debug
flags and got no extra info from linker. Also filed a Kotlin issue , maybe Kotlin team would know, let’s see.