Does anyone know how to get rid of these errors? :...
# kotlin-native
m
Does anyone know how to get rid of these errors? 🤔
Copy code
The /home/mira/.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/lib64/libpipewire-0.3.so: error: undefined reference to 'fcntl64', version 'GLIBC_2.28'
/usr/lib64/libpipewire-0.3.so: error: undefined reference to 'memfd_create', version 'GLIBC_2.27'
/usr/lib64/libpipewire-0.3.so: error: undefined reference to 'stat64', version 'GLIBC_2.33'
/usr/lib64/libpipewire-0.3.so: error: undefined reference to 'getrandom', version 'GLIBC_2.25'
/usr/lib64/libpipewire-0.3.so: error: undefined reference to 'fstat64', version 'GLIBC_2.33'
Is there any other option than compiling pipewire against glibc 2.19 (what Kotlin-LLVM has), if pipewire supports it at all?
n
Are you using Kotlin 1.5 or later? Versions of Kotlin older than 1.5 used the old linker which is far less strict than the new one, especially when dealing with glibc versioning.
m
This is the newest Kotlin 1.6 with the new memory model activated. The fact with the < 1.5 is good to know, but I would like to take the newest one because of the new MM.
🆗 1
n
There are a bunch of options that can be used to make the GCC Gold linker (the new linker used in Kotlin 1.5 and later) less strict, and can solve some issues: https://manpages.ubuntu.com/manpages/focal/man1/ld.gold.1.html
Try adding the
--allow-shlib-undefined
option to linkerOpts, and see if it resolves the issue.
👍 1
m
Thank you for your reply. Yes, that helped.
n
I often use that flag in sample type projects on the linuxArm32Hfp target, yet the linuxX64 target doesn't need it for some reason. There are cases where the flag doesn't need to be used at all however that will heavily depend on what C libraries are used in the project for each supported target.
229 Views